cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A251603 Numbers k such that k + 2 divides k^k - 2.

This page as a plain text file.
%I A251603 #79 Jun 29 2024 16:14:54
%S A251603 3,4551,46775,82503,106976,1642796,4290771,4492203,4976427,21537831,
%T A251603 21549347,21879936,51127259,56786087,60296571,80837771,87761787,
%U A251603 94424463,96593696,138644871,168864999,221395539,255881451,297460451,305198247,360306363,562654203
%N A251603 Numbers k such that k + 2 divides k^k - 2.
%C A251603 Numbers k such that (k^k - 2)/(k + 2) is an integer.
%C A251603 Since k == -2 (mod k+2), also numbers k such that k + 2 divides (-2)^k - 2. - _Robert Israel_, Jan 04 2015
%C A251603 Numbers k == 0 (mod 4) such that A066602(k/2+1) = 8, and odd numbers k such that k = 3 or A082493(k+2) = 8. - _Robert Israel_, Apr 08 2015
%H A251603 Max Alekseyev, <a href="/A251603/b251603.txt">Table of n, a(n) for n = 1..890</a> (all terms below 10^15)
%F A251603 The even terms form A122711, the odd terms are those in A245319 (forming A357125) decreased by 2. - _Max Alekseyev_, Sep 22 2016
%e A251603 3 is in this sequence because 3 + 2 = 5 divides 3^3 - 2 = 25.
%p A251603 isA251603 := proc(n)
%p A251603     if modp(n &^ n-2,n+2) = 0 then
%p A251603         true;
%p A251603     else
%p A251603         false;
%p A251603     end if;
%p A251603 end proc:
%p A251603 A251603 := proc(n)
%p A251603     option remember;
%p A251603     local a;
%p A251603     if n = 1 then
%p A251603         3;
%p A251603     else
%p A251603         for a from procname(n-1)+1 do
%p A251603             if isA251603(a) then
%p A251603                 return a;
%p A251603             end if;
%p A251603         end do:
%p A251603     end if;
%p A251603 end proc: # _R. J. Mathar_, Jan 09 2015
%t A251603 Select[Range[10^6], Mod[PowerMod[#, #, # + 2] - 2, # + 2] == 0 &] (* _Michael De Vlieger_, Dec 20 2014, based on _Robert G. Wilson v_ at A252041 *)
%o A251603 (Magma) [n: n in [0..10000] | Denominator((n^n-2)/(n+2)) eq 1];
%o A251603 (PARI) for(n=1,10^9,if(Mod(n,n+2)^n==+2,print1(n,", "))); \\ _Joerg Arndt_, Dec 06 2014
%o A251603 (Python) A251603_list = [n for n in range(1,10**6) if pow(n, n, n+2) == 2] # _Chai Wah Wu_, Apr 13 2015
%Y A251603 Cf. A001477, A004273, A004275, A066602, A082493, A081765, A213382, A252606, A357125.
%K A251603 nonn
%O A251603 1,1
%A A251603 _Juri-Stepan Gerasimov_, Dec 05 2014
%E A251603 a(6)-a(27) from _Joerg Arndt_, Dec 06 2014