OFFSET
1,2
COMMENTS
For the values k = 0, 51, 712, 8010, 8201, 9711 the multisets of digits are the same as the multisets of digits of primepi(k). Are there other such integers?
No. As prime(n) >= n*(log(n) + log(log(n)) - 1) and log(n) > 10 for n >= 22027 with some additional search these are all such integers. - David A. Corneth, Jul 06 2022
LINKS
David A. Corneth, Table of n, a(n) for n = 1..10000 (first 1846 terms from Michel Marcus)
EXAMPLE
There are 15 primes <= 51, so 51 is a term.
There are 180 primes <= 1080, so 1080 is a term.
There are 321 primes <= 2131 (a prime), so 2131 is a term.
MAPLE
q:= n-> (s-> is(s(n)=s(numtheory[pi](n))))({k-> convert(k, base, 10)[]}):
select(q, [$0..15000])[]; # Alois P. Heinz, Jul 06 2022
MATHEMATICA
d[n_] := Union[IntegerDigits[n]]; Select[Range[0, 12500], d[#] == d[PrimePi[#]] &] (* Amiram Eldar, Jul 06 2022 *)
PROG
(PARI) digs(k) = Set(digits(k));
isok(k) = digs(k) == digs(primepi(k));
(PARI) upto(n) = { my(u = nextprime(n), p = 2, t = 0, res = List(0)); forprime(q = 3, u, t++; st = Set(digits(t)); for(i = p, q-1, si = Set(digits(i)); if(si == st, listput(res, i); ) ); p = q; ); res } \\ David A. Corneth, Jul 07 2022
(Python)
from sympy import primepi
def ok(n): return set(str(n)) == set(str(primepi(n)))
print([k for k in range(13000) if ok(k)]) # Michael S. Branicky, Jul 06 2022
(Python)
from itertools import count, islice
from sympy import nextprime
def A355418_gen(): # generator of terms
p, q = 0, 2
for i in count(0):
s = set(str(i))
yield from filter(lambda n:set(str(n))==s, range(p, q))
p, q = q, nextprime(q)
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Michel Marcus, Jul 06 2022
STATUS
approved