login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A123761
Let k(n) = mod(3,n)-1. Then a(n) = 4*a(n-1) if n is odd, otherwise ((5+k(n))/4)*a(n-1), with a(0) = 1, a(1) = 2.
1
1, 2, 3, 12, 15, 60, 60, 240, 360, 1440, 1800, 7200, 7200, 28800, 43200, 172800, 216000, 864000, 864000, 3456000, 5184000, 20736000, 25920000, 103680000, 103680000, 414720000, 622080000, 2488320000, 3110400000, 12441600000
OFFSET
0,2
COMMENTS
A double modulo switch recursion with four basic ratio states: {4,1,5/4,3/2}.
Surprisingly, the function behaves very much like the factorial function.
10^floor(n/6) | a(n). - G. C. Greubel, Aug 10 2019
FORMULA
a(n) = 120*a(n-6) for n>=7.
G.f.: (1+2*x+3*x^2+12*x^3+15*x^4+60*x^5-60*x^6)/(1-120*x^6). - Colin Barker, May 08 2014
MAPLE
seq(coeff(series((1+2*x+3*x^2+12*x^3+15*x^4+60*x^5-60*x^6)/(1-120*x^6), x, n+1), x, n), n = 0 .. 35); # G. C. Greubel, Aug 10 2019
MATHEMATICA
k[n_]:= Mod[n, 3] -1; f[0]=1; f[1]=2; f[n_]:= f[n] = If[Mod[n, 2] == 1, 4*f[n-1], ((5 +k[n])/4)*f[n-1]]; Table[f[n], {n, 0, 35}]
LinearRecurrence[{0, 0, 0, 0, 0, 120}, {1, 2, 3, 12, 15, 60, 60}, 35] (* G. C. Greubel, Aug 10 2019 *)
PROG
(PARI) my(x='x+O('x^35)); Vec((1+2*x+3*x^2+12*x^3+15*x^4+60*x^5-60*x^6 )/(1-120*x^6)) \\ G. C. Greubel, Aug 10 2019
(Magma) I:=[2, 3, 12, 15, 60, 60]; [1] cat [n le 6 select I[n] else 120*Self(n-6): n in [1..35]]; // G. C. Greubel, Aug 10 2019
(Sage)
def A123761_list(prec):
P.<x> = PowerSeriesRing(ZZ, prec)
return P((1+2*x+3*x^2+12*x^3+15*x^4+60*x^5-60*x^6)/(1-120*x^6)).list()
A123761_list(35) # G. C. Greubel, Aug 10 2019
(GAP) a:=[2, 3, 12, 15, 60, 60];; for n in [7..35] do a[n]:=120*a[n-6]; od; Concatenation([1], a); # G. C. Greubel, Aug 10 2019
CROSSREFS
Sequence in context: A290168 A124486 A260908 * A181121 A345362 A333319
KEYWORD
nonn
AUTHOR
Roger L. Bagula, Nov 16 2006
EXTENSIONS
Edited by N. J. A. Sloane, Nov 19 2006
STATUS
approved