login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A259615 a(0)=0, a(1)=a(2)=a(3)=a(4)=1; thereafter, a(n) = Sum_{k=1..5} a(n-k-(a(n-k) mod 5)). 1

%I #58 Dec 30 2016 05:58:08

%S 0,1,1,1,1,3,4,5,9,9,11,19,23,27,45,87,105,205,401,587,747,1121,1763,

%T 2145,4085,7965,15529,16545,32503,38323,49767,74305,146847,180069,

%U 210427,341745,650987,787109,917411

%N a(0)=0, a(1)=a(2)=a(3)=a(4)=1; thereafter, a(n) = Sum_{k=1..5} a(n-k-(a(n-k) mod 5)).

%H Robert G. Wilson v, <a href="/A259615/b259615.txt">Table of n, a(n) for n = 0..1000</a>

%o (Sage) def first(m):

%o v=[0,1,1,1,1]

%o for i in range(5,m+1):

%o l=0

%o for s in range(1,5+1):

%o l += v[i-s-v[i-s]%5]

%o v.append(l)

%o return v

%o (Ruby) def first(m)

%o v=[0,1,1,1,1]

%o for i in 5..m-1

%o i2=0

%o for j in 1..5

%o r=i-j

%o i2 += v[r-v[r]%5]

%o end

%o v << i2

%o end

%o v

%o end

%Y Cf. A000322, A241154 (sequence obtained without mod 5 in formula).

%K nonn

%O 0,6

%A _Anders Hellström_, Jun 30 2015

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified May 7 00:25 EDT 2024. Contains 372298 sequences. (Running on oeis4.)