OFFSET
0,3
COMMENTS
This sequence is periodic. - T. D. Noe, Nov 09 2006
Decimal expansion of 35/303. - Elmo R. Oliveira, May 11 2024
LINKS
FORMULA
a(n) = a(n-1) - a(n-2) + a(n-3)
a(n) = 3 - 2*cos(Pi*n/2) - 2*sin(Pi*n/2).
a(n) = mod(A100284(n), 8).
From G. C. Greubel, Feb 06 2023: (Start)
a(n) = ((n+2 mod 4) + 5*(n mod 4) - 6*(n mod 2))/2.
G.f.: (1+5*x^2)/((1-x)*(1+x^2)).
E.g.f.: 3*exp(x) - 2*cos(x) - 2*sin(x). (End)
MATHEMATICA
CoefficientList[Series[(1+5x^2)/(1-x+x^2-x^3), {x, 0, 100}], x] (* or *) PadRight[{}, 100, {1, 1, 5, 5}] (* Harvey P. Dale, Jun 02 2021 *)
PROG
(Magma) [(((n+2) mod 4) + 5*(n mod 4) - 6*(n mod 2))/2: n in [0..100]]; // G. C. Greubel, Feb 06 2023
(SageMath)
def A100285(n): return (((n+2)%4) +5*(n%4) -6*(n%2))/2
[A100285(n) for n in range(101)] # G. C. Greubel, Feb 06 2023
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Paul Barry, Nov 11 2004
EXTENSIONS
Corrected by T. D. Noe, Nov 09 2006
STATUS
approved