login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A069661
Smallest n-digit prime with maximum digit sum.
14
7, 89, 997, 8999, 98999, 989999, 9899999, 89999999, 998999999, 9899989999, 98999999999, 999998999999, 8998999999999, 99899999999999, 999999899999999, 9998999999999999, 99999999999899999, 999998999999999999, 9998999999999999999, 89999999999999999999
OFFSET
1,1
MATHEMATICA
Table[max=0; Do[p=Prime[i]; If[Total[IntegerDigits[p]] > Total[IntegerDigits[max]], max=p], {i, PrimePi[10^n]+1, PrimePi[10^(n+1)]}]; max, {n, 0, 7}] (* Jayanta Basu, May 19 2013 *)
CROSSREFS
a(n) = A069662(n) for these n <= 20: 1, 2, 3, 4, 6, 7, 9, 17 and 19. a(5) = Reverse(A069662(5)).
Sequence in context: A107109 A089771 A249448 * A069662 A359646 A371386
KEYWORD
nonn,base
AUTHOR
Amarnath Murthy, Apr 05 2002
EXTENSIONS
Corrected and extended by Rick L. Shepherd, Jul 15 2002. a(5) through a(20) have been certified prime with Primo.
STATUS
approved