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”).

A322989
If n is a power of a prime, then a(n) = 0, otherwise a(n) = 1 + a(A322990(n)).
3
0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 2, 0, 1, 2, 0, 0, 1, 0, 3, 2, 1, 0, 2, 0, 1, 0, 3, 0, 2, 0, 0, 2, 1, 4, 3, 0, 1, 2, 4, 0, 2, 0, 3, 4, 1, 0, 2, 0, 1, 2, 3, 0, 1, 4, 5, 2, 1, 0, 3, 0, 1, 5, 0, 4, 2, 0, 3, 2, 3, 0, 6, 0, 1, 2, 3, 5, 2, 0, 4, 0, 1, 0, 3, 4, 1, 2, 6, 0, 3, 5, 3, 2, 1, 4, 2, 0, 1, 7, 3, 0, 2, 0, 6, 4
OFFSET
1,12
COMMENTS
For n > 1, a(n) gives the number of edges needed from n to the leftmost branch (where the terms of A000961 are located) in the binary tree illustrated in A289272.
FORMULA
If A001221(n) <= 1 [when n is in A000961], then a(n) = 0, otherwise a(n) = 1 + a(A322990(n)).
PROG
(PARI)
A289271(n) = { my(v=0, i=0, x=1); for(d=2, oo, if(n==1, return(v)); if(1==gcd(x, d)&&1==omega(d), if(!(n%d)&&1==gcd(d, n/d), v += 2^i; n /= d; x *= d); i++)); }; \\ After Rémy Sigrist's program for A289271.
A289272(n) = { my(m=1, pp=1); while(n>0, pp++; while(!isprimepower(pp)||(gcd(pp, m)>1), pp++); if(n%2, m *= pp); n >>=1); (m); };
A322989(n) = if((1==n)||isprimepower(n), 0, 1+A322989(A322990(n)));
A322990(n) = A289272(A289271(n)>>1);
CROSSREFS
KEYWORD
nonn
AUTHOR
Antti Karttunen, Jan 01 2019
STATUS
approved