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
From Gus Wiseman, Oct 18 2023: (Start)
Also the number of subsets of {1..n} with n not the sum of two subset elements (possibly the same). For example, the a(0) = 1 through a(4) = 6 subsets are:
{} {} {} {} {}
{1} {2} {1} {1}
{2} {3}
{3} {4}
{1,3} {1,4}
{2,3} {3,4}
For subsets with no subset summing to n we have A365377.
The complement is counted by A366131.
(End) [Edited by Peter Munn, Nov 22 2023]
LINKS
FORMULA
a(n) = 2*3^floor((n-1)/2).
a(n) = 2*A108411(n-1).
From Colin Barker, Feb 15 2013: (Start)
a(n) = 3*a(n-2).
G.f.: -2*x*(x+1)/(3*x^2-1). (End)
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 *)
Table[Length[Select[Subsets[Range[n]], !MemberQ[Total/@Tuples[#, 2], n]&]], {n, 0, 10}] (* Gus Wiseman, Oct 18 2023 *)
PROG
(PARI) A117855(n)=2*3^((n-1)\2) \\ - M. F. Hasler, May 05 2013
(Python)
def A117855(n): return 3**(n-1>>1)<<1 # Chai Wah Wu, Oct 28 2024
CROSSREFS
Bisections are both A025192.
KEYWORD
nonn,base,easy
AUTHOR
Martin Renner, May 02 2006
EXTENSIONS
More terms from Colin Barker, Feb 15 2013
STATUS
approved