login
A067523
The smallest prime with a possible given digit sum.
5
2, 3, 13, 5, 7, 17, 19, 29, 67, 59, 79, 89, 199, 389, 499, 599, 997, 1889, 1999, 2999, 4999, 6899, 17989, 8999, 29989, 39989, 49999, 59999, 79999, 98999, 199999, 389999, 598999, 599999, 799999, 989999, 2998999, 2999999, 4999999, 6999899, 8989999
OFFSET
1,1
COMMENTS
Except for 3 no other prime has a digit sum which is a multiple of 3. Hence the possible digit sums are 2,3,4,5,7,8,10,11,13,14,16,..., etc. Conjecture: For every possible digit sum there exists a prime.
For n > 2, this is (conjecturally) the smallest prime with digit sum A001651(n). - Lekraj Beedassy, Mar 04 2009
LINKS
FORMULA
a(n) = min(prime(i): A007605(i) = A133223(i)). - R. J. Mathar, Nov 06 2018
MAPLE
g:= proc(s, d) # integers of <=d digits with sum s
local j;
if s > 9*d then return [] fi;
if d = 1 then return [s] fi;
[seq(op(map(t -> j*10^(d-1)+ t, procname(s-j, d-1))), j=0..9)];
end proc:
f:= proc(n) local d, j, x, y;
if n mod 3 = 0 then return 0 fi;
for d from ceil(n/9) do
if d = 1 then
if isprime(n) and n < 10 then return n
else next
fi fi;
for j from 1 to 9 do
for y in g(n-j, d-1) do
x:= 10^(d-1)*j + y;
if isprime(x) then return x fi;
od od od;
end proc:
f(3):= 3:
map(f, [2, 3, seq(seq(3*i+j, j=1..2), i=1..30)]); # Robert Israel, Jan 18 2024
PROG
(PARI) A067523(n)=if(n<3, n+1, A067180(n*3\/2-1)) \\ M. F. Hasler, Nov 04 2018
CROSSREFS
Cf. A001651. Equals A067180 with the 0 terms removed.
Sequence in context: A361831 A085402 A085400 * A035515 A317716 A076988
KEYWORD
base,easy,nonn
AUTHOR
Amarnath Murthy, Feb 14 2002
EXTENSIONS
More terms from Vladeta Jovovic, Feb 18 2002
Edited by Ray Chandler, Apr 24 2007
STATUS
approved