%I #23 Sep 08 2022 08:46:20
%S 2,2,4,2,25,2,262144,4,4,64,734449,2,3100870943041,9066121,4,2,729,2,
%T 214355670008317962105386619478205641151753401,5041,64,16,25,
%U 10651330026288961,16610312161,2607021481,38950081,1817762776525603445521,5331481,2,2160067977820518171249529658520145004718584607049,21203610154988994565561
%N a(n) is the smallest number k such that sigma(k) and sigma(k^n) are both primes.
%C Sequence b(n) of the smallest numbers m such that sigma(m^k) are all primes for k = 1..n: 2, 2, 4, ... (if fourth term exists, it must be bigger than 10^16).
%C a(n) is of the form p^e where p, e+1 and e*n+1 are primes. e=1 is possible only in the case p=2. - _Robert Israel_, Feb 06 2018
%H Robert Israel, <a href="/A299148/b299148.txt">Table of n, a(n) for n = 1..79</a>
%F a(n) >= A279094(n).
%e For n = 3; a(3) = 4 because 4 is the smallest number such that sigma(4) = 7 and sigma(4^3) = 127 are both primes.
%p f:= proc(n,Nmin,Nmax) local p, e, M, Res;
%p M:= Nmax;
%p Res:= -1;
%p e:= 0;
%p do
%p e:= nextprime(e+1)-1;
%p if 2^e > M then return Res fi;
%p if not isprime(e*n+1) then next fi;
%p p:= floor(Nmin^(1/e));
%p do
%p p:= nextprime(p);
%p if p^e > M then break fi;
%p if e = 1 and p > 2 then break fi;
%p if isprime((p^(e+1)-1)/(p-1)) and isprime((p^(e*n+1)-1)/(p-1)) then
%p Res:= p^e;
%p M:= p^e;
%p break
%p fi
%p od
%p od;
%p end proc:
%p g:= proc(n) local Nmin,Nmax, v;
%p Nmax:= 1;
%p do
%p Nmin:= Nmax;
%p Nmax:= Nmax*10^3;
%p v:= f(n,Nmin,Nmax);
%p if v > 0 then return v fi;
%p od;
%p end proc:
%p seq(g(n),n=1..50); # _Robert Israel_, Feb 06 2018
%t Array[Block[{k = 2}, While[! AllTrue[DivisorSigma[1, #] & /@ {k, k^#}, PrimeQ], k++]; k] &, 10] (* _Michael De Vlieger_, Feb 05 2018 *)
%o (Magma) [Min([n: n in[1..10000000] | IsPrime(SumOfDivisors(n)) and IsPrime(SumOfDivisors(n^k))]): k in [2..12]]
%o (PARI) a(n) = {my(k=1); while (!(isprime(sigma(k)) && isprime(sigma(k^n))), k++); k;} \\ _Michel Marcus_, Feb 05 2018
%Y Cf. A000203, A279094.
%K nonn
%O 1,1
%A _Jaroslav Krizek_, Feb 03 2018
%E a(13) to a(32) from _Robert Israel_, Feb 06 2018
|