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.

A229623 Palindromes m such that m - sum_of_digits(m) is also a palindrome.

This page as a plain text file.
%I A229623 #15 Jan 27 2025 21:11:41
%S A229623 0,1,2,3,4,5,6,7,8,9,11,101,181,262,343,424,686,767,848,929,1001,
%T A229623 10001,100001,1000001,10000001,100000001,1000000001,10000000001,
%U A229623 100000000001,1000000000001
%N A229623 Palindromes m such that m - sum_of_digits(m) is also a palindrome.
%C A229623 It is conjectured that a(n) = 10^(n-18) + 1 for all n > 20. - _Derek Orr_, Apr 05 2015
%C A229623 Palindromes in the sequence A229621.
%e A229623 767 - (7+6+7) = 747 (another palindrome). So, 767 is in this sequence.
%t A229623 palQ[n_]:=Module[{idn=IntegerDigits[n], idn2}, idn2=IntegerDigits[n - Total[idn]]; idn==Reverse[idn]&&idn2==Reverse[idn2]]; Select[Range[0, 2 10^6], palQ] (* _Vincenzo Librandi_, Apr 06 2015 *)
%o A229623 (Python)
%o A229623 def pal(n):
%o A229623   r = ''
%o A229623   for i in str(n):
%o A229623     r = i + r
%o A229623   return r == str(n)
%o A229623 def DS(n):
%o A229623   s = 0
%o A229623   for i in str(n):
%o A229623     s += int(i)
%o A229623   return s
%o A229623 {print(n, end=', ') for n in range(10**6) if pal(n) and pal(n-DS(n))}
%o A229623 ## Simplified by _Derek Orr_, Apr 05 2015
%o A229623 (PARI) b(n)={my(d, i, r); r=vector(#digits(n-10^(#digits(n\11)))+#digits(n\11)); n=n-10^(#digits(n\11)); d=digits(n); for(i=1, #d, r[i]=d[i]; r[#r+1-i]=d[i]); sum(i=1, #r, 10^(#r-i)*r[i])} \\ Code from _David A. Corneth_ in A002113, Jun 06 2014
%o A229623 pal(n)=my(d=digits(n));Vecrev(d)==d
%o A229623 for(n=1,10^7,my(m=b(n), s=sumdigits(m));if(pal(m-s),print1(m,", "))) \\ _Derek Orr_, Apr 05 2015
%Y A229623 Cf. A229621, A002113.
%K A229623 nonn,base
%O A229623 1,3
%A A229623 _Derek Orr_, Sep 26 2013