A346275 Number of n-digit primes with digital product = 3.
1, 2, 3, 0, 3, 3, 0, 4, 4, 0, 5, 2, 0, 1, 0, 0, 1, 2, 0, 3, 1, 0, 2, 1, 0, 0, 1, 0, 4, 3, 0, 0, 1, 0, 4, 3, 0, 1, 6, 0, 0, 4, 0, 2, 1, 0, 2, 6, 0, 2, 2, 0, 5, 3, 0, 4, 3, 0, 3, 1, 0, 1, 3, 0, 1, 4, 0, 0, 2, 0, 3, 4, 0, 4, 1, 0, 2, 4, 0, 3, 2, 0, 1, 6, 0, 2, 3, 0, 3, 4, 0
Offset: 1
Examples
3 is prime, hence a(1) = 1. 13 and 31 are primes, hence a(2) = 2. 11113, 11131, 11311 are primes, but 13111 = 7*1873 and 31111 = 53*587, hence a(5) = 3.
References
- Derek Holton, A Second Step to Mathematical Olympiad Problems, Vol. 7, Mathematical Olympiad Series, World Scientific, 2011, Section 8.14 - 69, page 287.
Programs
-
Mathematica
a[n_] := Count[(10^n - 1)/9 + 2*10^Range[0, n - 1], ?PrimeQ]; Array[a, 100] (* _Amiram Eldar, Jul 13 2021 *)
-
Python
from sympy import isprime def a(n): return sum(isprime(int('1'*(n-1-i)+'3'+'1'*i)) for i in range(n)) print([a(n) for n in range(1, 92)]) # Michael S. Branicky, Jul 13 2021
Formula
a(3*k+1) = 0 for k > 0.
Comments