|
|
A189050
|
|
a(n) = if n even then P((n-2)/2)+P(n/2) otherwise 3*P((n+1)/2)+P((n-1)/2) where P(i) are the Pell numbers (A000129).
|
|
1
|
|
|
3, 1, 7, 3, 17, 7, 41, 17, 99, 41, 239, 99, 577, 239, 1393, 577, 3363, 1393, 8119, 3363, 19601, 8119, 47321, 19601, 114243, 47321, 275807, 114243, 665857, 275807, 1607521, 665857, 3880899, 1607521, 9369319, 3880899, 22619537, 9369319, 54608393, 22619537, 131836323, 54608393, 318281039, 131836323, 768398401, 318281039, 1855077841, 768398401
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,1
|
|
REFERENCES
|
R. P. Grimaldi, Ternary strings with no consecutive 0's and no consecutive 1's, Congressus Numerantium, 205 (2011), 129-149. See p. 142.
|
|
LINKS
|
|
|
FORMULA
|
a(n) = 2*a(n-2)+a(n-4). G.f.: -x*(3+x+x^2+x^3) / ( -1+2*x^2+x^4 ). - Colin Barker, Jul 24 2013
a(n) = a(n-1)+2*a(n-2) if n odd. a(n) =(a(n-1)-a(n-2))/2 if n even. - R. J. Mathar, Jun 18 2014
|
|
MAPLE
|
pal:=n-> if n mod 2 = 0 then P((n-2)/2)+P(n/2) else 3*P((n+1)/2)+P((n-1)/2); fi;
|
|
MATHEMATICA
|
nxt[{n_, a_, b_}]:={n+1, b, If[EvenQ[n], b+2a, (b-a)/2]}; NestList[nxt, {2, 3, 1}, 50][[All, 2]] (* or *) LinearRecurrence[{0, 2, 0, 1}, {3, 1, 7, 3}, 50] (* Harvey P. Dale, Mar 06 2019 *)
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,easy
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|