OFFSET
1,1
COMMENTS
This sequence contains the automorphic primes (A046883).
If p is an automorphic prime, then p-1 is a term of the sequence.
LINKS
Chai Wah Wu, Table of n, a(n) for n = 1..310
EXAMPLE
There are 7 prime numbers <= 17, and 17 ends with 7, hence 17 is a term.
There are 13 primes numbers <= 42, and 42 does not end with 13, hence 42 is not a term.
MATHEMATICA
Select[Range[2, 10^6], Mod[#1, 10^(1 + Floor@ Log10[#2])] == #2 & @@ {#, PrimePi@ #} &] (* Michael De Vlieger, Apr 06 2021 *)
PROG
(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
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Rémy Sigrist, Feb 24 2019
STATUS
approved