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 A215747 #31 Aug 25 2025 10:24:51 %S A215747 0,0,1,0,3,4,5,0,1,4,9,4,11,4,7,0,15,10,17,16,13,4,21,16,18,4,1,16,27, %T A215747 4,29,0,25,4,17,28,35,4,31,16,39,22,41,16,28,4,45,16,19,24,43,16,51, %U A215747 28,12,32,49,4,57,16,59,4,55,0,33,64,65,16,61,44,69,64,71,4,7 %N A215747 a(n) = (-2)^n mod n. %C A215747 n^(n+2) mod (n+2) is essentially the same. %C A215747 Indices of 0's: 2^k - 1, k>=0. %C A215747 Indices of 1's: A006521 except the first term. %C A215747 Indices of 3's: A015940. %C A215747 Indices of 5's: 7, 133, 1517, 11761, ... %C A215747 a(A000040(n)) = A000040(n)-2 = A040976(n). %H A215747 Alois P. Heinz, <a href="/A215747/b215747.txt">Table of n, a(n) for n = 1..10000</a> %e A215747 a(5) = (-2)^5 mod 5 = -32 mod 5 = 3. %p A215747 a:= n-> (-2)&^n mod n: %p A215747 seq(a(n), n=1..100); # _Alois P. Heinz_, Apr 08 2015 %t A215747 a[n_]:=Mod[(-2)^n ,n]; Array[a,75] (* _Stefano Spezia_, Aug 25 2025 *) %o A215747 (Python) %o A215747 for n in range(1, 333): %o A215747 print((-2)**n % n, end=',') %Y A215747 Cf. A015910, A082493, A082494, A110146, A213381. %K A215747 nonn,look,changed %O A215747 1,5 %A A215747 _Alex Ratushnyak_, Aug 23 2012