OFFSET
1,1
COMMENTS
For all n > 2, a(n) is congruent to 5 mod 6.
Conjecture: 2^(a(n)-1) - 1 is always squarefree.
EXAMPLE
Prime 5 is a term because 2^4 - 1 = 15 = 3*5 and its sole prime factor < 5 is 3, whose exponent is 1.
Prime 11 is a term because 2^10 - 1 = 1023 = 3 * 11 * 31 and the exponent of 3 is 1.
Prime 17 is a term because 2^16 - 1 = 65535 = 3 * 5 * 17 * 257 and its two prime factors 3 and 5 which are < 17 both have exponent 1.
MAPLE
P:= select(isprime, [2, seq(i, i=3..1000, 2)]):
filter:= i -> andmap(q -> 2 &^(P[i]-1)-1 mod q^2 <> 0, P[1..i-1]):
P[select(filter, [$1..nops(P)])]; # Robert Israel, Jan 24 2023
MATHEMATICA
primes[p_] := Select[Range[p - 1], PrimeQ[#] && PowerMod[2, p - 1, #] == 1 &]; q[p_] := AllTrue[primes[p], PowerMod[2, p - 1, #^2] != 1 &]; Select[Prime[Range[124]], q] (* Amiram Eldar, Jan 23 2023 *)
PROG
(PARI) forprime(p=2, 400, forprime(div=3, p-1, if(Mod(2, div^2)^(p-1)==1, next(2))); print1(p, ", "))
(PARI) isok(p) = if (isprime(p), my(f=factor(2^(p-1)-1, p)[, 2]); (#f==0) || (vecmax(f) == 1)); \\ Michel Marcus, Feb 08 2023
(Python)
from itertools import count, islice
from sympy import prime
def A360053_gen(): # generator of terms
for i in count(1):
p = prime(i)
if all((pow(2, p-1, prime(j)**2)-1 for j in range(1, i))):
yield p
CROSSREFS
KEYWORD
nonn
AUTHOR
Alain Rocchelli, Jan 23 2023
STATUS
approved