login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

Primes p such that there exist x, y where x + y, x * y and x ^ y == 1 mod p.
1

%I #25 Nov 06 2024 04:11:12

%S 3,19,31,61,67,79,97,127,307,331,367,409,457,499,571,613,631,691,709,

%T 727,733,787,829,883,991,1063,1087,1093,1213,1297,1303,1327,1423,1471,

%U 1549,1567,1693,1699,1723,1747,1777,1783,1801,1987,2011,2053,2083,2143,2161

%N Primes p such that there exist x, y where x + y, x * y and x ^ y == 1 mod p.

%H Giovanni Resta, <a href="/A236969/b236969.txt">Table of n, a(n) for n = 1..1000</a>

%e 26 + 6 = 32 == 1 mod 31.

%e 26 * 6 = 156 == 1 mod 31.

%e 26 ^ 6 = 308915776 == 1 mod 31.

%e so 31 is in the sequence.

%t okQ[n_] := Block[{x,y,r}, r = Reduce[x+y == 1 && x*y == 1 , {x,y}, Modulus -> n]; r =!= False && Or @@ ((1 == PowerMod[#[[1]], #[[2]], n]) & /@ ({x,y} /. List@ ToRules@ r))]; Select[Prime@Range@300, okQ] (* _Giovanni Resta_, Feb 03 2014 *)

%o (PARI) okp(p) = {for (x=0, p, for (y=0, p, if ((((x+y) % p)==1) && ((x*y) % p == 1) && (((x^y) % p) == 1), print1("x=", x, " y=", y);return (1)););); return (0);}

%o listp(nn) = {forprime (p=2, nn, if (okp(p), print(" p=", p)););} \\ _Michel Marcus_, Feb 02 2014

%Y Cf. A007645.

%K nonn

%O 1,1

%A _Jon Perry_, Feb 02 2014