%I #17 Oct 16 2024 21:54:32
%S 4,21,27,39,57,77,183,189,203,205,219,237,253,371,387,391,417,489,565,
%T 611,655,667,669,675,687,749,767,799,831,849,897,921,955,1007,1047,
%U 1135,1189,1207,1349,1371,1379,1407,1421,1461,1469,1497,1513,1569,1633,1643,1659
%N Numbers k such that Sum_{i=1..q-1} d(i)^i is prime, where d(1)<d(2)<...<d(q) are the q divisors of k.
%C The corresponding primes are in A376223.
%e 39 is a term because the 3 first divisors of 39 are {1,3,13} and 1^1 + 3^2 + 13^3 = 2207 is prime.
%e 189 is a term since the 7 first divisors of 189 are {1, 3, 7, 9, 21, 27, 63} and 1^1+3^2+7^3+9^4+21^5+27^6+63^7 = 3939372150671 is prime.
%p with(numtheory):nn:=1700:
%p for n from 1 to nn do:
%p d:=divisors(n):n0:=nops(d):s:=sum(âd[k]^kâ, âkâ=1..n0-1):
%p if isprime(s)
%p then
%p printf(`%d,`,n):
%p else
%p fi:
%p od:
%t Select[Range[1700],PrimeQ[Sum[Part[Divisors[#],i]^i,{i,DivisorSigma[0,#]-1}]] &] (* _Stefano Spezia_, Sep 16 2024 *)
%o (PARI) isok(k) = my(d=divisors(k)); isprime(sum(j=1, #d-1, d[j]^j)); \\ _Michel Marcus_, Sep 16 2024
%Y Cf. A180852, A376223.
%K nonn
%O 1,1
%A _Michel Lagneau_, Sep 16 2024