cp's OEIS Frontend

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.

A306572 Numbers k whose decimal representation ends with that of pi(k) (where pi denotes the prime counting function A000720).

Original entry on oeis.org

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

Views

Author

Rémy Sigrist, Feb 24 2019

Keywords

Comments

This sequence contains the automorphic primes (A046883).
If p is an automorphic prime, then p-1 is a term of the sequence.

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.
		

Crossrefs

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