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.

A082267 Number of palindromes that use nonzero digits and have a digit sum of n.

This page as a plain text file.
%I A082267 #22 Dec 20 2018 23:55:57
%S A082267 1,2,2,4,4,8,8,16,16,31,31,62,62,124,124,248,248,496,496,991,991,1980,
%T A082267 1980,3956,3956,7904,7904,15792,15792,31553,31553,63044,63044,125964,
%U A082267 125964,251680,251680,502864,502864,1004737,1004737,2007494,2007494
%N A082267 Number of palindromes that use nonzero digits and have a digit sum of n.
%C A082267 Consider the array in which the n-th row contains all the palindromes that use nonzero digits and have a digit sum of n:
%C A082267 1
%C A082267 2 11
%C A082267 3 111
%C A082267 4 22 121 1111
%C A082267 5 131 212 11111
%C A082267 6 33 141 222 11211 1221 2112 111111
%C A082267 ...
%C A082267 a(n) = number of partitions of n into parts < 10 (single-digit nonzero parts) that can be arranged to form a palindrome.
%H A082267 G. C. Greubel, <a href="/A082267/b082267.txt">Table of n, a(n) for n = 1..1000</a>
%F A082267 a(1) = 1, a(2) = 2. For 2<n<10 and 11<n<20, a(n) = 2 * a(n-2). For n=10, 11 or 20, a(n) = 2 * a(n-2) - 1. Otherwise, for 21<=n, a(n) = 2 * a(n-2) - a(n-20). - Jonathan R. Love (japanada11(AT)yahoo.ca), Mar 08 2007
%F A082267 Further remarks from Jonathan R. Love (japanada11(AT)yahoo.ca), Mar 08 2007: (Start) For 2<n<10: a(9) = 16 because it can be written as 9, 4(1)4, 3(3)3, 2(5)2, or 1(7)1. All (n) can be expanded into a(n) different terms; for example, 2(5)2 can be written as 2(11111)2, 2(131)2, 2(212)2, or 2(5)2: 4 terms, since a(5) = 4. So a(9) = 1 + a(1) + a(3) + a(5) + a(7). Since a(7) = 1 + a(1) + a(3) + a(5), a(9) = a(7) + a(7) = 2 * a(7).
%F A082267 For n=10 or 11: Using the rules for 2<n<10, a(10) would be 32, but since one of these terms is the number itself, in this case 10 and only single-digit numbers can be used, one term must be subtracted. a(10) = 2 * a(8) - 1 = 31.
%F A082267 For 12<n<20: The same rules for 2<n<10 apply, because for 12 and up, the term taken away from 10 and 11 is added into the terms: a(12) = 62 = 2 * a(10). a(10) = 2 * a(8) - 1, so a(12) = 4 * a(8) - 2: 1 for (12) and one for 1(10)1.
%F A082267 For 20: Including the terms subtracted in 12<n<20, another term must be subtracted for (10)(10).
%F A082267 For 21<=n: From this point on, all possible terms are 9(a(n-18))9 + 8(a(n-16))8 + 7(a(n-14))7 + 6(a(n-12))6 + 5(a(n-10))5 + 4(a(n-8))4 + 3(a(n-6))3 + 2(a(n-4))2 + 1(a(n-2))1. If a(n-20) were to be included, it would need to be (10)(a(n-20))(10) and 10s can't be included. So everything must subtract a(n-20) from the total of 2 * a(n-2). For example, a(24) = 3956 = 2 * a(22) - a(4). (End)
%F A082267 Let c(n,k) (1<=k<=n) = number of compositions of n into parts of size <= k (cf. A126198). Then a(n) = Sum_{i=0..floor(n/2)} c(n,9). This follows by consideration of the central term, which may be any of n, n-2, n-4, ..., n-2i, ...; the prefix is then a composition of i into parts of size <= 9. - _N. J. A. Sloane_ Mar 09 2007
%F A082267 From _Colin Barker_, Feb 14 2013: (Start)
%F A082267 a(n) = 2*a(n-2) - a(n-20) for n > 20.
%F A082267 G.f.: x*(1+2*x-x^9-x^10-x^19) / (1-2*x^2+x^20). (End)
%p A082267 seq(coeff(series(x*(1+2*x-x^9-x^10-x^19)/(1-2*x^2+x^20),x,n+1), x, n), n = 1 .. 42); # _Muniru A Asiru_, Dec 08 2018
%Y A082267 Cf. A082264, A082265, A082266.
%K A082267 base,nonn
%O A082267 1,2
%A A082267 _Amarnath Murthy_, Apr 12 2003
%E A082267 Corrected and extended by Jonathan R. Love, Mar 08 2007