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.

A229761 Zeroless numbers n such that n and n - (product of digits of n) are both palindromes.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 252, 676, 777, 838, 868, 919, 929, 939, 15451, 15851, 25152, 25252, 25352, 25452, 25552, 25652, 25752, 25852, 25952, 29592, 36563, 51415, 51815, 52125, 52225, 52325, 52425, 52525, 52625, 52725, 52825, 52925, 63536, 92529, 93939, 97779, 1455541, 1545451, 1558551, 1594951
Offset: 1

Views

Author

Derek Orr, Sep 30 2013

Keywords

Comments

Palindromes with nonzero digits in the sequence A229547.
Palindromes with an even number of digits do not appear to be in this sequence. - Derek Orr, Apr 05 2015

Examples

			929 - (9*2*9) = 767 (another palindrome). So, 929 is a member of this sequence.
		

Crossrefs

Programs

  • Mathematica
    bpQ[n_]:=DigitCount[n,10,0]==0&&AllTrue[{n,n-Times@@IntegerDigits[n]},PalindromeQ]; Select[Range[16*10^5],bpQ] (* Harvey P. Dale, Nov 11 2024 *)
  • PARI
    pal(n)=d=digits(n);Vecrev(d)==d
    for(n=1,10^7,d=digits(n);p=prod(i=1,#d,d[i]);if(p&&pal(n)&&pal(n-p),print1(n,", "))) \\ Derek Orr, Apr 05 2015
  • Python
    def DP(n):
      p = 1
      for i in str(n):
        p *= int(i)
      return p
    def pal(n):
      r = ''
      for i in str(n):
        r = i + r
      return r == str(n)
    {print(n, end=', ') for n in range(1, 10**6) if DP(n) and pal(n) and pal(n-DP(n))}
    ## Simplified by Derek Orr, Apr 05 2015
    

Extensions

More terms from Derek Orr, Apr 05 2015