A251603 Numbers k such that k + 2 divides k^k - 2.
3, 4551, 46775, 82503, 106976, 1642796, 4290771, 4492203, 4976427, 21537831, 21549347, 21879936, 51127259, 56786087, 60296571, 80837771, 87761787, 94424463, 96593696, 138644871, 168864999, 221395539, 255881451, 297460451, 305198247, 360306363, 562654203
Offset: 1
Keywords
Examples
3 is in this sequence because 3 + 2 = 5 divides 3^3 - 2 = 25.
Links
- Max Alekseyev, Table of n, a(n) for n = 1..890 (all terms below 10^15)
Programs
-
Magma
[n: n in [0..10000] | Denominator((n^n-2)/(n+2)) eq 1];
-
Maple
isA251603 := proc(n) if modp(n &^ n-2,n+2) = 0 then true; else false; end if; end proc: A251603 := proc(n) option remember; local a; if n = 1 then 3; else for a from procname(n-1)+1 do if isA251603(a) then return a; end if; end do: end if; end proc: # R. J. Mathar, Jan 09 2015
-
Mathematica
Select[Range[10^6], Mod[PowerMod[#, #, # + 2] - 2, # + 2] == 0 &] (* Michael De Vlieger, Dec 20 2014, based on Robert G. Wilson v at A252041 *)
-
PARI
for(n=1,10^9,if(Mod(n,n+2)^n==+2,print1(n,", "))); \\ Joerg Arndt, Dec 06 2014
-
Python
A251603_list = [n for n in range(1,10**6) if pow(n, n, n+2) == 2] # Chai Wah Wu, Apr 13 2015
Formula
The even terms form A122711, the odd terms are those in A245319 (forming A357125) decreased by 2. - Max Alekseyev, Sep 22 2016
Extensions
a(6)-a(27) from Joerg Arndt, Dec 06 2014
Comments