login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A322823
a(n) = 0 if n is 1 or a Fermi-Dirac prime (A050376), otherwise a(n) = 1 + a(A300840(n)).
3
0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 2, 0, 1, 2, 0, 0, 1, 0, 3, 2, 1, 0, 2, 0, 1, 2, 3, 0, 2, 0, 1, 2, 1, 4, 3, 0, 1, 2, 3, 0, 2, 0, 3, 4, 1, 0, 2, 0, 1, 2, 3, 0, 2, 4, 3, 2, 1, 0, 3, 0, 1, 5, 3, 4, 2, 0, 3, 2, 4, 0, 3, 0, 1, 2, 3, 5, 2, 0, 4, 0, 1, 0, 3, 4, 1, 2, 3, 0, 4, 5, 3, 2, 1, 4, 2, 0, 1, 6, 3, 0, 2, 0, 3, 4
OFFSET
1,12
COMMENTS
For n > 1, a(n) gives the number of edges needed to traverse from n to reach the leftmost branch (where the terms of A050376 are located) in the binary tree illustrated in A052330.
LINKS
FORMULA
a(1) = 0; for n > 1, if A302777(n) == 1, a(n) = 0, otherwise a(n) = 1 + a(A300840(n)).
PROG
(PARI)
up_to = 10000;
ispow2(n) = (n && !bitand(n, n-1));
A302777(n) = ispow2(isprimepower(n));
A050376list(up_to) = { my(v=vector(up_to), i=0); for(n=1, oo, if(A302777(n), i++; v[i] = n); if(i == up_to, return(v))); };
v050376 = A050376list(up_to);
A050376(n) = v050376[n];
A052330(n) = { my(p=1, i=1); while(n>0, if(n%2, p *= A050376(i)); i++; n >>= 1); (p); };
A052331(n) = { my(s=0, e); while(n > 1, fordiv(n, d, if(((n/d)>1)&&ispow2(isprimepower(n/d)), e = vecsearch(v050376, n/d); if(!e, print("v050376 too short!"); return(1/0)); s += 2^(e-1); n = d; break))); (s); };
A300840(n) = A052330(A052331(n)>>1);
A322823(n) = if((1==n)||(1==A302777(n)), 0, 1+A322823(A300840(n)));
CROSSREFS
KEYWORD
nonn
AUTHOR
Antti Karttunen, Dec 29 2018
STATUS
approved