OFFSET
1,2
COMMENTS
The odd composite and the even composite terms of this sequence are respectively 3353, 4213, 9233, 10813, ... and all and only powers of 2 >= 4.
EXAMPLE
1 is in this sequence because (1-1)^1 mod 1 = 0 != 1.
3 is in this sequence because
(3-1)^1 mod 3 = 2 != 1,
(3-2)^2 mod 3 = 1 != 2,
(3-3)^3 mod 3 = 0 != 3.
PROG
(Magma) [m : m in [1..2^11] | #[k: k in [1..m] | (m-k)^k mod m eq k] eq 0];
(PARI) isok(m) = for (k=1, m, if ((m - k)^k % m == k, return (0))); return(1); \\ Michel Marcus, Jun 30 2024
CROSSREFS
KEYWORD
nonn
AUTHOR
Juri-Stepan Gerasimov, Jun 22 2024
STATUS
approved