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.

Showing 1-3 of 3 results.

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

Original entry on oeis.org

1, 2, 3, 4, 10, 100, 105, 181, 262, 267, 343, 348, 424, 429, 681, 762, 767, 843, 848, 924, 929, 1000, 10000, 100000, 1000000, 10000000, 63999991, 72999982, 81999973, 90999964, 100000000, 1000000000, 10000000000, 100000000000, 1000000000000, 10000000000000, 100000000000000, 1000000000000000, 10000000000000000
Offset: 1

Views

Author

Derek Orr, Jun 29 2014

Keywords

Comments

For k = 0, 1, 2, ..., 10^k is a member of this sequence, so A011557 is a subsequence.
Also, floor(a(n)/10) must be in A244573.
Intersection of A229545 and A229621. - Michel Marcus, Jun 30 2014
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
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
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

Examples

			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.
		

Crossrefs

Programs

  • PARI
    rev(n)={r="";for(i=1,#digits(n),r=concat(Str(digits(n)[i]),r));return(eval(r))}
    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,", ")))
    
  • Python
    def palgen(l,b=10): # generator of palindromes in base b of length <= 2*l
        if l > 0:
            yield 0
            for x in range(1,l+1):
                n = b**(x-1)
                n2 = n*b
                for y in range(n,n2):
                    k, m = y//b, 0
                    while k >= b:
                        k, r = divmod(k,b)
                        m = b*m + r
                    yield y*n + b*m + k
                for y in range(n,n2):
                    k, m = y, 0
                    while k >= b:
                        k, r = divmod(k,b)
                        m = b*m + r
                    yield y*n2 + b*m + k
    A244551_list = []
    for p in palgen(9):
        l = len(str(p))
        for i in range(1,l*9+1):
            n = p-i
            if n > 0:
                if sum((int(d) for d in str(n))) == i:
                    s = str(n-i)
                    if s == s[::-1]:
                        A244551_list.append(n) # Chai Wah Wu, Aug 24 2015

Extensions

a(27)-a(32) from Michel Marcus, Jun 30 2014
a(33)-a(39) from Chai Wah Wu, Aug 24 2015

A244573 Numbers n such that 10*n + d - digsum(10*n + d) is a palindrome for any d in {0,1,2,3,4,5,6,7,8,9}.

Original entry on oeis.org

1, 10, 18, 26, 34, 42, 68, 76, 84, 92, 100, 279, 368, 457, 546, 635, 724, 813, 902, 1000, 1071, 1152, 1233, 1314, 1486, 1567, 1648, 1729, 1981, 2051, 2132, 2213, 2385, 2466, 2547, 2628, 2709, 2880, 2961, 3031, 3112, 3284, 3365, 3446, 3527, 3608, 3699, 3860, 3941, 4011, 4183, 4264
Offset: 1

Views

Author

Derek Orr, Jun 30 2014

Keywords

Examples

			180 - (1+8+0) = 171, a palindrome. By adding {1,2,3,4,5,6,7,8,9} to 180 and subtracting that number's digsum, it will still be 171, a palindrome. Since 180 = 18*10, 18 is a member of this sequence.
		

Crossrefs

Programs

  • Mathematica
    palQ[n_]:=AnyTrue[Table[10n+d-Total[IntegerDigits[10n+d]],{d,0,9}],PalindromeQ]; Select[Range[4300],palQ] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Mar 13 2021 *)
  • PARI
    rev(n)={r="";for(i=1,#digits(n),r=concat(Str(digits(n)[i]),r));return(eval(r))}
    for(n=1,10^4,s=sum(i=1,#digits(10*n),digits(10*n)[i]);if(rev(10*n-s)==10*n-s,print1(n,", ")))

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

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 101, 181, 262, 343, 424, 686, 767, 848, 929, 1001, 10001, 100001, 1000001, 10000001, 100000001, 1000000001, 10000000001, 100000000001, 1000000000001
Offset: 1

Views

Author

Derek Orr, Sep 26 2013

Keywords

Comments

It is conjectured that a(n) = 10^(n-18) + 1 for all n > 20. - Derek Orr, Apr 05 2015
Palindromes in the sequence A229621.

Examples

			767 - (7+6+7) = 747 (another palindrome). So, 767 is in this sequence.
		

Crossrefs

Programs

  • Mathematica
    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 *)
  • 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
    pal(n)=my(d=digits(n));Vecrev(d)==d
    for(n=1,10^7,my(m=b(n), s=sumdigits(m));if(pal(m-s),print1(m,", "))) \\ Derek Orr, Apr 05 2015
  • Python
    def pal(n):
      r = ''
      for i in str(n):
        r = i + r
      return r == str(n)
    def DS(n):
      s = 0
      for i in str(n):
        s += int(i)
      return s
    {print(n, end=', ') for n in range(10**6) if pal(n) and pal(n-DS(n))}
    ## Simplified by Derek Orr, Apr 05 2015
    
Showing 1-3 of 3 results.