A120533 Primes having a prime number of digits.
11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283
Offset: 1
Examples
10007 is a 5-digit prime and so belongs to the sequence.
Links
- Jeppe Stig Nielsen, Table of n, a(n) for n = 1..10000
Programs
-
Mathematica
Table[Prime[Range[PrimePi[10^(p-1)]+1,PrimePi[10^p]]],{p,Prime[Range[ 3]]}]//Flatten (* Harvey P. Dale, Nov 02 2020 *)
-
PARI
g(n) = forprime(x=11,n,if(isprime(length(Str(x))),print1(x",")))
-
PARI
forprime(p=2,5,forprime(q=10^(p-1),10^p,print1(q", "))) \\ Charles R Greathouse IV, Oct 04 2011
-
Python
from itertools import islice from sympy import isprime, nextprime def agen(): # generator of terms d = 2 while True: yield from (i for i in range(10**(d-1)+1, 10**d, 2) if isprime(i)) d = nextprime(d) print(list(islice(agen(), 57))) # Michael S. Branicky, Dec 27 2023
-
Python
from sympy import primepi, primerange def A272441(n): def bisection(f,kmin=0,kmax=1): while f(kmax) > kmax: kmax <<= 1 kmin = kmax >> 1 while kmax-kmin > 1: kmid = kmax+kmin>>1 if f(kmid) <= kmid: kmax = kmid else: kmin = kmid return kmax def f(x): return n+x-sum(primepi(min(x,(1<Chai Wah Wu, Feb 03 2025
Extensions
Edited by N. J. A. Sloane at the suggestion of Andrew S. Plewe, May 21 2007
Comments