OFFSET
1,1
COMMENTS
LINKS
Michel Marcus, Table of n, a(n) for n = 1..10000
EXAMPLE
The first number line below shows the perfect powers. The second shows each prime.
-1-----4-------8-9------------16----------------25--27--------32------36------------------------49--
===2=3===5===7======11==13======17==19======23==========29==31==========37======41==43======47======
MATHEMATICA
radQ[n_]:=n>1&&GCD@@Last/@FactorInteger[n]==1;
Table[NestWhile[#+1&, Prime[n], radQ[#]&], {n, 100}]
PROG
(PARI) f(p) = p++; while(!ispower(p), p++); p;
lista(nn) = apply(f, primes(nn)); \\ Michel Marcus, Dec 19 2024
(Python)
from sympy import mobius, integer_nthroot, prime
from oeis_sequences.OEISsequences import bisection
def A378249(n):
def f(x): return int(x-1+sum(mobius(k)*(integer_nthroot(x, k)[0]-1) for k in range(2, x.bit_length())))
m = (p:=prime(n))-f(p)+1
return bisection(lambda x:f(x)+m, m, m) # Chai Wah Wu, Dec 20 2025
CROSSREFS
KEYWORD
nonn
AUTHOR
Gus Wiseman, Nov 21 2024
STATUS
approved
