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”).
%I #34 Feb 08 2023 13:14:55
%S 2,3,5,11,17,23,29,47,53,59,71,83,89,107,113,131,149,167,173,179,191,
%T 197,227,233,239,251,257,263,269,293,317,347,353,359,383,389,419,431,
%U 443,449,467,479,491,503,509,557,563,569,587,593,599,617,647,653,659,677,683
%N Primes p such that each prime < p in the prime factorization of 2^(p-1) - 1 has exponent 1.
%C For all n > 2, a(n) is congruent to 5 mod 6.
%C Conjecture: 2^(a(n)-1) - 1 is always squarefree.
%e Prime 5 is a term because 2^4 - 1 = 15 = 3*5 and its sole prime factor < 5 is 3, whose exponent is 1.
%e Prime 11 is a term because 2^10 - 1 = 1023 = 3 * 11 * 31 and the exponent of 3 is 1.
%e 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.
%p P:= select(isprime,[2,seq(i,i=3..1000,2)]):
%p filter:= i -> andmap(q -> 2 &^(P[i]-1)-1 mod q^2 <> 0, P[1..i-1]):
%p P[select(filter, [$1..nops(P)])]; # _Robert Israel_, Jan 24 2023
%t 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 *)
%o (PARI) forprime(p=2, 400, forprime(div=3, p-1, if(Mod(2,div^2)^(p-1)==1, next(2))); print1(p,", "))
%o (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
%o (Python)
%o from itertools import count, islice
%o from sympy import prime
%o def A360053_gen(): # generator of terms
%o for i in count(1):
%o p = prime(i)
%o if all((pow(2,p-1,prime(j)**2)-1 for j in range(1,i))):
%o yield p
%o A360053_list = list(islice(A360053_gen(),20)) # _Chai Wah Wu_, Feb 08 2023
%K nonn
%O 1,1
%A _Alain Rocchelli_, Jan 23 2023