A206923 Number of bisections of the n-th binary palindrome bit pattern until the result is not palindromic.
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, 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, 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
Offset: 1
Examples
a(1)=a(2)=1, since A006995(1)=0 and A006995(2)=1; 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;
Programs
-
C
/* quasi-C program fragment, omitting formal details, n>1 */ p=n; p1=n+1; k=0; while (A178225(p)==1) && (p != p1) { p1=p; k++; m=int(log(p)/log(2)); p=int(p/2^int((m+1)/2)); } return k;
Comments