login
This site is supported by donations to The OEIS Foundation.

 

Logo

The OEIS is looking to hire part-time people to help edit core sequences, upload scanned documents, process citations, fix broken links, etc. - Neil Sloane, njasloane@gmail.com

Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A033665 Number of 'Reverse and Add' steps needed to reach a palindrome starting at n, or -1 if n never reaches a palindrome. 17
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 0, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 0, 1, 1, 1, 2, 1, 2, 1, 1, 1, 1, 0, 1, 2, 1, 2, 2, 1, 1, 1, 1, 1, 0, 1, 2, 2, 3, 1, 1, 1, 1, 2, 1, 0, 2, 3, 4, 1, 1, 1, 2, 1, 2, 2, 0, 4, 6, 1, 1, 2, 1, 2, 2, 3, 4, 0, 24, 1, 2, 1, 2, 2, 3, 4, 6, 24, 0, 1, 0, 1, 1 (list; graph; refs; listen; history; text; internal format)
OFFSET

0,20

COMMENTS

Palindromes themselves are not 'Reverse and Add!'ed, so they yield a zero!

REFERENCES

D. Wells, The Penguin Dictionary of Curious and Interesting Numbers, pp. 142-3 Penguin Books 1987.

LINKS

Kerry Mitchell, Table of n, a(n) for n = 0..195

P. De Geest, Some thematic websources

Jason Doucette, World Records

S. K. Eddins, The Palindromic Order Of A Number

Kerry Mitchell, Table of n, a(n) for n = 0..10000 (The -1 entries are only conjectural)

Kerry Mitchell, Table of n, a(n) for n = 0..100000 (The -1 entries are only conjectural)

I. Peter, More trajectories

T. Trotter, Jr., Palindrome Power

Index entries for sequences related to Reverse and Add!

EXAMPLE

19 -> 19+91 = 110 -> 110+011 = 121 = palindrome, took 2 steps, so a(19)=2.

MATHEMATICA

rev[n_]:=FromDigits[Reverse[IntegerDigits[n]]]; radd[n_]:=n+rev[n];

pal[n_]:=If[n==rev[n], True, False];

raddN[n_]:=Length[NestWhileList[radd[#]&, n, pal[#]==False&]]-1;

raddN/@Range[0, 195] (* Ivan N. Ianakiev, Aug 31 2015 *)

PROG

(PARI)

rev(n)={d=digits(n); p=""; for(i=1, #d, p=concat(Str(d[i]), p)); return(eval(p))}

a(n)=if(n==rev(n), return(0)); for(k=1, 10^3, i=n+rev(n); if(rev(i)==i, return(k)); n=i)

n=0; while(n<100, print1(a(n), ", "); n++) \\ Derek Orr, Jul 28 2014

CROSSREFS

Cf. A023108, A023109, A006960, A016016, A063048.

Equals A030547(n) - 1.

Sequence in context: A236747 A194285 A135341 * A104234 A037870 A250205

Adjacent sequences:  A033662 A033663 A033664 * A033666 A033667 A033668

KEYWORD

nonn,base,easy

AUTHOR

N. J. A. Sloane

EXTENSIONS

More terms from Patrick De Geest, Jun 15 1998

I truncated the b-file at n=195, since the value of a(196) is not presently known (cf. A006960). The old b-files are now a-files. - N. J. A. Sloane, May 09 2015

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent | More pages
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy .

Last modified May 25 15:52 EDT 2017. Contains 287039 sequences.