login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A378371
Distance between n and the least non prime power >= n, allowing 1.
10
0, 4, 3, 2, 1, 0, 3, 2, 1, 0, 1, 0, 1, 0, 0, 2, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 2, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0
OFFSET
1,2
COMMENTS
Non prime powers allowing 1 (A361102) are numbers that are not a prime power (A246655), namely 1, 6, 10, 12, 14, 15, 18, 20, 21, 22, 24, ...
FORMULA
a(n) = A378372(n) - n.
EXAMPLE
The least non prime power >= 4 is 6, so a(4) = 2.
MATHEMATICA
Table[NestWhile[#+1&, n, PrimePowerQ[#]&]-n, {n, 100}]
CROSSREFS
Sequences obtained by adding n to each term are placed in parentheses below.
For prime we have A007920 (A151800), strict A013632.
For composite we have A010051 (A113646 except initial terms).
For perfect power we have A074984 (A377468)
For squarefree we have A081221 (A067535).
For nonsquarefree we have (A120327).
For non perfect power we have A378357 (A378358).
The opposite version is A378366 (A378367).
For prime power we have A378370, strict A377282 (A000015).
This sequence is A378371 (A378372).
A000040 lists the primes, differences A001223.
A000961 and A246655 list the prime powers, differences A057820.
A024619 and A361102 list the non prime powers, differences A375708 and A375735.
Prime powers between primes: A053607, A080101, A304521, A366833, A377057.
Sequence in context: A066440 A182425 A071692 * A307335 A030586 A249345
KEYWORD
nonn
AUTHOR
Gus Wiseman, Nov 28 2024
STATUS
approved