Logo

Greetings from The On-Line Encyclopedia of Integer Sequences!

Hints

Search: id:A065206
Displaying 1-1 of 1 results found. page 1
     Format: long | short | internal | text      Sort: relevance | references | number      Highlight: on | off
A065206 One 'Reverse and Add' step is needed to reach a palindrome. +0
14
10, 12, 13, 14, 15, 16, 17, 18, 20, 21, 23, 24, 25, 26, 27, 29, 30, 31, 32, 34, 35, 36, 38, 40, 41, 42, 43, 45, 47, 50, 51, 52, 53, 54, 56, 60, 61, 62, 63, 65, 70, 71, 72, 74, 80, 81, 83, 90, 92, 100, 102, 103, 104, 105, 106, 107, 108, 110, 112, 113, 114, 115, 116, 117 (list; graph; listen)
OFFSET

1,1

COMMENT

The number of steps starts at 0, so palindromes (cf. A002113) are excluded.

LINKS

Harry J. Smith, Table of n, a(n) for n=1,...,1000

Index entries for sequences related to Reverse and Add!

PROGRAM

(ARIBAS): function revadd_steps(k, stop: integer); var c, n, m, steps, rev: integer; begin n := 0; c := 0; while c < stop do m := n; rev := int_reverse(m); steps := 0; while steps < k and m <> rev do m := m + rev; rev := int_reverse(m); inc(steps); end; if steps = k and m = rev then write(n, " "); inc(c); end; inc(n); end; end; revadd_steps(1, 66).

(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]

CROSSREFS

A002113, A015976.

Sequence in context: A105959 A059504 A083310 this_sequence A083476 A124404 A031288

Adjacent sequences: A065203 A065204 A065205 this_sequence A065207 A065208 A065209

KEYWORD

nonn,base

AUTHOR

Klaus Brockhaus (klaus-brockhaus(AT)t-online.de), Oct 21 2001

EXTENSIONS

OFFSET changed from 0,1 to 1,1 by Harry J. Smith (hjsmithh(AT)sbcglobal.net), Oct 13 2009

page 1

Search completed in 0.002 seconds

Lookup | Welcome | Find friends | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Transforms | Puzzles | Hot | Classics
More pages | Superseeker | Maintained by N. J. A. Sloane (njas@research.att.com)

Last modified November 25 20:09 EST 2009. Contains 167514 sequences.


AT&T Labs Research