%I #28 Jan 31 2021 20:01:57
%S 1,2,4,16,64,140,440,700,1650,2304,5180,3960,3900,14400,15600,43560,
%T 39600,57600,56700,81900,25200,112896,100100,177840,198000,411840,
%U 222768,226800,637560,752400,556920,907200,409500,565488,1306800,1984500,1884960
%N Smallest k such that the partial sums of the divisors of k (taken in increasing order) contain exactly n primes.
%C It appears that a(n) is even for n > 0 and nonsquarefree for n > 1. We also conjecture that there is an infinite subsequence of squares 1, 4, 16, 64, 2304, 14400, 57600, 112896, ....
%C The corresponding triangle in which row n gives the n primes starts with:
%C k = 1 -> no prime
%C k = 2 -> 3;
%C k = 4 -> 3, 7;
%C k = 16 -> 3, 7, 31;
%C k = 64 -> 3, 7, 31, 127;
%C k = 140 -> 3, 7, 19, 29, 43;
%C k = 440 -> 3, 7, 41, 61, 83, 167; ...
%H Amiram Eldar, <a href="/A187822/b187822.txt">Table of n, a(n) for n = 0..126</a>
%e a(4) = 64 because the partial sums of the divisors {1, 2, 4, 8, 16, 32, 64} that generate 4 prime numbers are:
%e 1 + 2 = 3;
%e 1 + 2 + 4 = 7;
%e 1 + 2 + 4 + 8 + 16 = 31;
%e 1 + 2 + 4 + 8 + 16 + 32 + 64 = 127.
%p read("transforms") :
%p A187822 := proc(n)
%p local k,ps,pct ;
%p if n = 0 then
%p return 1;
%p end if;
%p for k from 1 do
%p ps := sort(convert(numtheory[divisors](k),list)) ;
%p ps := PSUM(ps) ;
%p pct := 0 ;
%p for p in ps do
%p if isprime(p) then
%p pct := pct+1 ;
%p end if;
%p end do:
%p if pct = n then
%p return k ;
%p end if;
%p end do:
%p end proc: # _R. J. Mathar_, Jan 18 2013
%t a[n_] := Catch[ For[k = 1, True, k++, cnt = Count[ Accumulate[ Divisors[k]], _?PrimeQ]; If[cnt == n, Print[{n, k}]; Throw[k]]]]; Table[a[n], {n, 0, 40}] (* _Jean-François Alcover_, Dec 27 2012 *)
%o (PARI) A187822(n)={n<1||for(k=1,9e9,numdiv(k)<n&next; my(t=divisors(k),s=1,c); for(i=2,#t,isprime(s+=t[i])&c++==n&return(k)))} \\ _M. F. Hasler_, Dec 29 2012
%Y Cf. A023194, A062700, A000203.
%K nonn
%O 0,2
%A _Michel Lagneau_, Dec 27 2012