OFFSET
1,1
LINKS
Giovanni Resta, Table of n, a(n) for n = 1..1000
EXAMPLE
26 + 6 = 32 == 1 mod 31.
26 * 6 = 156 == 1 mod 31.
26 ^ 6 = 308915776 == 1 mod 31.
so 31 is in the sequence.
MATHEMATICA
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 *)
PROG
(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);
listp(nn) = {forprime (p=2, nn, if (okp(p), print(" p=", p)); ); } \\ Michel Marcus, Feb 02 2014
CROSSREFS
KEYWORD
nonn
AUTHOR
Jon Perry, Feb 02 2014
STATUS
approved