OFFSET
1,1
EXAMPLE
a(1)=7 because 7 is prime, 7 = 3*2^1 + 1 and 2^1 <= 3,
a(2)=11 because 11 is prime, 11 = 5*2^1 + 1 and 2^1 <= 5,
a(3)=19 because 19 is prime, 19 = 9*2^1 + 1 and 2^1 <= 9, ...
MAPLE
ts_neProth_prime:=proc(n) local i, j, k, a, am; k := 2: am:= [ ]: for i from 1 to n do for j from 1 by 2 to n do a := j*k^(i)+1: if (k^(i) <= j and isprime(a)=true) then am := [op(am), a ]: fi: od: od: RETURN( sort(am) ) end: ts_neProth_prime(400);
# Second Maple program
q := n -> (isprime(n) and n >= 2^(2*padic:-ordp(n-1, 2))):
select(q, [$3..331])[]; # Lorenzo Sauras Altuzarra, Mar 03 2023
PROG
(PARI) isok(p) = if (isprime(p), my(m=valuation(p-1, 2)); (m>=1) && ((p-1) >= 4^m)); \\ Michel Marcus, Mar 03 2023
CROSSREFS
KEYWORD
nonn
AUTHOR
Jani Melik, Aug 10 2007
STATUS
approved