OFFSET
1,1
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 1..150
MATHEMATICA
Select[Prime[Range[PrimePi[20000]]], !MemberQ[PowerMod[Range[#], 16, #], Mod[2, #]] && MemberQ[PowerMod[Range[#], 8, #], Mod[2, #]]&] (* Vincenzo Librandi, Sep 21 2013 *)
PROG
(Magma) [p: p in PrimesUpTo(17000) | not exists{x: x in ResidueClassRing(p) | x^16 eq 2} and exists{x: x in ResidueClassRing(p) | x^8 eq 2}]; // Vincenzo Librandi, Sep 21 2012
(PARI) select( {is_A059287(p)=Mod(2, p)^(p\gcd(8, p-1))==1&&Mod(2, p)^(p\gcd(16, p-1))!=1}, primes(1999)) \\ Could any composite number pass this test? - M. F. Hasler, Jun 22 2024
(Python)
from itertools import islice
from sympy import is_nthpow_residue, nextprime
def A059287_gen(startvalue=2): # generator of terms >= startvalue
p = max(1, startvalue-1)
while (p:=nextprime(p)):
if is_nthpow_residue(2, 8, p) and not is_nthpow_residue(2, 16, p):
yield p
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Klaus Brockhaus, Jan 25 2001
STATUS
approved