cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A322989 If n is a power of a prime, then a(n) = 0, otherwise a(n) = 1 + a(A322990(n)).

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Jan 01 2019

Keywords

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.

Crossrefs

Programs

  • 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);

Formula

If A001221(n) <= 1 [when n is in A000961], then a(n) = 0, otherwise a(n) = 1 + a(A322990(n)).