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.

A259656 Let f(x) be the absolute value of the difference between x and its base-2 reversal. a(n) is the number of times f(x) must be applied starting with n for the result to be 0.

This page as a plain text file.
%I A259656 #23 Nov 05 2015 12:22:13
%S A259656 1,2,1,2,1,2,1,2,1,2,3,2,3,2,1,2,1,2,3,2,1,2,3,2,3,2,1,2,3,2,1,2,1,2,
%T A259656 3,2,3,4,3,4,3,2,3,2,1,2,3,2,3,2,1,4,3,2,3,4,3,4,3,2,3,2,1,2,1,2,3,2,
%U A259656 3,2,3,2,1,2,3,2,3,2,3,4,3,2,3
%N A259656 Let f(x) be the absolute value of the difference between x and its base-2 reversal. a(n) is the number of times f(x) must be applied starting with n for the result to be 0.
%C A259656 First differences appear to always be odd.
%C A259656 More precisely, a(n) is even if n is even and a(n) is odd when n is odd. This is an immediate consequence of the parities in A055945 (which represents f apart from the sign) and the fact that we count iterations of f until the result is even. - _Jörgen Backelin_, Nov 04 2015
%p A259656 A259656 := proc(n)
%p A259656     local f,a ;
%p A259656     f := n ;
%p A259656     a := 0 ;
%p A259656     while f <> 0 do
%p A259656         f := abs(A055945(f)) ;
%p A259656         a := a+1 ;
%p A259656     end do:
%p A259656     a;
%p A259656 end proc: # _R. J. Mathar_, Nov 04 2015
%Y A259656 Cf. A055945.
%K A259656 nonn,base
%O A259656 1,2
%A A259656 _Dylan Hamilton_, Jul 02 2015