login
Numbers k such that Sum_{j=1..k} (-j)^j == 1 (mod k).
2

%I #32 Jul 02 2021 11:32:43

%S 1,2,30,33,37,83,149,262,4030,31969,140225,182730,724754,2337094,

%T 3985753,4195221,4541725

%N Numbers k such that Sum_{j=1..k} (-j)^j == 1 (mod k).

%t q[n_] := n == 1 || Mod[Sum[PowerMod[-k, k, n], {k, 1, n}], n] == 1; Select[Range[5000], q] (* _Amiram Eldar_, May 04 2021 *)

%o (PARI) isok(n) = sum(k=1, n, Mod(-k, n)^k)==1;

%Y Cf. A188776, A341437, A343931, A343933.

%K nonn,more

%O 1,2

%A _Seiichi Manyama_, May 04 2021

%E a(11)-a(13) from _Chai Wah Wu_, May 04 2021

%E a(14) from _Martin Ehrenstein_, May 05 2021

%E a(15)-a(17) from _Martin Ehrenstein_, May 08 2021