[go: up one dir, main page]

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!)
A141525 revision #7

A141525 a(n) = a(n-2) + a(n-3) if n mod 3 = 0, a(n-1) + a(n-4) if n mod 4 = 0, otherwise a(n-2) with a(0) = 0 and a(1) = a(2) = a(3) = 1. 1
0, 1, 1, 1, 1, 1, 2, 2, 3, 4, 4, 4, 8, 8, 8, 16, 24, 24, 40, 40, 64, 80, 80, 80, 160, 160, 160, 320, 480, 480, 800, 800, 1280, 1600, 1600, 1600, 3200, 3200, 3200, 6400, 9600, 9600, 16000, 16000, 25600, 32000, 32000, 32000, 64000, 64000, 64000, 128000, 192000, 192000, 320000, 320000, 512000, 640000, 640000, 640000, 1280000 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,7
COMMENTS
Lim_{n -> infinity} <a(n+1)/a(n)> = 1.324717957244746, where <> is the expectation value.
REFERENCES
.
LINKS
FORMULA
a(n) = a(n-2) + a(n-3) if n mod 3 = 0, a(n-1) + a(n-4) if n mod 4 = 0, otherwise a(n-2) with a(0) = 0 and a(1) = a(2) = a(3) = 1.
MATHEMATICA
a[n_]:= a[n]= If[n==0, 0, If[n<4, 1, If[Mod[n, 3]==0, a[n-2] + a[n-3], If[Mod[n, 4] ==0, a[n-1] + a[n-4], a[n-1] ]]]];
Table[a[n], {n, 0, 65}] (* modified by G. C. Greubel, Mar 29 2021 *)
PROG
(Magma)
function a(n)
if n eq 0 then return 0;
elif n lt 4 then return 1;
elif (n mod 3) eq 0 then return a(n-2) + a(n-3);
elif (n mod 4) eq 0 then return a(n-1) + a(n-4);
else return a(n-1);
end if; return a;
end function;
[a(n): n in [0..65]]; // G. C. Greubel, Mar 29 2021
(Sage)
@CachedFunction
def a(n):
if (n==0): return 0
elif (n<4): return 1
elif (n%3==0): return a(n-2) + a(n-3)
elif (n%4==0): return a(n-1) + a(n-4)
else: return a(n-1)
[a(n) for n in (0..65)] # G. C. Greubel, Mar 29 2021
CROSSREFS
Sequence in context: A049980 A359897 A209698 * A209764 A071475 A358104
KEYWORD
nonn
AUTHOR
Roger L. Bagula, Aug 11 2008
EXTENSIONS
Edited by G. C. Greubel, Mar 29 2021
STATUS
editing

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 August 29 09:16 EDT 2024. Contains 375511 sequences. (Running on oeis4.)