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.

A229622 Palindromes m such that m + (sum of digits of m) is also a palindrome.

This page as a plain text file.
%I A229622 #39 Mar 17 2023 02:33:02
%S A229622 0,1,2,3,4,181,191,262,343,424,505,696,767,848,929,28999999999982,
%T A229622 37999999999973,46999999999964,55999999999955,64999999999946,
%U A229622 73999999999937,82999999999928,91999999999919,1099999999999901
%N A229622 Palindromes m such that m + (sum of digits of m) is also a palindrome.
%C A229622 Palindromes in A229545.
%C A229622 This sequence is infinite. It is possible to generate an infinite subsequence using 1099999999999901 as a model. Look at palindromes of the form: 1, z zeros, floor(11*10^z/9) nines, z zeros, 1. The sum of the digits is 11*10^z. Adding 11*10^z to the number produces a palindrome having 4 ones. - _T. D. Noe_, Oct 03 2013
%e A229622 262 + (2+6+2) = 272 (another palindrome). So 262 is in this sequence.
%t A229622 isPal[d_List] := d[[1]] != 0 && d == Reverse[d]; check[d_List] := Module[{num = FromDigits[d]}, If[isPal[IntegerDigits[num + Total[d]]], Print[num]; AppendTo[t, num];]]; t = {0}; Do[d = IntegerDigits[n]; dig = Join[d, Reverse[d]]; check[dig]; dig = Join[d, Reverse[Most[d]]]; check[dig], {n, 0, 9999999}]; Sort[t] (* _T. D. Noe_, Oct 02 2013 *)
%o A229622 (Python)
%o A229622 def ispal(n):
%o A229622   r = ''
%o A229622   for i in str(n):
%o A229622     r = i + r
%o A229622   return n == int(r)
%o A229622 def DS(n):
%o A229622   s = 0
%o A229622   for i in str(n):
%o A229622     s += int(i)
%o A229622   return s
%o A229622 {print(n,end=', ') for n in range(10**7) if ispal(n) and ispal(n+DS(n))}
%o A229622 # Simplified by _Derek Orr_, Apr 10 2015
%o A229622 # Fixed by _Robert C. Lyons_, Mar 16 2023
%Y A229622 Cf. A002113, A104459, A229545.
%K A229622 nonn,base
%O A229622 1,3
%A A229622 _Derek Orr_, Sep 26 2013
%E A229622 1099999999999901 from _T. D. Noe_, Oct 03 2013