A306572 Numbers k whose decimal representation ends with that of pi(k) (where pi denotes the prime counting function A000720).
16, 17, 132, 254, 374, 494, 1196, 2348, 3487, 4624, 5757, 6886, 11373, 22517, 33597, 44639, 55646, 66644, 77629, 88580, 99550, 99551, 110486, 219572, 328268, 436699, 544946, 653052, 761059, 869024, 976855, 1084604, 1192399, 2159962, 3232398, 4303026, 4303027
Offset: 1
Examples
There are 7 prime numbers <= 17, and 17 ends with 7, hence 17 is a term. There are 13 prime numbers <= 42, and 42 does not end with 13, hence 42 is not a term.
Links
- Chai Wah Wu, Table of n, a(n) for n = 1..310
Programs
-
Mathematica
Select[Range[2, 10^6], Mod[#1, 10^(1 + Floor@ Log10[#2])] == #2 & @@ {#, PrimePi@ #} &] (* Michael De Vlieger, Apr 06 2021 *)
-
PARI
pi=0; for (n=1, 4303027, if (n%10^max(1,#digits(pi+=isprime(n)))==pi, print1 (n ", ")))
-
Python
from sympy import primepi A306572_list = [n for n, p in enumerate(primepi(k) for k in range(10**4)) if n > 0 and n % 10**len(str(p)) == p] # Chai Wah Wu, Apr 06 2021
Comments