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.
%I A213382 #24 Mar 26 2021 09:25:03 %S A213382 1,4,7,13,16,19,31,37,49,55,61,67,85,91,109,121,127,139,157,175,181, %T A213382 193,196,199,211,217,235,247,265,289,301,307,313,319,325,337,379,391, %U A213382 397,409,415,445,451,469,487,499,517,535,541,571,577,589,595,631,667,679 %N A213382 Numbers n such that n^n mod (n + 2) = n. %C A213382 Equivalently, numbers n such that (n^n+2)/(n+2) is an integer. _Derek Orr_, May 23 2014 %C A213382 It was conjectured that A176003 is a subsequence. %C A213382 Terms that do not appear in A176003: 16, 61, 193, 196, 313, 397, 691, 729, 769 ... %C A213382 The conjecture is correct: verify the cases 1 and 3, then it suffices to show that (3p-2)^(3p-2) = 3p-2 mod 3 and mod p. Mod 3 the congruence is 1^(3p-2) = 1, and mod p the congruence is (-2)^(3p-2) = -2 which is true by Fermat's little theorem. - _Charles R Greathouse IV_, Sep 12 2012 %C A213382 a(62) = 729 is the first number not congruent to 1 mod 3. - _Derek Orr_, May 23 2014 %H A213382 Charles R Greathouse IV, <a href="/A213382/b213382.txt">Table of n, a(n) for n = 1..10000</a> %e A213382 A213381(n) = 7^7 mod 9 = 7, so 7 is in the sequence. %t A213382 Select[Range[700],PowerMod[#,#,#+2]==#&] (* _Harvey P. Dale_, Oct 03 2015 *) %o A213382 (Python) %o A213382 for n in range(999): %o A213382 x = n**n % (n+2) %o A213382 if x==n: %o A213382 print(n, end=", ") %o A213382 (PARI) is(n)=Mod(n,n+2)^n==n \\ _Charles R Greathouse IV_, Sep 12 2012 %Y A213382 Cf. A213381 : a(n) = n^n mod (n+2). %Y A213382 Cf. A176003. %K A213382 nonn %O A213382 1,2 %A A213382 _Alex Ratushnyak_, Jun 10 2012