OFFSET
0,4
LINKS
G. C. Greubel, Table of n, a(n) for n = 0..5000
Index entries for linear recurrences with constant coefficients, signature (0,0,2,0,0,-1).
FORMULA
From Bruno Berselli, Mar 11 2011: (Start)
G.f.: x*(1+x+3*x^2-x^3-x^4)/(1-x^3)^2.
a(n) = n^A079978(n).
E.g.f.: (1/3)*(x+2)*exp(x) - (2/3)*exp(-x/2)*( cos(sqrt(3)*x/2) + x*sin((Pi + 3*sqrt(3)*x)/6) ). - G. C. Greubel, Dec 05 2022
MATHEMATICA
Table[If[Divisible[n, 3], n, 1], {n, 0, 100}] (* or *) LinearRecurrence[ {0, 0, 2, 0, 0, -1}, {0, 1, 1, 3, 1, 1}, 100] (* Harvey P. Dale, Jun 18 2018 *)
PROG
(Magma) [n mod 3 eq 0 select n else 1: n in [0..100]]; // Bruno Berselli, Mar 11 2011
(SageMath)
def A088439(n): return 1 if (n%3) else n
[A088439(n) for n in range(121)] # G. C. Greubel, Dec 05 2022
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Roger L. Bagula, Nov 09 2003
STATUS
approved