OFFSET
1,1
COMMENTS
Are there any composites c where a composite d with d < c exists such that both c^(d-1) == 1 (mod d^2) and d^(c-1) == 1 (mod c^2)?
EXAMPLE
The composites 8 and 65 satisfy the congruences 65^(8-1) == 1 (mod 8^2) and 8^(65-1) == 1 (mod 65), so 65 is a term of the sequence.
MATHEMATICA
With[{s = Select[Range@ 3000, CompositeQ]}, Select[s, Function[c, AnyTrue[Take[s, First@ FirstPosition[s, c]], Or[And[PowerMod[c, (# - 1), #^2] == 1, PowerMod[#, (c - 1), c] == 1], And[PowerMod[c, (# - 1), #] == 1, PowerMod[#, (c - 1), c^2] == 1]] &]]]] (* Michael De Vlieger, Jan 11 2018 *)
PROG
(PARI) is(n) = forcomposite(c=1, n-1, if((Mod(n, c^2)^(c-1)==1 && Mod(c, n)^(n-1)==1) || (Mod(n, c)^(c-1)==1 && Mod(c, n^2)^(n-1)==1), return(1))); 0
forcomposite(c=1, , if(is(c), print1(c, ", ")))
CROSSREFS
KEYWORD
nonn
AUTHOR
Felix Fröhlich, Jan 07 2018
STATUS
approved