A074350 Numbers n such that n and the n-th prime have the same digits.
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
Examples
Prime(1384) = 11483 which has the same digits as 1384, so 1384 belongs to the sequence.
Links
- Michael S. Branicky, Table of n, a(n) for n = 1..10000 (terms 1..1000 from Vincenzo Librandi)
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