zvoulgaris

Pentabonacci Numbers

Dec 13th, 2019
548
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. p5 = [0, 1, 1, 2, 4]
  2.  
  3. function pn(n::Int64)
  4.     z = Array{BigInt}(undef, n)
  5.     z[1:5] = p5
  6.  
  7.     for i = 6:n
  8.         z[i] = sum(z[i-5:i-1])
  9.     end
  10.  
  11.     return z
  12. end
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×