login
a = a(n) is such that the a-th prime p(a) is the least prime with digital sum equal to n, or a(n)=0 if no such prime exists.
1

%I #5 Mar 30 2012 17:26:11

%S 0,1,2,6,3,0,4,7,0,8,10,0,19,17,0,22,24,0,46,77,0,95,109,0,168,290,0,

%T 303,430,0,669,887,0,2064,1117,0,3245,4203,0,5133,6057,0,7837,9505,0,

%U 17984,33067,0,49025,49098,0,63951,77777,0,216751,216816,0,348513

%N a = a(n) is such that the a-th prime p(a) is the least prime with digital sum equal to n, or a(n)=0 if no such prime exists.

%C a(1)=0 because there is no prime with digital sum equal to 1, a(2)=1 because p(1)=2 is the least prime with digital sum equal to 2, a(3)=2 because p(2)=3 the only prime with digital sum equal to 3, a(3k>3)=0 because there is no prime with digital sum equal to 3 (besides p(2)=3), a(53)=77777 because p(77777)=989999 is the least prime with digital sum (9+8+9+9+9+9) equal to 53. For the first 1,000,000 primes, the maximal digital sum is 62 (for p(658445)=9899999).

%t ta=Table[Plus@@IntegerDigits[Prime[i]], {i, 1000000}]; A104290={0, 1, 2, Table[If[Mod[k, 3]==0, 0, Position[ta, k][[1]]], {k, 4, 54}]}//Flatten

%K nonn,base

%O 1,3

%A _Zak Seidov_, Feb 28 2005