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.

A372897 Count of n-digit numbers whose sum of digits is a prime.

Original entry on oeis.org

4, 33, 303, 2670, 23741, 222638, 2211826, 22325173, 220321667, 2128051302, 20606839279, 203631013986, 2048538361591, 20655036405780, 205672896661755, 2012878671315492, 19505453673514959, 190027534666354756, 1884928265282803982, 19032829919297816897, 193085599933330233795
Offset: 1

Views

Author

Antoine Mathys, May 15 2024

Keywords

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

Examples

			For n=1 the a(1)=4 numbers are 2,3,5,7.
		

Crossrefs

Programs

  • 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 *)
  • 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;

Extensions

a(12)-a(21) from Stefano Spezia, May 16 2024