cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A117855 Number of nonzero palindromes of length n (in base 3).

This page as a plain text file.
%I A117855 #40 Oct 28 2024 12:07:50
%S A117855 2,2,6,6,18,18,54,54,162,162,486,486,1458,1458,4374,4374,13122,13122,
%T A117855 39366,39366,118098,118098,354294,354294,1062882,1062882,3188646,
%U A117855 3188646,9565938,9565938,28697814,28697814,86093442,86093442,258280326,258280326,774840978
%N A117855 Number of nonzero palindromes of length n (in base 3).
%C A117855 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
%C A117855 From _Gus Wiseman_, Oct 18 2023: (Start)
%C A117855 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:
%C A117855   {}  {}   {}   {}     {}
%C A117855       {1}  {2}  {1}    {1}
%C A117855                 {2}    {3}
%C A117855                 {3}    {4}
%C A117855                 {1,3}  {1,4}
%C A117855                 {2,3}  {3,4}
%C A117855 For subsets with no subset summing to n we have A365377.
%C A117855 Requiring pairs to be distinct gives A068911, complement A365544.
%C A117855 The complement is counted by A366131.
%C A117855 (End) [Edited by _Peter Munn_, Nov 22 2023]
%H A117855 <a href="/index/Rec#order_02">Index entries for linear recurrences with constant coefficients</a>, signature (0,3).
%F A117855 a(n) = 2*3^floor((n-1)/2).
%F A117855 a(n) = 2*A108411(n-1).
%F A117855 From _Colin Barker_, Feb 15 2013: (Start)
%F A117855 a(n) = 3*a(n-2).
%F A117855 G.f.: -2*x*(x+1)/(3*x^2-1). (End)
%e A117855 The a(3)=6 palindromes of length 3 are: 101, 111, 121, 202, 212, and 222. - _M. F. Hasler_, May 05 2013
%t A117855 With[{c=NestList[3#&,2,20]},Riffle[c,c]] (* _Harvey P. Dale_, Mar 25 2018 *)
%t A117855 Table[Length[Select[Subsets[Range[n]],!MemberQ[Total/@Tuples[#,2],n]&]],{n,0,10}] (* _Gus Wiseman_, Oct 18 2023 *)
%o A117855 (PARI) A117855(n)=2*3^((n-1)\2) \\ - _M. F. Hasler_, May 05 2013
%o A117855 (Python)
%o A117855 def A117855(n): return 3**(n-1>>1)<<1 # _Chai Wah Wu_, Oct 28 2024
%Y A117855 Cf. A050683 and A070252.
%Y A117855 Bisections are both A025192.
%Y A117855 A093971/A088809/A364534 count certain types of sum-full subsets.
%Y A117855 A108411 lists powers of 3 repeated, complement A167936.
%Y A117855 Cf. A004526, A004737, A008967, A038754, A046663, A167762, A365376, A366130.
%K A117855 nonn,base,easy
%O A117855 1,1
%A A117855 _Martin Renner_, May 02 2006
%E A117855 More terms from _Colin Barker_, Feb 15 2013