OFFSET
1,1
LINKS
David A. Corneth, Table of n, a(n) for n = 1..1713
FORMULA
PROG
(Magma) T:=[ n eq 1 select 2 else Self(n-1)+2*(1+n mod 2): n in [1..22] ]; S:=[]; p:=2; for k in T do while &+Intseq(p, 10) ne k do p:=NextPrime(p); end while; Append(~S, p); end for; S; // Klaus Brockhaus, Dec 13 2008
(PARI) a(n) = {n = (n-1)\2*6+3+(-1)^n ; t = ceil(n/9); leastfound = oo; while(leastfound == oo, my(p = partitions(n, [1, 9], [t, t])); v = vector(#p, i, oo); for(i = 1, #p, if(fromdigits(Vec(p[i])) > leastfound, next(2)); forperm(Vec(p[i]), q, if(isprime(fromdigits(Vec(q))), leastfound = min(leastfound, fromdigits(Vec(q))); v[i] = min(v[i], fromdigits(Vec(q))); next(2); ) ) ); t++ ); leastfound }\\ David A. Corneth, Jun 13 2020
CROSSREFS
Cf. A111380 (smallest prime whose digital sum is equal to the n-th composite number not congruent to 0 (modulo 3)). - Klaus Brockhaus, Dec 12 2008
KEYWORD
nonn,base
AUTHOR
Giovanni Teofilatto, Dec 10 2008
EXTENSIONS
Edited and extended by R. J. Mathar, Dec 12 2008
a(20)-a(22) from Klaus Brockhaus, Dec 13 2008
More terms from Jinyuan Wang, Jun 13 2020
STATUS
approved