%I #17 Mar 18 2021 18:00:49
%S 3,8,39,269,3047,14288,140205,1567591,10764655
%N Number of primes with prime length names in range 1 -> 10^n.
%C This sequence uses "and" (e.g., "one hundred and one") and does not count spaces, commas, or hyphens. - _Michael S. Branicky_, Mar 08 2021
%H Sean A. Irvine, <a href="https://github.com/archmageirvine/joeis/blob/master/src/irvine/oeis/a072/A072687.java">Java program</a> (github)
%e E.g., from the sequence of the valid primes (A072686) there are three prime-length primes between 1 and 10: 2,3,7; therefore a(1)=3.
%e 23 ("twentythree", 11 letters) and 109 ("one hundred and nine", 17 letters) are counted.
%o (Python)
%o from num2words import num2words
%o from sympy import isprime, primerange
%o def n2w(n):
%o return num2words(n).replace(",", "").replace(" ", "").replace("-", "")
%o def a(n): return sum(isprime(len(n2w(p))) for p in primerange(2, 10**n))
%o print([a(n) for n in range(1, 7)]) # _Michael S. Branicky_, Mar 08 2021
%Y Cf. A072686.
%K more,nonn,word
%O 1,1
%A Mark Hudson (mrmarkhudson(AT)hotmail.com), Jul 02 2002
%E a(6)-a(8) from _Sean A. Irvine_, Nov 08 2011
%E a(8) corrected by _Sean A. Irvine_, Apr 28 2019
%E a(8) corrected and a(9) from _Michael S. Branicky_, Mar 08 2021
|