A346274 Number of n-digit primes with digital product = 7.
1, 2, 0, 2, 2, 0, 3, 3, 0, 2, 1, 0, 1, 0, 0, 0, 2, 0, 3, 1, 0, 3, 1, 0, 2, 1, 0, 2, 3, 0, 2, 1, 0, 2, 2, 0, 3, 0, 0, 3, 0, 0, 2, 1, 0, 3, 3, 0, 4, 4, 0, 1, 2, 0, 4, 2, 0, 1, 2, 0, 1, 2, 0, 3, 3, 0, 2, 1, 0, 2, 2, 0, 1, 3, 0, 0, 3, 0, 1, 3, 0, 2, 8, 0, 1, 3, 0
Offset: 1
Examples
7 is prime, hence a(1) = 1. 17 and 71 are primes, hence a(2) = 2. 1117 and 1171 are primes, but 1711 = 29 * 59 and 7111 = 13 * 547; hence a(4) = 2.
References
- Derek Holton, A Second Step to Mathematical Olympiad Problems, Vol. 7, Mathematical Olympiad Series, World Scientific, 2011, Section 8.2. USS 1 p. 260 and Section 8.14 Solutions pp 284-287.
Links
- Michael S. Branicky, Table of n, a(n) for n = 1..1000
- Index to sequences related to Olympiads.
Programs
-
Mathematica
a[n_] := Count[(10^n - 1)/9 + 6*10^Range[0, n - 1], ?PrimeQ]; Array[a, 100] (* _Amiram Eldar, Jul 12 2021 *)
-
PARI
a(n) = {my(s = 10^n\9); sum(i = 0, n-1, isprime(s + 6*10^i))} \\ David A. Corneth, Jul 12 2021
-
Python
from sympy import isprime def a(n): return sum(isprime(int('1'*(n-1-i) + '7' + '1'*i)) for i in range(n)) print([a(n) for n in range(1, 88)]) # Michael S. Branicky, Jul 12 2021
Formula
a(3*k) = 0 for k >= 1.
Comments