OFFSET
1,1
COMMENTS
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.
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
KEYWORD
nonn,base
AUTHOR
Felix Fröhlich, Feb 28 2018
EXTENSIONS
More terms from Alois P. Heinz, Feb 28 2018
STATUS
approved