|
|
A117864
|
|
Number of palindromes (in base 5) below 5^n.
|
|
1
|
|
|
4, 8, 28, 48, 148, 248, 748, 1248, 3748, 6248, 18748, 31248, 93748, 156248, 468748, 781248, 2343748, 3906248, 11718748, 19531248, 58593748, 97656248, 292968748, 488281248, 1464843748, 2441406248, 7324218748, 12207031248, 36621093748, 61035156248
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,1
|
|
LINKS
|
|
|
FORMULA
|
a(n) = 6*5^((n-1)/2)-2 (n odd), 2*5^(n/2)-2 (n even).
a(1)=4, a(2)=8, a(3)=28, a(n)=a(n-1)+5*a(n-2)-5*a(n-3). - Harvey P. Dale, May 30 2012
G.f.: 4*x*(x+1) / ((x-1)*(5*x^2-1)). - Colin Barker, Apr 26 2015
|
|
MATHEMATICA
|
pal5s[n_]:=If[OddQ[n], 6 5^((n-1)/2)-2, 2 5^(n/2)-2]; Array[pal5s, 40] (* or *) LinearRecurrence[{1, 5, -5}, {4, 8, 28}, 40] (* Harvey P. Dale, May 30 2012 *)
|
|
PROG
|
(PARI) Vec(4*x*(x+1)/((x-1)*(5*x^2-1)) + O(x^100)) \\ Colin Barker, Apr 26 2015
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,base,easy
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|