|
|
A046864
|
|
Smallest number whose digits sum to n-th prime.
|
|
2
|
|
|
2, 3, 5, 7, 29, 49, 89, 199, 599, 2999, 4999, 19999, 59999, 79999, 299999, 899999, 5999999, 7999999, 49999999, 89999999, 199999999, 799999999, 2999999999, 8999999999, 79999999999, 299999999999, 499999999999, 899999999999
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,1
|
|
COMMENTS
|
Every term a(n), except for 3, has the form i9...9 with k >= 0 nines, where i = 1, 2, 4, 5, 7 or 8. Indeed, {1,2,4,5,7,8} are all digits respectively prime to 9. Therefore, every prime, except for p=3, is in one of the progressions i + 9*k. On the other hand, to reach prime(n) using other digits, we need a greater number of them, which contradicts the minimality of a(n). - Vladimir Shevelev, May 07 2013
|
|
LINKS
|
|
|
EXAMPLE
|
E.g. 599 -> 5 + 9 + 9 = prime 23.
|
|
MATHEMATICA
|
sn[n_, k_] := Nest[FromDigits[Flatten[IntegerDigits[{#, 9}]]] &, n, k]; Join[Prime[Range[4]], Table[p = Prime[n]; sn[Mod[p, 9], Quotient[p, 9]], {n, 5, 28}]] (* Jayanta Basu, Jun 29 2013 *)
|
|
PROG
|
(PARI) a(n) = {my(k=1); my(p=prime(n)); while (sumdigits(k) != p, k++); k; } \\ Michel Marcus, Nov 01 2015
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,base,easy
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|