The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 Hints (Greetings from The On-Line Encyclopedia of Integer Sequences!)
 A251603 Numbers n such that n + 2 divides n^n - 2. 4
 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 (list; graph; refs; listen; history; text; internal format)
 OFFSET 1,1 COMMENTS Numbers n such that (n^n - 2)/(n + 2) is an integer. Since n == -2 (mod n+2), also numbers n such that n + 2 divides (-2)^n - 2. - Robert Israel, Jan 04 2015 Numbers n == 0 (mod 4) such that A066602(n/2+1) = 8, and odd numbers n such that n = 3 or A082493(n+2) = 8. - Robert Israel, Apr 08 2015 LINKS FORMULA The even terms form A122711, the odd terms are those in A245319 decreased by 2. - Max Alekseyev, Sep 22 2016 EXAMPLE 3 is in this sequence because 3 + 2 = 5 divides 3^3 - 2 = 25. 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 *) PROG (MAGMA) [n: n in [0..10000] | Denominator((n^n-2)/(n+2)) eq 1]; (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 CROSSREFS Cf. A001477, A004273, A004275, A066602, A082493, A081765, A213382, A252606. Sequence in context: A094319 A229766 A003166 * A168556 A200950 A307210 Adjacent sequences:  A251600 A251601 A251602 * A251604 A251605 A251606 KEYWORD nonn AUTHOR Juri-Stepan Gerasimov, Dec 05 2014 EXTENSIONS Terms 1642796 and beyond from Joerg Arndt, Dec 06 2014 STATUS approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

Last modified September 24 22:46 EDT 2021. Contains 347651 sequences. (Running on oeis4.)