OFFSET
0,1
COMMENTS
Suggested by a test found on the Internet.
LINKS
G. C. Greubel, Table of n, a(n) for n = 0..1000
Jeffrey N. Shaumeyer, Bearcastle Blog, One Post, Two ... [Via Internet Archive Wayback-Machine]
Index entries for linear recurrences with constant coefficients, signature (0,0,3,0,0,-2).
FORMULA
G.f.: (19 + 14*x + 11*x^2 - 35*x^3 - 25*x^4 - 19*x^5)/((1 - 2*x^3)*(1 - x^3)).
a(3n) = 3*2^n+16, a(3n+1) = 3*2^n+11, a(3n+2) = 3*2^n+8.
MAPLE
f:=proc(n) option remember; if n=0 then RETURN(19); fi; if n mod 3 = 1 then RETURN(f(n-1)-5); elif n mod 3 = 2 then RETURN(f(n-1)-3); else RETURN(2*f(n-1)); fi; end;
MATHEMATICA
nxt[{b_, c_, d_}]:={d-5, d-8, 2d-16}; Join[{19}, Flatten[NestList[nxt, {14, 11, 22}, 20]]] (* Harvey P. Dale, Dec 01 2019 *)
PROG
(PARI) a(n)=3*2^(n\3)+[16, 11, 8][n%3+1] \\ M. F. Hasler, Nov 16 2010
(Magma) I:=[19, 14, 11, 22, 17, 14]; [n le 6 select I[n] else 3*Self(n-3) - 2*Self(n-6): n in [1..61]]; // G. C. Greubel, Sep 09 2021
(Sage)
def p(n): return 0 if (n%3==0) else 5 if (n%3==1) else 8
def a(n, b): return 2^(n//3)*(b-16) + 16 - p(n)
[a(n, 19) for n in (0..60)] # G. C. Greubel, Sep 09 2021
CROSSREFS
KEYWORD
nonn
AUTHOR
N. J. A. Sloane, based on correspondence with Jeffrey N. Shaumeyer, Apr 23 2006
STATUS
approved