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.

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

Original entry on oeis.org

0, 1, 2, 3, 4, 10, 20, 30, 40, 50, 60, 70, 80, 90, 91, 96, 100, 105, 124, 129, 143, 148, 162, 167, 181, 191, 196, 200, 205, 224, 229, 243, 248, 262, 267, 281, 291, 296, 300, 305, 324, 329, 343, 348, 362, 367, 381, 391, 396, 400, 405, 424, 429, 443, 448, 462
Offset: 1

Views

Author

Derek Orr, Sep 25 2013

Keywords

Comments

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).
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]

Examples

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

Crossrefs

Cf. A062028.

Programs

  • Mathematica
    palQ[n_] := Block[{d = IntegerDigits@ n}, d == Reverse@ d]; Select[Range[0, 462], palQ[# + Plus @@ IntegerDigits@ #] &] (* Michael De Vlieger, Apr 12 2015 *)
  • PARI
    for(n=0,10^3,D=digits(n+sumdigits(n));if(Vecrev(D)==D,print1(n,", "))) \\ Derek Orr, Mar 22 2015
  • Python
    def ispal(n):
      r = ''
      for i in str(n):
        r = i + r
      return n == int(r)
    def DS(n):
      s = 0
      for i in str(n):
        s += int(i)
      return s
    {print(n,end=', ') for n in range(10**3) if ispal(n+DS(n))}
    # Simplified by Derek Orr, Mar 22 2015