cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

Showing 1-1 of 1 results.

A300186 Largest digit sum among all n-digit primes.

Original entry on oeis.org

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
Offset: 1

Views

Author

Felix Fröhlich, Feb 28 2018

Keywords

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.

Examples

			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.
		

Crossrefs

Programs

  • PARI
    a(n) = my(r=0); forprime(p=10^(n-1), 10^n, if(sumdigits(p) > r, r=sumdigits(p))); r

Extensions

More terms from Alois P. Heinz, Feb 28 2018
Showing 1-1 of 1 results.