login
A249751
Numbers m such that m - 2 divides m^m + 2.
3
3, 4, 7, 8, 67, 260, 379, 1191, 1471, 5076, 25807, 58591, 103780, 134947, 137347, 170587, 203236, 272611, 285391, 420211, 453748, 538735, 540856, 592411, 618451, 680707, 778807, 1163067, 1306936, 1520443, 1700947, 1891336, 2099203, 2831011, 3481960, 4020031
OFFSET
1,1
LINKS
EXAMPLE
3 is in this sequence because (3^3 + 2)/(3 - 2) = 29 is an integer.
MATHEMATICA
fQ[n_] := Mod[ PowerMod[ n, n, n - 2] + 2, n - 2] == 0; Select[ Range@ 4100000, fQ] (* Robert G. Wilson v, Dec 19 2014 *)
PROG
(Magma) [n: n in [3..10000] | Denominator((n^n+2)/(n-2)) eq 1];
(Python)
A249751_list = [n for n in range(3, 10**7) if n==3 or pow(n, n, n-2) == n-4]
# Chai Wah Wu, Dec 06 2014
CROSSREFS
KEYWORD
nonn
AUTHOR
EXTENSIONS
More terms from Chai Wah Wu, Dec 06 2014
STATUS
approved