OFFSET
1,3
EXAMPLE
185 - (1+8+5) = 171 (a palindrome). Thus, 185 is a member of this sequence.
PROG
(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, Apr 10 2015
(PARI) ispal(d) = Vecrev(d) == d;
isok(n) = ispal(digits(n-sumdigits(n))); \\ Michel Marcus, Apr 11 2015
CROSSREFS
KEYWORD
nonn,base,easy
AUTHOR
Derek Orr, Sep 26 2013
EXTENSIONS
More terms from Derek Orr, Apr 10 2015
STATUS
approved