%I #27 Mar 23 2020 06:22:24
%S 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 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 28,12,32,49,4,57,16,59,4,55,0,33,64,65,16,61,44,69,64,71,4,7
%N a(n) = (-2)^n mod n.
%C n^(n+2) mod (n+2) is essentially the same.
%C Indices of 0's: 2^k - 1, k>=0.
%C Indices of 1's: A006521 except the first term.
%C Indices of 3's: A015940.
%C Indices of 5's: 7, 133, 1517, 11761, ...
%C a(A000040(n)) = A000040(n)-2 = A040976(n).
%H Alois P. Heinz, <a href="/A215747/b215747.txt">Table of n, a(n) for n = 1..10000</a>
%e a(5) = (-2)^5 mod 5 = -32 mod 5 = 3.
%p a:= n-> (-2)&^n mod n:
%p seq(a(n), n=1..100); # _Alois P. Heinz_, Apr 08 2015
%o (Python)
%o for n in range(1, 333):
%o print((-2)**n % n, end=',')
%Y Cf. A015910, A082493, A082494, A110146, A213381.
%K nonn,look
%O 1,5
%A _Alex Ratushnyak_, Aug 23 2012