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.
%I A346274 #42 Aug 06 2021 05:53:42 %S A346274 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, %T A346274 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, %U A346274 0,2,2,0,1,3,0,0,3,0,1,3,0,2,8,0,1,3,0 %N A346274 Number of n-digit primes with digital product = 7. %C A346274 Equivalently: Number of n-digit terms of A107693 that are primes. %C A346274 This sequence is inspired by the 1st problem, submitted by USSR during the 31st International Mathematical Olympiad in 1990 at Beijing, but not used for the competition. %C A346274 The problem was: Consider the n-digit numbers consisting of one '7' and n-1 '1'. For what values of n are all these numbers prime? %C A346274 a(n) = n iff n = 1 or n = 2 (this is the answer to the Olympiad problem). %C A346274 a(n) < n for n >= 3 <=> for n >= 3, there is always at least one composite number among the n-digit numbers with digital product = 7. %C A346274 Steps of the proof by disjunction elimination (proof in Derek Holton in reference): %C A346274 -> If n = 3*k, k>0, a(n) = 0 because the n-digit numbers with digital product = 7 are then divisible by 3. %C A346274 -> If n = 4, 1117 and 1171 are primes, but 1711 = 29 * 59 and 7111 = 13 * 547; hence a(4) = 2 < 4. %C A346274 -> If n > 4 and n <> 3k, there is always at least one n-digit number that is divisible by 7, these composites are in A346276. %C A346274 Also, a(n) = 0 for n = 14, 16, 38, 41, 76, 104, 107, 110, 128, 134, 146, 152, 155, 164, 166, 178, 185, ... (comes from b-file in A107693). %D A346274 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. %H A346274 Michael S. Branicky, <a href="/A346274/b346274.txt">Table of n, a(n) for n = 1..1000</a> %H A346274 <a href="/index/O#Olympiads">Index to sequences related to Olympiads</a>. %F A346274 a(3*k) = 0 for k >= 1. %e A346274 7 is prime, hence a(1) = 1. %e A346274 17 and 71 are primes, hence a(2) = 2. %e A346274 1117 and 1171 are primes, but 1711 = 29 * 59 and 7111 = 13 * 547; hence a(4) = 2. %t A346274 a[n_] := Count[(10^n - 1)/9 + 6*10^Range[0, n - 1], _?PrimeQ]; Array[a, 100] (* _Amiram Eldar_, Jul 12 2021 *) %o A346274 (PARI) a(n) = {my(s = 10^n\9); sum(i = 0, n-1, isprime(s + 6*10^i))} \\ _David A. Corneth_, Jul 12 2021 %o A346274 (Python) %o A346274 from sympy import isprime %o A346274 def a(n): %o A346274 return sum(isprime(int('1'*(n-1-i) + '7' + '1'*i)) for i in range(n)) %o A346274 print([a(n) for n in range(1, 88)]) # _Michael S. Branicky_, Jul 12 2021 %Y A346274 Cf. A107693, A346276. %K A346274 nonn,base %O A346274 1,2 %A A346274 _Bernard Schott_, Jul 12 2021