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.

A096165 Prime powers with exponents that are themselves prime powers.

This page as a plain text file.
%I A096165 #29 Sep 12 2024 12:46:27
%S A096165 2,3,4,5,7,8,9,11,13,16,17,19,23,25,27,29,31,32,37,41,43,47,49,53,59,
%T A096165 61,67,71,73,79,81,83,89,97,101,103,107,109,113,121,125,127,128,131,
%U A096165 137,139,149,151,157,163,167,169,173,179,181,191,193,197,199,211,223,227
%N A096165 Prime powers with exponents that are themselves prime powers.
%C A096165 A000040, A053810, A050376 and A082522 are subsequences;
%C A096165 a(n) = A000961(n+1) for 1<=n<=26.
%C A096165 Complement of A164345 with respect to A000961.
%H A096165 Reinhard Zumkeller, <a href="/A096165/b096165.txt">Table of n, a(n) for n = 1..10000</a>
%F A096165 a(n) ~ n log n. - _Charles R Greathouse IV_, Oct 19 2015
%e A096165 512=2^9=2^(3^2), A000961(118)=A000040(1)^A000961(118), therefore 512 is a term;
%e A096165 64=2^6, but 6 is not a prime power, therefore 64 is not a term.
%p A096165 F:= proc(t) local P;
%p A096165 P:= ifactors(t)[2];
%p A096165 nops(P) = 1 and (P[1][2]=1 or nops(numtheory:-factorset(P[1][2]))=1)
%p A096165 end proc:
%p A096165 select(F, [$2..1000]); # _Robert Israel_, Jul 20 2015
%t A096165 Select[Range@ 240, Or[PrimeQ@ #, PrimePowerQ@ # && PrimePowerQ@ FactorInteger[#][[1, 2]]] &] (* _Michael De Vlieger_, Jul 20 2015 *)
%o A096165 (Haskell)
%o A096165 a096165 n = a096165_list !! (n-1)
%o A096165 a096165_list = filter ((== 1) . a010055 . a001222) $ tail a000961_list
%o A096165 -- _Reinhard Zumkeller_, Nov 17 2011
%o A096165 (PARI) is(n)=while(1,if(!(n=isprimepower(n)),return(0),if(n==1,return(1)))) \\ _Anders Hellström_, Jul 19 2015
%o A096165 (PARI) ispp(n)=n==1 || isprimepower(n)
%o A096165 is(n)=ispp(isprimepower(n)) \\ _Charles R Greathouse IV_, Oct 19 2015
%o A096165 (Python)
%o A096165 from sympy import primepi, integer_nthroot, factorint
%o A096165 def A096165(n):
%o A096165     def f(x): return int(n+x-sum(primepi(integer_nthroot(x,k)[0]) for k in range(1,x.bit_length()) if len(factorint(k))<=1))
%o A096165     def bisection(f,kmin=0,kmax=1):
%o A096165         while f(kmax) > kmax: kmax <<= 1
%o A096165         while kmax-kmin > 1:
%o A096165             kmid = kmax+kmin>>1
%o A096165             if f(kmid) <= kmid:
%o A096165                 kmax = kmid
%o A096165             else:
%o A096165                 kmin = kmid
%o A096165         return kmax
%o A096165     return bisection(f,n,n) # _Chai Wah Wu_, Sep 12 2024
%Y A096165 Cf. A000040, A000961, A010055, A001222, A050376, A053810, A082522, A164336, A164345.
%K A096165 nonn
%O A096165 1,1
%A A096165 _Reinhard Zumkeller_, Jul 25 2004