login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 

Logo

Please make a donation to keep the OEIS running. We are now in our 56th year. In the past year we added 10000 new sequences and reached almost 9000 citations (which often say "discovered thanks to the OEIS").
Other ways to donate

Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A117855 Number of nonzero palindromes of length n (in base 3). 3
2, 2, 6, 6, 18, 18, 54, 54, 162, 162, 486, 486, 1458, 1458, 4374, 4374, 13122, 13122, 39366, 39366, 118098, 118098, 354294, 354294, 1062882, 1062882, 3188646, 3188646, 9565938, 9565938, 28697814, 28697814, 86093442, 86093442, 258280326, 258280326, 774840978 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,1

COMMENTS

See A225367 for the sequence that counts all base 3 palindromes, including 0 (and thus also the number of n-digit terms in A006072). -- A nonzero palindrome of length L=2k-1 or of length L=2k is determined by the first k digits, which then determine the last k digits by symmetry. Since the first digit cannot be 0, there are 2*3^(k-1) possibilities. - M. F. Hasler, May 05 2013

LINKS

Table of n, a(n) for n=1..37.

Index entries for linear recurrences with constant coefficients, signature (0,3).

FORMULA

a(n) = 2*3^floor((n-1)/2).

a(n) = 3*a(n-2). G.f.: -2*x*(x+1)/(3*x^2-1). [Colin Barker, Feb 15 2013]

EXAMPLE

The a(3)=6 palindromes of length 3 are: 101, 111, 121, 202, 212, and 222. - M. F. Hasler, May 05 2013

MATHEMATICA

With[{c=NestList[3#&, 2, 20]}, Riffle[c, c]] (* Harvey P. Dale, Mar 25 2018 *)

PROG

(PARI) A117855(n)=2*3^((n-1)\2) \\ - M. F. Hasler, May 05 2013

CROSSREFS

Cf. A050683 and A070252.

Sequence in context: A257389 A071908 A011260 * A086442 A071407 A309094

Adjacent sequences:  A117852 A117853 A117854 * A117856 A117857 A117858

KEYWORD

nonn,base,easy

AUTHOR

Martin Renner, May 02 2006

EXTENSIONS

More terms from Colin Barker, Feb 15 2013

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified November 25 13:47 EST 2020. Contains 338623 sequences. (Running on oeis4.)