login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A077402 Reverse and Add! carried out in base 3; number of steps needed to reach a palindrome, or -1 if no palindrome is ever reached. 2
0, 0, 0, 1, 0, 2, 1, 2, 0, 1, 0, 2, 1, 0, 2, 3, 0, 4, 1, 2, 0, 1, 2, 0, 3, 4, 0, 1, 0, 2, 1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 0, 2, 3, 3, 2, 1, 1, 2, 3, 3, 2, 3, 0, 18, 1, 2, 0, 1, 2, 4, 1, 2, 2, 1, 2, 4, 1, 2, 0, 3, 2, 4, 1, 2, 2, 3, 2, 4, 17, 18, 0, 1, 0, 2, 1, 1, 2, 1, 1, 3, 1, 0, 2, 1, 1, 16, 1, 1, 2, 2, 0, 2, 4, -1, 16, 3, 15, 2, 1, 1, 2, 1, 0, 3, 3, 3, 2, 1, 1, 16, 1 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,6
COMMENTS
Base-3 analog of A066057 (base 2), A075685 (base 4) and A033665 (base 10). a(103) = -1 is a conjecture (cf. A066450, A077408). For values of n such that presumably a(n) = -1 see A077404.
LINKS
EXAMPLE
17 (decimal) = 122 -> 122 + 221 = 1120 -> 1120 + 211 = 2101 -> 2101 + 1012 = 10120 -> 10120 + 2101 = 12221 (palindrome) = 160 (decimal) requires 4 steps, so a(17) = 4.
PROG
(ARIBAS) m := 120; stop := 1000; for n := 0 to m do v := -1; c := 0; k := n; while c < stop do d := k; rev := 0; while d > 0 do rev := 3*rev + (d mod 3); d := d div 3; end; if k = rev then v := c; c := stop; else inc(c); k := k + rev; end; end; write(v, ", "); end;
CROSSREFS
Sequence in context: A285677 A036578 A229764 * A287418 A125925 A340795
KEYWORD
base,sign
AUTHOR
Klaus Brockhaus, Nov 05 2002
STATUS
approved

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

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 16 11:08 EDT 2024. Contains 371711 sequences. (Running on oeis4.)