OFFSET
1,1
LINKS
Charles R Greathouse IV, Table of n, a(n) for n = 1..10000
EXAMPLE
The order of 2 mod 31 is 5, and sqrt(31) = 5.56776436283..., which is more than 5, so 31 is in the sequence.
The order of 2 mod 37 is 36, and sqrt(37) = 6.08276253..., which is significantly less than 36, so 37 is not in the sequence.
MAPLE
q:= p-> is(numtheory[order](2, p)^2<p):
select(q, [ithprime(i)$i=1..10000])[]; # Alois P. Heinz, Mar 16 2020
MATHEMATICA
Select[Prime[Range[6000]], MultiplicativeOrder[2, #] < Sqrt[#] &] (* Amiram Eldar, Mar 16 2020 *)
PROG
(PARI) list(lim)=my(v=List(), t, p, o); forfactored(P=30, lim\1, if(vecsum(P[2][, 2])==1, t=znorder(Mod(2, p=P[1]), o); if(t^2<p, listput(v, p))); o=P); Vec(v)
(Julia)
using Nemo
function isA333245(n)
! isprime(n) && return false
s, m, N = 0, 1, n
r = isqrt(n)
while true
k = N + m
v = valuation(k, 2)
s += v
s > r && return false
m = k >> v
m == 1 && break
end
return true
end
print([n for n in 3:2:60000 if isA333245(n)]) # Peter Luschny, Mar 16 2020
CROSSREFS
KEYWORD
nonn
AUTHOR
Charles R Greathouse IV, Mar 12 2020
STATUS
approved