cp's OEIS Frontend

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.

A075685 Reverse and Add! carried out in base 4; number of steps needed to reach a palindrome, or -1 if no palindrome is ever reached.

This page as a plain text file.
%I A075685 #7 Jul 11 2015 00:41:15
%S A075685 0,0,0,0,1,0,1,2,1,1,0,1,1,2,1,0,1,0,1,2,1,0,1,2,2,0,3,2,4,0,4,3,1,1,
%T A075685 0,1,1,1,0,4,2,3,0,2,3,4,0,4,1,2,1,0,1,2,4,0,3,2,2,0,4,3,4,0,1,0,1,2,
%U A075685 1,1,1,2,1,1,1,3,1,1,1,2,1,1,1,2,1,0,1,3,1,1,1,2,2,3,3,2,1,1,1,3,1,1,1,2,2
%N A075685 Reverse and Add! carried out in base 4; number of steps needed to reach a palindrome, or -1 if no palindrome is ever reached.
%C A075685 Base-4 analog of A033665 (base 10) and A066057 (base 2). For values of n such that presumably a(n) = -1 see A075420.
%H A075685 <a href="/index/Res#RAA">Index entries for sequences related to Reverse and Add!</a>
%e A075685 26 (decimal) = 122 -> 122 + 221 = 1003 -> 1003 + 3001 = 10010 -> 10010 + 01001 = 11011 (palindrome) = 325 (decimal) requires 3 steps, so a(26) = 3.
%o A075685 (ARIBAS) m := 105; stop := 1000; for n := 0 to m do c := 0; k := n; v := -1; while c < stop do a := k; rev := 0; while a > 0 do rev := 4*rev + (a mod 4); a := a div 4; end; if k = rev then v := c; c := stop; else inc(c); k := k + rev; end; end; write(v," "); end;.
%Y A075685 Cf. A014192, A033665, A066057, A075420.
%K A075685 base,nonn
%O A075685 0,8
%A A075685 _Klaus Brockhaus_, Sep 24 2002