[go: up one dir, main page]

login
A206921
Rank of the n-th binary palindrome. The minimal number of iterations A206915(A206915(...A206915(A006995(n))...) such that the result is not a binary palindrome, a(3)=1.
2
2, 1, 1, 1, 2, 1, 3, 1, 2, 1, 1, 1, 1, 1, 4, 1, 2, 1, 1, 1, 3, 1, 1, 1, 1, 1, 2, 1, 1, 1, 2, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 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, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1
OFFSET
1,1
COMMENTS
The number of iterations such that A006995(n)=A006995(A006995(A006995(…(A206922(n)…) [For n<>3] .
LINKS
FORMULA
a(n)=k, where k can be determined by the following iteration: set k=0, p(0)=A006995(n). Repeat while A178225(p(k))==1, set k=k+1, p(k)=A206915(p(k-1)) end repeat [for n<>3].
Recursion for n<>3:
Case 1: a(n)=1, if n is not a binary palindrome;
Case 2: a(n)=a(A206915(n))+1, else.
Formally: a(n)=if (A178225(n)==0) then 1 else a(A206915(n))+1
EXAMPLE
a(1)=2, since A006995(1)=0=A006995(A006995(2)) [==> 2 iterations; 2 is not a binary palindrome];
a(3)=1 by definition;
a(4)=1, since A006995(4)=5=A006995(4) [==> 1 iteration; 4 is not a binary palindrome];
a(7)=3, since A006995(7)=15=A006995(A006995(A006995(4))) [==> 3 iterations; 4 is not a binary palindrome];
PROG
/* C program fragment, omitting formal details, n!=3 */
k=0;
p=A006995(n);
while A178225(p)==1
{
k++;
p=A206915(p);
}
return k;
(PARI)
up_to = 65537;
A178225(n) = (Vecrev(n=binary(n))==n);
A206915list(up_to) = { my(v=vector(up_to+1), s=0); for(n=1, up_to+1, s += A178225(n-1); v[n] = s); (v); };
v206915 = A206915list(up_to);
A206915(n) = v206915[1+n];
A206921(n) = if((3==n)||!A178225(n), 1, 1+A206921(A206915(n))); \\ Antti Karttunen, Nov 14 2018
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Hieronymus Fischer, Mar 12 2012
STATUS
approved