login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A229545 Numbers n such that n + (sum of digits of n) is a palindrome. 5

%I

%S 0,1,2,3,4,10,20,30,40,50,60,70,80,90,91,96,100,105,124,129,143,148,

%T 162,167,181,191,196,200,205,224,229,243,248,262,267,281,291,296,300,

%U 305,324,329,343,348,362,367,381,391,396,400,405,424,429,443,448,462

%N Numbers n such that n + (sum of digits of n) is a palindrome.

%C It appears the ones and tens digits in the 3-digit numbers have a pattern to them (00-->05-->24-->29-->43-->48-->62-->67-->81-->91-->96-->00).

%C Analyzing a(n) mod 10^e, n<100000, for e=2: starting at n=15 there are 9 cycles of length 11 [91,96,0,5,24,29,43,48,62,67,81], followed by 9 cycles of length 10 [82,0,9,18,27,36,45,54,63,72], then 9 of length 101, 9 of 102, 9 of 1011, 9 of 1012, and at least 7 of length 10103. For e=1 the cycles have the same position and length, for e>2 the shorter cycles successively disappear. [_Lars Blomberg_, Jan 05 2013]

%H Lars Blomberg, <a href="/A229545/b229545.txt">Table of n, a(n) for n = 1..10000</a>

%e 196 + (1+9+6) = 212 (a palindrome). So, 196 is in this sequence.

%t palQ[n_] := Block[{d = IntegerDigits@ n}, d == Reverse@ d]; Select[Range[0, 462], palQ[# + Plus @@ IntegerDigits@ #] &] (* _Michael De Vlieger_, Apr 12 2015 *)

%o (Python)

%o def ispal(n):

%o ..r = ''

%o ..for i in str(n):

%o ....r = i + r

%o ..return n == int(r)

%o def DS(n):

%o ..s = 0

%o ..for i in str(n):

%o ....s += int(i)

%o ..return s

%o {print(n,end=', ') for n in range(10**3) if ispal(n+DS(n))}

%o # Simplified by _Derek Orr_, Mar 22 2015

%o (PARI) for(n=0,10^3,D=digits(n+sumdigits(n));if(Vecrev(D)==D,print1(n,", "))) \\ _Derek Orr_, Mar 22 2015

%Y Cf. A062028.

%K nonn,base,easy

%O 1,3

%A _Derek Orr_, Sep 25 2013

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified October 25 17:22 EDT 2021. Contains 348255 sequences. (Running on oeis4.)