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
LINKS
G. C. Greubel, Table of n, a(n) for n = 0..1000
Index entries for linear recurrences with constant coefficients, signature (0,0,0,0,0,120).
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
KEYWORD
nonn
AUTHOR
Roger L. Bagula, Nov 16 2006
EXTENSIONS
Edited by N. J. A. Sloane, Nov 19 2006
STATUS
approved