%I #26 May 06 2024 14:25:08
%S 2,3,5,11,17,23,31,41,47,53,59,83,89,101,107,131,137,149,157,167,173,
%T 179,191,223,227,229,233,251,257,263,269,277,283,293,311,317,347,353,
%U 359,383,389,397,401,419,431,439,443,457,461,467,479,499,503,509,521
%N Primes p such that x^63 = 2 has a solution mod p.
%C Complement of A059647 relative to A000040. - _Vincenzo Librandi_, Sep 15 2012
%H R. J. Mathar, <a href="/A049595/b049595.txt">Table of n, a(n) for n = 1..1000</a>
%H <a href="/index/Pri#smp">Index entries for related sequences</a>
%p select(p -> isprime(p) and nops([msolve(x^63-2,p)])>0, [2,seq(2*i+1,i=1..1000)]); # _Robert Israel_, Nov 03 2014
%t ok[p_]:= Reduce[Mod[x^63 - 2, p] == 0, x, Integers] =!= False; Select[Prime[Range[150]], ok] (* _Vincenzo Librandi_, Sep 15 2012 *)
%o (Magma) [p: p in PrimesUpTo(600) | exists(t){x : x in ResidueClassRing(p) | x^63 eq 2}]; // _Vincenzo Librandi_, Sep 15 2012
%o (PARI) N=10^4;
%o ok(p, r, k)={ return ( (p==r) || (Mod(r,p)^((p-1)/gcd(k,p-1))==1) ); }
%o forprime(p=2,N, if (ok(p,2,63),print1(p,", ")));
%o /* _Joerg Arndt_, Sep 21 2012 */
%o (Python)
%o from itertools import islice
%o from sympy import nextprime, is_nthpow_residue
%o def A049595_gen(startvalue=2): # generator of terms >= startvalue
%o p = max(startvalue-1,1)
%o while (p:=nextprime(p)):
%o if is_nthpow_residue(2,63,p):
%o yield p
%o A049595_list = list(islice(A049595_gen(),20)) # _Chai Wah Wu_, May 06 2024
%Y Cf. A000040, A059647.
%K nonn,easy
%O 1,1
%A _N. J. A. Sloane_
|