OFFSET
1,1
COMMENTS
Numbers k such that exactly one of A246655(k) and A246655(k+1) is prime. - Robert Israel, Jan 22 2025
The prime powers themselves are: 3, 4, 7, 9, 13, 16, 23, 27, 31, 32, 47, 49, 61, 64, ...
LINKS
Robert Israel, Table of n, a(n) for n = 1..2112
EXAMPLE
The 4th and 5th prime powers are 5 and 7, with interval (5,6,7) containing two primes, so 4 is not in the sequence.
The 13th and 14th prime powers are 23 and 25, with interval (23,24,25) containing only one prime, so 13 is in the sequence.
The 18th and 19th prime powers are 32 and 37, with interval (32,33,34,35,36,37) containing just one prime 37, so 18 is in the sequence.
MAPLE
N:= 1000: # for terms k where A246655(k+1) <+ N
P:= select(isprime, [2, seq(i, i=3..N, 2)]):
S:= convert(P, set):
for p in P while p^2 <= N do
S:= S union {seq(p^j, j=2..ilog[p](N))}
od:
PP:= sort(convert(S, list)):
state:= 1: Res:= NULL:
ip:= 2:
for i from 2 to nops(PP) do
if PP[i] = P[ip] then
if state = 0 then Res:= Res, i-1 fi;
state:= 1;
ip:= ip+1;
else
if state = 1 then Res:= Res, i-1 fi;
state:= 0;
fi
od:
Res; # Robert Israel, Jan 22 2025
MATHEMATICA
v=Select[Range[100], PrimePowerQ];
Select[Range[Length[v]-1], Length[Select[Range[v[[#]], v[[#+1]]], PrimeQ]]==1&]
CROSSREFS
KEYWORD
nonn
AUTHOR
Gus Wiseman, Dec 22 2024
STATUS
approved