OFFSET
1,3
COMMENTS
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.
FORMULA
EXAMPLE
a(5)=3, since A006995(5)=7=111_2 and so the iteration is 11==>11==>1;
a(9)=2, since A006995(9)=21=10101_2 and so the iteration is 10101==>101;
a(13)=2, since A006995(13)=45=101101_2 and so the iteration is 101101==>101;
a(15)=4, since A006995(15)=63=111111_2 and so the iteration is 111111==>111==>11==>1;
a(37)=3, since A006995(37)=341=101010101_2 and so the iteration is 101010101==>10101==>101;
PROG
/* quasi-C program fragment, omitting formal details, n>1 */
p=n;
p1=n+1;
k=0;
While (A178225(p)==1) And (p != p1)
{
p1=p;
k++;
m=int(log(p)/log(2));
p=int(p/2^int((m+1)/2));
}
return k;
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Hieronymus Fischer, Mar 12 2012
STATUS
approved