A116455 Perfect powers n with no primes between n and the next smaller perfect power, which is in A116086.
9, 27, 36, 125, 2197, 3136, 32768, 79524, 97344, 503284375
Offset: 1
Links
- Wikipedia, Redmond-Sun conjecture
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.
Primes 9 and 10 are 23 and 29, and the interval (24,25,26,27,28) contains two perfect powers (25,27), so 9 is in the sequence.
perpowQ[n_]:=n==1||GCD@@FactorInteger[n][[All,2]]>1; Select[Range[100],Count[Range[Prime[#]+1, Prime[#+1]-1],_?perpowQ]>1&]
from itertools import islice from sympy import prime from gmpy2 import is_power, next_prime def A377466_gen(startvalue=1): # generator of terms >= startvalue k = max(startvalue,1) p = prime(k) while (q:=next_prime(p)): c = 0 for i in range(p+1,q): if is_power(i): c += 1 if c>1: yield k break k += 1 p = q A377466_list = list(islice(A377466_gen(),9)) # Chai Wah Wu, Nov 04 2024
25 is the 6th perfect power, i.e., 25 = A001597(6), and there is no prime between 25 and the next larger perfect power A001597(7) = 27, so 25 is a term of A116086, and thus 6 is a term of this sequence.
Position[Count[#, ?PrimeQ] & /@ Range @@@ # &@ Partition[#, 2, 1] &@ Select[Range[10^5], # == 1 || GCD @@ FactorInteger[#][[All, 2]] > 1 &], 0] // Flatten (* _Michael De Vlieger, Jun 30 2016 *)
a001597(n) = my(i=0, k=0); while(1, if(ispower(k) || k==1, i++); if(i==n, return(k)); k++) a080769(n) = primepi(a001597(n+1))-primepi(a001597(n)) is(n) = a080769(n)==0
The interval (121,122,123,124,125) contains no primes, so 121 is in the sequence. - _Gus Wiseman_, Dec 24 2024
With[{upto=33000},Map[First,Select[Partition[Select[Range[upto],PrimePowerQ],2,1],NoneTrue[#,PrimeQ]&]]] (* Paolo Xausa, Oct 25 2023 *)
8 = 2^3, 9 = 3^2, there is no prime between 8 and 9. 25 = 5^2, 27 = 3^3, there is no prime between 25 and 27.
With[{upto=33000},Select[Partition[Select[Range[upto],PrimePowerQ],2,1],NoneTrue[#,PrimeQ]&]] (* Paolo Xausa, Oct 29 2023 *)
ispp(x) = !isprime(x) && isprimepower(x); lista(nn=50000) = {my(prec = 0); for (i=1, nn, if (ispp(i), if (! prec, prec = i, if (primepi(i) == primepi(prec), print1(prec, ", ", i, ", ")); prec = i;);););} \\ Michel Marcus, Aug 24 2019
The next prime power after 32 is 37, with interval (32,33,34,35,36,37) containing just one prime 37, so 32 is in the sequence.
v=Select[Range[100],PrimePowerQ] nextpripow[n_]:=NestWhile[#+1&,n+1,!PrimePowerQ[#]&] Select[v,Length[Select[Range[#,nextpripow[#]],PrimeQ]]==1&]
The prime after 13 is 17, and the interval (13,14,15,16,17) contains only one perfect power 16, so 13 is in the sequence.
N:= 10^4: # to get all entries <= N S:={seq(seq(a^b, b = 2 .. floor(log[a](N))), a = 2 .. floor(sqrt(N)))}: S:= sort(convert(S,list)): J:= select(i -> nextprime(S[i]) < S[i+1] and prevprime(S[i]) > S[i-1], [$2..nops(S)-1]): J:= [1,op(J)]: map(prevprime, S[J]); # Robert Israel, Jan 19 2025
perpowQ[n_]:=n==1||GCD@@FactorInteger[n][[All,2]]>1; Select[Range[1000],PrimeQ[#]&&Length[Select[Range[#,NextPrime[#]],perpowQ]]==1&]
is_a379154(n) = isprime(n) && #select(x->ispower(x), [n+1..nextprime(n+1)-1])==1 \\ Hugo Pfoertner, Dec 19 2024
a(1) = 3 since 2*2^2 - 1, 2*3^2-1 and 2*4^2-1 are all prime but 2*1^2 - 1 is not prime. a(3) = 1 since A001597(3) = 8, A001597(4) = 9, 2*8^2 - 1 = 127 is prime but 2*9^2 - 1 is composite. a(6) = 1 since A001597(6) = 25, A001597(7) = 27, 2*25^2 - 1 = 1249 is prime but 2*26^2 - 1 and 2*27^2 - 1 are composite. a(14) = 1 since A001597(14) = 121, A001597(15) = 125, 2*125^2 - 1 = 31249 is prime but 2*k^2 - 1 is composite for every k = 121, 122, 123, 124. a(361) = 1 since A001597(361) = 46^3 = 97336, A001597(362) = 312^2 = 97344, and k = 97342 is the only number among 97336,...,97344 with 2*k^2 - 1 prime.
n=1;m=1;Do[Do[If[IntegerQ[k^(1/Prime[i])],Print[n," ",Sum[Boole[PrimeQ[2j^2-1]],{j,m,k}]];n=n+1;m=k;Goto[aa]],{i,1,PrimePi[Log[2,k]]}];Label[aa],{k,2,6561}]
Comments