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

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A023109 Smallest number that requires exactly n iterations of Reverse and Add to reach a palindrome. 33
0, 10, 19, 59, 69, 166, 79, 188, 193, 1397, 829, 167, 2069, 1797, 849, 177, 1496, 739, 1798, 10777, 6999, 1297, 869, 187, 89, 10797, 10853, 10921, 10971, 13297, 10548, 13293, 17793, 20889, 700269, 106977, 108933, 80359, 13697, 10794, 15891, 1009227, 1007619, 1009246, 1008628, 600259, 131996, 70759, 1007377, 1001699, 600279, 141996, 70269, 10677, 10833, 10911 (list; graph; refs; listen; history; text; internal format)
OFFSET

0,2

LINKS

Chai Wah Wu, Table of n, a(n) for n = 0..100

Jason Doucette, World Records

Eric Weisstein's World of Mathematics, 196-Algorithm.

Index entries for sequences related to Reverse and Add!

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)

b(n)=for(k=1, 10^8, if(a(k)==n, return(k)))

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

(Python)

def A023109(n):

....if n > 0:

........k = 0

........while True:

............m = k

............for i in range(n):

................if str(m) == str(m)[::-1]:

....................break

................m += int(str(m)[::-1])

............else:

................if str(m) == str(m)[::-1]:

....................return k

............k += 1

....else:

........return 0

# Chai Wah Wu, Feb 08 2015

CROSSREFS

Cf. A033665, A006960.

Sequence in context: A307344 A065198 A033866 * A255530 A146091 A007811

Adjacent sequences:  A023106 A023107 A023108 * A023110 A023111 A023112

KEYWORD

nonn,base,nice

AUTHOR

David W. Wilson

EXTENSIONS

Verified and added terms a(41)-a(55) by Aldo González Lorenzo, May 15 2011

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
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified October 16 11:51 EDT 2019. Contains 328056 sequences. (Running on oeis4.)