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.

A074350 Numbers n such that n and the n-th prime have the same digits.

Original entry on oeis.org

321, 1384, 1395, 2632, 3751, 4980, 5790, 6106, 6331, 6347, 6397, 6432, 6457, 6581, 6714, 6780, 6931, 7119, 7192, 7341, 7345, 7384, 7795, 7908, 8305, 8351, 8355, 9154, 9551, 10126, 10136, 10169, 10217, 10391, 10396, 10703, 12337, 12434, 12933, 13054, 13074
Offset: 1

Views

Author

Joseph L. Pe, Sep 23 2002

Keywords

Examples

			Prime(1384) = 11483 which has the same digits as 1384, so 1384 belongs to the sequence.
		

Crossrefs

Cf. A000040.

Programs

  • Mathematica
    Select[Range[10^4], Union[IntegerDigits[ # ]] == Union[IntegerDigits[Prime[ # ]]] &]
  • Python
    from sympy import nextprime
    from itertools import islice
    def agen():
        k, pk = 1, 2
        while True:
            if set(str(k)) == set(str(pk)): yield k
            k, pk = k+1, nextprime(pk)
    print(list(islice(agen(), 41))) # Michael S. Branicky, Jul 06 2022

Extensions

More terms from Vincenzo Librandi, Feb 02 2014