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.

Showing 1-3 of 3 results.

A243355 Numbers n such that n and prime(n) have no common digits.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 8, 9, 10, 12, 15, 16, 17, 19, 20, 21, 22, 24, 25, 26, 27, 28, 35, 36, 39, 40, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 53, 57, 58, 59, 60, 61, 64, 65, 66, 67, 68, 69, 70, 71, 72, 76, 77, 79, 85, 86, 87, 88, 89, 90, 91, 93, 96, 98, 99, 101
Offset: 1

Views

Author

Colin Barker, Jun 03 2014

Keywords

Examples

			98 is in the sequence because prime(98) = 521, which has no digits in common with 98.
		

Crossrefs

Cf. A000040, A074350, A119393 (complement).

Programs

  • Haskell
    import Data.List (intersect)
    a243355 n = a243355_list !! (n-1)
    a243355_list = filter
       (\x -> null $ show x `intersect` (show $ a000040 x)) [1..]
    -- Reinhard Zumkeller, Sep 14 2014
  • Mathematica
    Select[Range[110],Intersection[IntegerDigits[#],IntegerDigits[Prime[#]]]=={}&] (* Harvey P. Dale, Aug 11 2023 *)
  • PARI
    s=[]; for(n=1, 300, if(setintersect(vecsort(digits(n),,8), vecsort(digits(prime(n)),,8))==[], s=concat(s, n))); s
    

A355418 Numbers k that have the same set of digits in base 10 as primepi(k).

Original entry on oeis.org

0, 51, 494, 712, 1017, 1080, 1081, 1196, 1828, 2131, 2132, 2133, 2994, 3885, 4622, 4624, 4626, 5700, 5733, 5735, 5755, 5757, 5775, 5777, 6681, 6886, 6888, 7179, 7696, 7697, 7798, 8010, 8100, 8201, 9193, 9691, 9711, 9717, 11263, 11371, 11373, 11377, 11483, 11593, 12418, 12499
Offset: 1

Views

Author

Michel Marcus, Jul 06 2022

Keywords

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

Examples

			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.
		

Crossrefs

Cf. A000720 (primepi), A074350, A355317.

Programs

  • 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 *)
  • 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)
    A355418_list = list(islice(A355418_gen(),30)) # Chai Wah Wu, Jul 06 2022

A086691 Numbers n such that all of {n, pi(n), prime(n)} have the same decimal digits (ignoring multiplicity).

Original entry on oeis.org

152024, 1331302, 1654692, 1665259, 2498121, 2498182, 3539725, 3767628, 4880306, 5372892, 5372899, 5589360, 8754741, 9011136, 9023611, 9023613, 9023616, 9136605, 9136630, 9136660, 9194561, 9196454, 9412864, 9462431, 9749651
Offset: 1

Views

Author

Labos Elemer, Sep 12 2003

Keywords

Examples

			n=5589360: {pi(n), n, prime(n)} = {386509, 5589360, 96830533} with digits= {0, 3, 5, 6, 8, 9}.
		

Crossrefs

Programs

  • Mathematica
    uid[x_] := Union[IntegerDigits[x]] Do[If[Equal[uid[n], uid[Prime[n]]]&&, Equal[uid[n], uid[PrimePi[n]]] Print[{PrimePi[n], n, Prime[n]}]], {n, 1, 10000}]

Extensions

More terms from Ryan Propper, Sep 23 2006
Showing 1-3 of 3 results.