OFFSET
1,1
COMMENTS
Is this the same as "x^8 = 2 (mod p) has a solution but x^32 = 2 (mod p) doesn't"? It appears that this sequence is exactly the complement of A045316 in A059349. - M. F. Hasler, Jun 21 2024
LINKS
M. F. Hasler, Table of n, a(n) for n = 1..2000, Jun 22 2024
PROG
(PARI)
ok(p, r, k1, k2)={
if ( Mod(r, p)^((p-1)/gcd(k1, p-1))!=1, return(0) );
if ( Mod(r, p)^((p-1)/gcd(k2, p-1))==1, return(0) );
return(1);
}
forprime(p=2, 10^5, if (ok(p, 2, 8, 8^2), print1(p, ", ")));
/* Joerg Arndt, Sep 21 2012 */
(PARI) select( {is_A070184(p)=Mod(2, p)^(p\gcd(8, p-1))==1 && Mod(2, p)^(p\gcd(64, p-1))!=1 && isprime(p)}, primes(1999)) \\ The only composite numbers that would pass the test without isprime are A242880. - M. F. Hasler, Jun 22 2024
(Magma) [p: p in PrimesUpTo(15000) | not exists{x: x in ResidueClassRing(p) | x^64 eq 2} and exists{x: x in ResidueClassRing(p) | x^8 eq 2}]; // Vincenzo Librandi, Sep 21 2012
(Python)
from itertools import islice
from sympy import is_nthpow_residue, nextprime
def A070184_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, 64, p):
yield p
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Klaus Brockhaus, Apr 29 2002
STATUS
approved