login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A300186 Largest digit sum among all n-digit primes. 0
7, 17, 25, 35, 44, 53, 62, 71, 80, 88, 98, 107, 115, 125, 134, 143, 152, 161, 170, 179, 188, 197, 206, 215, 223, 233, 242, 250, 260, 269, 278, 287, 296, 304, 314, 323, 332, 341, 350, 359, 367, 377, 386, 394, 404, 413, 421, 431, 440, 449, 458, 466, 476, 485, 494 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
COMMENTS
Largest value of A007605(x) for any integer x in the interval [A090226(n), A090226(n+1)-1].
Trivially, 1 < a(n) < 9*n = A008591(n). The lower bound follows, since a prime > 10 must contain at least two nonzero digits, with the least possible digit sum 2. The upper bound follows because 10^n-1 is always composite and thus the digit sum can be at most A017257(n-1). The maximal possible value is reached by a(n) iff a term t exists in A263431 such that A055642(t) = n-1.
LINKS
EXAMPLE
For n = 2: Among all 2-digit primes, the largest possible digit sum is 8+9 = 17, which is achieved by the prime 89, so a(2) = 17.
PROG
(PARI) a(n) = my(r=0); forprime(p=10^(n-1), 10^n, if(sumdigits(p) > r, r=sumdigits(p))); r
CROSSREFS
Sequence in context: A072199 A309231 A183897 * A355680 A354672 A261934
KEYWORD
nonn,base
AUTHOR
Felix Fröhlich, Feb 28 2018
EXTENSIONS
More terms from Alois P. Heinz, Feb 28 2018
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 19 09:23 EDT 2024. Contains 371782 sequences. (Running on oeis4.)