OFFSET
1,1
LINKS
Jaroslav Krizek, Table of n, a(n) for n = 1..1000
MAPLE
S:= proc(d, k, flag) option remember;
if d = 1 then
if k >= 0 and k <= 9 then return [k]
else return []
fi
fi;
[seq(op(map(`+`, procname(d-1, k-i, 0), i*10^(d-1))), i=flag..min(k, 9))]
end proc:
seq(op(select(isprime, S(d, 2*d, 1))), d=1..5); # Robert Israel, Apr 23 2017
MATHEMATICA
Select[Prime[Range[1600]], Mean[IntegerDigits[#]]==2&] (* Harvey P. Dale, Aug 07 2021 *)
PROG
(Magma) [n: n in [1..100000] | IsPrime(n) and &+Intseq(n) mod #Intseq(n) eq 0 and &+Intseq(n) / #Intseq(n) eq 2]
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Jaroslav Krizek, Apr 16 2017
STATUS
approved