This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A077402 #7 Jul 11 2015 00:42:06 %S A077402 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, %T A077402 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, %U A077402 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 %N 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. %C A077402 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. %H A077402 <a href="/index/Res#RAA">Index entries for sequences related to Reverse and Add!</a> %e A077402 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. %o A077402 (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; %Y A077402 Cf. A014190, A066450, A033665, A066057, A075685, A077404, A077405. %K A077402 base,sign %O A077402 0,6 %A A077402 _Klaus Brockhaus_, Nov 05 2002