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.

A244551 Numbers k such that k +- (sum of digits of k) are both palindromes.

This page as a plain text file.
%I A244551 #33 Feb 14 2021 08:17:45
%S A244551 1,2,3,4,10,100,105,181,262,267,343,348,424,429,681,762,767,843,848,
%T A244551 924,929,1000,10000,100000,1000000,10000000,63999991,72999982,
%U A244551 81999973,90999964,100000000,1000000000,10000000000,100000000000,1000000000000,10000000000000,100000000000000,1000000000000000,10000000000000000
%N A244551 Numbers k such that k +- (sum of digits of k) are both palindromes.
%C A244551 For k = 0, 1, 2, ..., 10^k is a member of this sequence, so A011557 is a subsequence.
%C A244551 Also, floor(a(n)/10) must be in A244573.
%C A244551 Intersection of A229545 and A229621. - _Michel Marcus_, Jun 30 2014
%C A244551 The corresponding digit sums are: 1, 2, 3, 4, 1, 1, 6, 10, 10, 15, 10, 15, 10, 15, 15, 15, 20, 15, 20, 15, 20, 1, 1, 1, 1, 1, 55, 55, 55, 55, 1, 1, .... - _Derek Orr_, Jun 30 2014
%C A244551 When the digits sums are 1, the terms are a power of 10 terms, with corresponding palindromes being 2 apart (consecutive palindromes). The next instances of consecutive palindromes appear when digit sums are 55, so that the palindromes are 110 apart (see sequence A104459 that lists the possible differences between adjacent palindromes). - _Michel Marcus_, Jul 01 2014
%C A244551 There are infinitely many terms in this sequence that are not of the form 10^k for some k. Take the number 180 {59 9's} 631. This is a 65-digit number (180999...999631). This number is a member of this sequence. From this number, we can generate 34 other numbers. Keeping the 59 9's there, to preserve its properties, subtract 9 from 180 and add 90 to 631. Now we have 171 {59 9's} 721. This is also a member. The 59 9's are only to make the digit sum = 550. Thus, the two palindromes are 1100 apart, they are consecutive. If we keep doing this arithmetic (subtract 9 from the first number and add 90 to the second), we get 162 {59 9's} 811, 153 {59 9's} 901, 144 {58 9's} 991. The last number only has 58 9's in order to make sure the digit sum stays at 550. Other numbers and patterns to them have been listed in an a-file. Similarly, patterns like this will appear when considering digit sums of 5500 and larger. - _Derek Orr_, Jul 01 2014
%H A244551 Derek Orr, <a href="/A244551/a244551.txt">More terms in the sequence</a>
%e A244551 267 - (2+6+7) = 252 is a palindrome and 267 + (2+6+7) = 282 is also a palindrome. Thus 252 is a member of this sequence.
%o A244551 (PARI) rev(n)={r="";for(i=1,#digits(n),r=concat(Str(digits(n)[i]),r));return(eval(r))}
%o A244551 for(n=1,10^7,dig=digits(n);s=sum(k=1,#dig,dig[k]);sm=n-s;la=n+s;if(rev(sm)==sm&&rev(la)==la,print1(n,", ")))
%o A244551 (Python)
%o A244551 def palgen(l,b=10): # generator of palindromes in base b of length <= 2*l
%o A244551     if l > 0:
%o A244551         yield 0
%o A244551         for x in range(1,l+1):
%o A244551             n = b**(x-1)
%o A244551             n2 = n*b
%o A244551             for y in range(n,n2):
%o A244551                 k, m = y//b, 0
%o A244551                 while k >= b:
%o A244551                     k, r = divmod(k,b)
%o A244551                     m = b*m + r
%o A244551                 yield y*n + b*m + k
%o A244551             for y in range(n,n2):
%o A244551                 k, m = y, 0
%o A244551                 while k >= b:
%o A244551                     k, r = divmod(k,b)
%o A244551                     m = b*m + r
%o A244551                 yield y*n2 + b*m + k
%o A244551 A244551_list = []
%o A244551 for p in palgen(9):
%o A244551     l = len(str(p))
%o A244551     for i in range(1,l*9+1):
%o A244551         n = p-i
%o A244551         if n > 0:
%o A244551             if sum((int(d) for d in str(n))) == i:
%o A244551                 s = str(n-i)
%o A244551                 if s == s[::-1]:
%o A244551                     A244551_list.append(n) # _Chai Wah Wu_, Aug 24 2015
%Y A244551 Cf. A229545, A229621, A007953.
%K A244551 nonn,base
%O A244551 1,2
%A A244551 _Derek Orr_, Jun 29 2014
%E A244551 a(27)-a(32) from _Michel Marcus_, Jun 30 2014
%E A244551 a(33)-a(39) from _Chai Wah Wu_, Aug 24 2015