OFFSET
1,1
COMMENTS
a(n) is the number of terms in A028834 with n digits.
Sum of digits s in n digits is a composition of s into n parts the first of which ranges 1 to 9 and the rest 0 to 9. The number of such compositions is the coefficient of x^s in polynomial (x^1 + ... + x^9)*(x^0 + ... + x^9)^(n-1) and a(n) is the sum of those coefficients where s is prime. - Kevin Ryde, May 19 2024
a(554) is the first term for which number_of_digits(a(n)) != n. - Antoine Mathys, May 22 2024
LINKS
Antoine Mathys, Table of n, a(n) for n = 1..1000
EXAMPLE
For n=1 the a(1)=4 numbers are 2,3,5,7.
MATHEMATICA
a[n_]:=Sum[Coefficient[Sum[x^i, {i, 9}]Sum[x^i, {i, 0, 9}]^(n-1), x^i], {i, Prime[Range[PrimePi[9n]]]}]; Array[a, 21] (* Stefano Spezia, May 16 2024 *)
PROG
(PARI) a(n)=my(p=sum(i=1, 9, x^i)*sum(i=0, 9, x^i)^(n-1), s=0); forprime(q=2, 9*n, s+=polcoef(p, q)); s;
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Antoine Mathys, May 15 2024
EXTENSIONS
a(12)-a(21) from Stefano Spezia, May 16 2024
STATUS
approved