OFFSET
1,1
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
MAPLE
dmax:= 6; # to get all entries with at most dmax digits
for s from 0 to 9 do S[1, s]:= {s} od:
for s from 10 to 34 do S[1, s]:= {} od:
for d from 2 to dmax-1 do
for s from 0 to 34 do
S[d, s]:= `union`(seq(map(t-> 10*t+x, S[d-1, s-x]), x=0 .. min(s, 9)))
od
od:
S[dmax, 34]:= `union`(seq(map(t->10*t+x, S[dmax-1, 34-x]), x=0..9)):
A106769:= select(isprime, S[dmax, 34]); # Robert Israel, Jun 03 2014
MATHEMATICA
Select[Prime[Range[50000]], Total[IntegerDigits[#]]==34 &] (* Vincenzo Librandi, Jul 08 2014 *)
PROG
(Magma) [p: p in PrimesUpTo(50000) | &+Intseq(p) eq 34]; // Vincenzo Librandi, Jul 08 2014
(PARI) select(x->sumdigits(x)==34, primes(5000)) \\ Michel Marcus, Jul 08 2014
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Zak Seidov, May 16 2005
STATUS
approved