%I #13 Jan 04 2013 15:54:36
%S 1,1,2,1,3,1,3,1,2,1,4,1,2,1,4,1,2,1,1,1,1,1,4,1,2,1,1,1,1,1,4,1,2,1,
%T 1,1,3,1,1,1,1,1,2,1,1,1,5,1,2,1,1,1,3,1,1,1,1,1,2,1,1,1,5,1,2,1,1,1,
%U 1,1,1,1,1,1,1,1,3,1,1,1,1,1,2,1,1,1,1,1,1,1,1,1,1,1,5,1,2,1,1,1,1,1,1,1,1,1,1,1,3,1,1,1,1,1,2,1
%N Number of bisections of the n-th binary palindrome bit pattern until the result is not palindromic
%C Let k=1, p(1)=A006995(n) and m(1)=number of bits in p(1); if p(k) is a binary palindrome > 1 then iterate k=k+1, m(k)=floor((m(k-1)+1)/2), p(k)=leftmost m(k) bits of p(k-1); else set a(n)=k endif.
%F Recursion: define f(x)=floor(A006995(x)/2^floor(floor(log_2(A006995(x))+1)/2)), for x=1,2,3,...
%F Case 1: a(n)=1+a(A206915(f(n))), if f(n) is a binary palindrome;
%F Case 2: a(n)=1, else.
%F Formally: a(n)=if (A178225(f(n))==1) then a(A206915(f(n)))+1 else 1.
%e a(1)=a(2)=1, since A006995(1)=0 and A006995(2)=1;
%e a(5)=3, since A006995(5)=7=111_2 and so the iteration is 11==>11==>1;
%e a(9)=2, since A006995(9)=21=10101_2 and so the iteration is 10101==>101;
%e a(13)=2, since A006995(13)=45=101101_2 and so the iteration is 101101==>101;
%e a(15)=4, since A006995(15)=63=111111_2 and so the iteration is 111111==>111==>11==>1;
%e a(37)=3, since A006995(37)=341=101010101_2 and so the iteration is 101010101==>10101==>101;
%o /* quasi-C program fragment, omitting formal details, n>1 */
%o p=n;
%o p1=n+1;
%o k=0;
%o While (A178225(p)==1) And (p != p1)
%o {
%o p1=p;
%o k++;
%o m=int(log(p)/log(2));
%o p=int(p/2^int((m+1)/2));
%o }
%o return k;
%Y A006995, A206915, A178225, A154809, A206924, A206925.
%K nonn,base
%O 1,3
%A _Hieronymus Fischer_, Mar 12 2012
|