OFFSET
1,3
LINKS
Michael De Vlieger, Table of n, a(n) for n = 1..10000
EXAMPLE
143 - (1*4*3) = 131 (a palindrome). So, 143 is a member of the sequence.
MATHEMATICA
f[n_] := Block[{d = n - Times @@ IntegerDigits@ n}, d == FromDigits@ Reverse[IntegerDigits@ d]]; Select[Range[0, 1000], f] (* Michael De Vlieger, Mar 12 2015 *)
PROG
(Python)
def rev(n):
return int(''.join(reversed(str(n))))
def DP(n):
p = 1
for i in str(n):
p *= int(i)
return p
{print(n, end=', ') for n in range(10**3) if n-DP(n)==rev(n-DP(n))}
# Simplified by Derek Orr, Mar 12 2015
(PARI) for(n=0, 10^3, d=digits(n); p=prod(i=1, #d, d[i]); if(Vecrev(digits(n-p))==digits(n-p), print1(n, ", "))) \\ Derek Orr, Mar 12 2015
CROSSREFS
KEYWORD
nonn,base,easy
AUTHOR
Derek Orr, Sep 26 2013
EXTENSIONS
More terms from Derek Orr, Mar 12 2015
STATUS
approved