OFFSET
1,6
COMMENTS
Here "between" refers to numbers in the range [prime(n) + 1, prime(n+1) - 1], all of which are composite, and the sequence counts the numbers in each such range which are not prime powers. Whereas the corresponding number of prime powers seems bounded (see A080101), the number of numbers which are not prime powers is unbounded (see A014963). Conjecture: Every nonnegative integer appears in this sequence (at least once).
LINKS
Michael De Vlieger, Table of n, a(n) for n = 1..10000
Michael De Vlieger, Annotated log scatterplot of a(n), n = 1..2^20, showing records in red.
FORMULA
EXAMPLE
Between 2 and 3 there are no other numbers so a(1) = 0.
Between 3 and 5 there is only one number (4) and it is a prime power, so a(2) = 0.
Between 5 and 7 the only number is 6 and it is not a prime power, so a(3) = 1.
Between 47 and 53 there are 5 composite numbers, but one of them (49) is a prime power, so since 47 = prime(15), a(15) = 4.
MAPLE
N:= 101: # for a(1) .. a(N-1)
P:= [seq(ithprime(i), i=1..N)]:
PP:= {seq(seq(P[i]^j, j = 2 .. ilog[P[i]](P[N])), i=1..N)}:
seq(nops({$P[i]+1 .. P[i+1]-1} minus PP), i=1 .. N-1); # Robert Israel, Jan 04 2024
MATHEMATICA
Map[Count[Range[#1, #2 - 1], _?(Not@*PrimePowerQ)] & @@ # &, Partition[Prime@ Range[120], 2, 1]] (* Michael De Vlieger, Jan 04 2024 *)
PROG
(PARI) a(n) = sum(k=prime(n)+1, prime(n+1)-1, !isprimepower(k)); \\ Michel Marcus, Jan 04 2024
CROSSREFS
KEYWORD
nonn
AUTHOR
David James Sycamore, Jan 04 2024
EXTENSIONS
More terms from Michel Marcus, Jan 04 2024
STATUS
approved