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-4 of 4 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

A332240 Palindromes that are the sum of a number and the sum of its digits.

Original entry on oeis.org

0, 2, 4, 6, 8, 11, 22, 33, 44, 55, 66, 77, 88, 99, 101, 111, 131, 141, 151, 161, 171, 181, 191, 202, 212, 232, 242, 252, 262, 272, 282, 292, 303, 313, 333, 343, 353, 363, 373, 383, 393, 404, 414, 434, 444, 454, 464, 474, 484, 494, 505, 515, 535, 545, 555, 565, 575
Offset: 1

Views

Author

Eric Fox, Feb 07 2020

Keywords

Examples

			196 + 1 + 9 + 6 = 212, so 212 is in this sequence.
		

Crossrefs

Intersection of A002113 and A176995.

Programs

  • Magma
    pal:=func; [k:k in [0..600]| pal(k) and exists(m){s:s in [0..k]| s+&+Intseq(s) eq k}]; // Marius A. Burtea, Feb 08 2020
  • Mathematica
    palQ[n_] := Block[{d = IntegerDigits[n]}, Reverse[d] == d]; Select[ Union[(# + Plus @@ IntegerDigits@#) & /@ Range[0, 600]], # <= 600 && palQ[#] &] (* Giovanni Resta, Feb 07 2020 *)

Formula

a(n) in { A062028(A229545(i)) : i >= 1 }. - Amiram Eldar, Feb 12 2020

Extensions

More terms from Giovanni Resta, Feb 07 2020

A334661 Numbers k such that k*sod(k) and k+sod(k) are both palindromes, where sod(k) denotes the sum of digits of k (A007953).

Original entry on oeis.org

0, 1, 2, 3, 124, 829, 186373637, 186454637, 187272737, 195454547, 23212121199, 23302120299, 1230303030288, 1312121212098, 1320303030198, 1321121211198, 1321203021198, 1321211121198, 1330121210298, 1330203020298, 1330211120298, 1330301030298, 2130303030279
Offset: 1

Views

Author

Giovanni Resta, May 07 2020

Keywords

Comments

For the first 2729 terms, most of them have digit sum 33. The only terms a(n) for n <= 2729 for which the digit sum is not 33 are for n = 1,...,10, 716, 2194, 2195. - Chai Wah Wu, May 15 2020

Examples

			The sum of digits of 829 is 19 and 829*19 = 15751 and 829+19 = 848 are palindromes, so 829 is a term.
		

Crossrefs

Intersection of A229549 and A229545.

Programs

  • Mathematica
    Select[Range[0, 999], (s = Plus @@ IntegerDigits[#]; PalindromeQ[# s] && PalindromeQ[# + s]) &]
  • PARI
    ispal(n) = my(d=digits(n)); d == Vecrev(d);
    isok(m) = my(s=sumdigits(m)); ispal(m*s) && ispal(m+s); \\ Michel Marcus, May 08 2020

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

Original entry on oeis.org

0, 1, 2, 3, 4, 181, 191, 262, 343, 424, 505, 696, 767, 848, 929, 28999999999982, 37999999999973, 46999999999964, 55999999999955, 64999999999946, 73999999999937, 82999999999928, 91999999999919, 1099999999999901
Offset: 1

Views

Author

Derek Orr, Sep 26 2013

Keywords

Comments

Palindromes in A229545.
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

Examples

			262 + (2+6+2) = 272 (another palindrome). So 262 is in this sequence.
		

Crossrefs

Programs

  • Mathematica
    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 *)
  • 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**7) if ispal(n) and ispal(n+DS(n))}
    # Simplified by Derek Orr, Apr 10 2015
    # Fixed by Robert C. Lyons, Mar 16 2023

Extensions

1099999999999901 from T. D. Noe, Oct 03 2013
Showing 1-4 of 4 results.