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

%I #17 Jun 19 2022 15:23:26

%S 1,2,3,4,5,7,9,11,13,17,19,23,25,27,29,31,37,41,43,47,49,53,59,61,67,

%T 71,72,73,79,83,89,97,101,103,107,109,113,121,125,127,131,137,139,149,

%U 151,157,163,167,169,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257

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

%C This sequence is different from A074583.

%H Seiichi Manyama, <a href="/A343983/b343983.txt">Table of n, a(n) for n = 1..10000</a>

%t q[n_] := Divisible[DivisorSum[n, #^# &] - 1, n]; Select[Range[260], q] (* _Amiram Eldar_, May 06 2021 *)

%o (PARI) isok(n) = sumdiv(n, d, Mod(d, n)^d)==1;

%o (Python)

%o from itertools import count, islice

%o from sympy import divisors

%o def A343983_gen(): # generator of terms

%o yield 1

%o for k in count(1):

%o if sum(pow(j,j,k) for j in divisors(k,generator=True)) % k == 1:

%o yield k

%o A343983_list = list(islice(A343983_gen(),30)) # _Chai Wah Wu_, Jun 19 2022

%Y Cf. A062796, A188776.

%K nonn

%O 1,2

%A _Seiichi Manyama_, May 06 2021