|
|
A070402
|
|
a(n) = 2^n mod 5.
|
|
7
|
|
|
1, 2, 4, 3, 1, 2, 4, 3, 1, 2, 4, 3, 1, 2, 4, 3, 1, 2, 4, 3, 1, 2, 4, 3, 1, 2, 4, 3, 1, 2, 4, 3, 1, 2, 4, 3, 1, 2, 4, 3, 1, 2, 4, 3, 1, 2, 4, 3, 1, 2, 4, 3, 1, 2, 4, 3, 1, 2, 4, 3, 1, 2, 4, 3, 1, 2, 4, 3, 1, 2, 4, 3, 1, 2, 4, 3, 1, 2, 4, 3, 1, 2, 4, 3, 1, 2, 4, 3, 1, 2, 4, 3, 1, 2, 4, 3, 1, 2, 4, 3, 1, 2, 4, 3, 1
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,2
|
|
COMMENTS
|
|
|
LINKS
|
|
|
FORMULA
|
a(n) = a(n-1) - a(n-2) + a(n-3).
G.f.: (1 + x + 3*x^2) / ((1-x)*(1+x^2)). (End)
a(n) = 1 + (15*r^2 - 5*r - 4*r^3)/6, where r = n mod 4.
a(n) = A000689(n) - 5*floor(((n-1) mod 4)/2) for n>0. (End)
E.g.f.: (1/2)*(5*exp(x) - 3*cos(x) - sin(x)). - G. C. Greubel, Mar 19 2016
|
|
MAPLE
|
|
|
MATHEMATICA
|
PadRight[{}, 100, {1, 2, 4, 3}] (* or *) CoefficientList[Series[(1 + 2 x + 4 x^2 + 3 x^3) / (1 - x^4), {x, 0, 100}], x] (* Vincenzo Librandi, Mar 25 2016 *)
|
|
PROG
|
(Sage) [power_mod(2, n, 5) for n in range(0, 105)] # Zerinvary Lajos, Jun 08 2009
(PARI) for(n=0, 80, x=n%4; print1(1 + (15*x^2 -5*x -4*x^3)/6, ", ")) \\ Washington Bomfim, Nov 23 2010
(Magma) [Modexp(2, n, 5): n in [0..100]]; // Bruno Berselli, Mar 23 2016
(GAP) List([0..83], n->PowerMod(2, n, 5)); # Muniru A Asiru, Feb 01 2019
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,easy
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|