A383780 a(n) is the number of n-digit terms in A383779.
4, 12, 46, 103, 396, 717, 2451, 3929, 11803, 17202, 46916, 62668, 157138, 197114, 458064, 541267, 1180018, 1323543, 2718398, 2915696, 5675113, 5839596, 10821575, 10724938, 18983655, 18174231, 30856021, 28608908, 46708476, 42036009, 66157433, 57908390, 88020231, 75070514
Offset: 1
Links
- Michael S. Branicky, Table of n, a(n) for n = 1..115
Crossrefs
Cf. A383779.
Programs
-
Mathematica
Unprotect[CompositeQ]; CompositeQ[1]:=True; Protect[CompositeQ]; Q[n_]:=And[AllTrue[FromDigits/@Table[Take[IntegerDigits[n], i], {i,IntegerLength[n],1,-2}], PrimeQ], AllTrue[FromDigits/@Table[Take[IntegerDigits[n], i], {i,IntegerLength[ n]-1,1,-2}], CompositeQ]]; a[n_]:=Module[{p=Prime[PrimePi[10^(n-1)]+1], k=0}, While[10^(n-1)<=p<10^n-1, If[Q[p], k++]; p=NextPrime[p]]; k]; Array[a,7]
-
Python
from gmpy2 import is_prime, mpz from itertools import count, islice def agen(): olst, elst = [2, 3, 5, 7], [11, 13, 17, 19, 41, 43, 47, 61, 67, 83, 89, 97] yield from (len(olst), len(elst)) for n in count(1): olst2, elst2 = [], [] for o in olst: for i in range(1, 100, 2): t = 100*o + i if is_prime(t) and not is_prime(t//10): olst2.append(t) yield len(olst2) for e in elst: for i in range(100): t = 100*e + i if is_prime(t) and not is_prime(t//10): elst2.append(t) yield len(elst2) olst, elst = olst2, elst2 print(list(islice(agen(), 16))) # Michael S. Branicky, May 11 2025
Extensions
a(12) and beyond from Michael S. Branicky, May 11 2025
Comments