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

This page as a plain text file.
%I A322989 #13 Jan 02 2019 11:54:57
%S A322989 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,
%T A322989 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,
%U A322989 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
%N A322989 If n is a power of a prime, then a(n) = 0, otherwise a(n) = 1 + a(A322990(n)).
%C A322989 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.
%H A322989 Antti Karttunen, <a href="/A322989/b322989.txt">Table of n, a(n) for n = 1..20000</a>
%H A322989 Antti Karttunen, <a href="/A322989/a322989.txt">Data supplement: n, a(n) computed for n = 1..65537</a>
%F A322989 If A001221(n) <= 1 [when n is in A000961], then a(n) = 0, otherwise a(n) = 1 + a(A322990(n)).
%o A322989 (PARI)
%o A322989 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.
%o A322989 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); };
%o A322989 A322989(n) = if((1==n)||isprimepower(n),0,1+A322989(A322990(n)));
%o A322989 A322990(n) = A289272(A289271(n)>>1);
%Y A322989 Cf. A000961, A001221, A010055, A289272, A322990.
%Y A322989 Cf. also A322823.
%K A322989 nonn
%O A322989 1,12
%A A322989 _Antti Karttunen_, Jan 01 2019