editing
approved
editing
approved
OFFSET changed from 0,1 to 1,1 Offset corrected by Harry J. Smith, Oct 13 2009
approved
editing
editing
approved
Select[Range[10, 120], !PalindromeQ[#]&&PalindromeQ[#+IntegerReverse[#]]&] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Jun 14 2017 *)
approved
editing
editing
approved
The number of steps starts at 0, so palindromes (cf. A002113) are excluded.
Harry J. Smith, <a href="/A065206/b065206.txt">Table of n, a(n) for n = 1,...,1000</a>
(PARI) Rev(x)= { local(d, r=0); while (x>0, d=x-10*(x\10); x\=10; r=r*10 + d); return(r) } digitsIn(x)= { local(d); if (x==0, return(1)); d=1 + log(x)\log(10); if (10^d == x, d++, if (10^(d-1) > x, d--)); return(d) } Palin(x)= { local(d, e, f, i, t, y); if (x==0, return(1)); y=x; d=digitsIn(x); t=10^(d - 1); for (i=1, d\2, f=y-10*(y\10); y\=10; e=x\t; x-=t*e; t/=10; if (e!=f, return(0)) ); return(1) } { n=0; for (m = 0, 10^9, if (!Palin(m) && Palin(Rev(m) + m), write("b065206.txt", n++, " ", m); if (n==1000, return)) ) } [From _\\ _Harry J. Smith_, Oct 13 2009]
approved
editing
-- _Reinhard Zumkeller, _, Oct 14 2011
_Klaus Brockhaus (klaus-brockhaus(AT)t-online.de), _, Oct 21 2001
(PARI) Rev(x)= { local(d, r=0); while (x>0, d=x-10*(x\10); x\=10; r=r*10 + d); return(r) } digitsIn(x)= { local(d); if (x==0, return(1)); d=1 + log(x)\log(10); if (10^d == x, d++, if (10^(d-1) > x, d--)); return(d) } Palin(x)= { local(d, e, f, i, t, y); if (x==0, return(1)); y=x; d=digitsIn(x); t=10^(d - 1); for (i=1, d\2, f=y-10*(y\10); y\=10; e=x\t; x-=t*e; t/=10; if (e!=f, return(0)) ); return(1) } { n=0; for (m = 0, 10^9, if (!Palin(m) && Palin(Rev(m) + m), write("b065206.txt", n++, " ", m); if (n==1000, return)) ) } [From _Harry J. Smith (hjsmithh(AT)sbcglobal.net), _, Oct 13 2009]
OFFSET changed from 0,1 to 1,1 by _Harry J. Smith (hjsmithh(AT)sbcglobal.net), _, Oct 13 2009
proposed
approved