login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A166921 Least prime with exactly n prime anagrams not equal to itself. 2
2, 13, 113, 149, 1013, 1039, 1427, 1123, 1439, 1579, 1237, 10271, 10453, 10139, 10253, 10243, 10457, 11579, 10789, 10273, 11239, 12457, 10729, 13249, 12347, 13687, 12539, 14759, 13799, 10739, 12637, 12893, 23957, 13597, 100493, 12379, 14593, 101383, 13789 (list; graph; refs; listen; history; text; internal format)
OFFSET

0,1

COMMENTS

13 has only one prime anagram (31), and no smaller prime has a prime anagram other than itself, so a(1) = 13.

113 has 2 prime anagrams (131 and 311), and no smaller prime has two prime anagrams other than itself, so a(2) = 113.

149 has 3 prime anagrams (419, 491, and 941), and no smaller prime has three prime anagrams other than itself, so a(3) = 149.

LINKS

Michael S. Branicky, Table of n, a(n) for n = 0..2780 (terms 83..223 from P. CAMI and Chai Wah Wu, and terms 1..82 from P. CAMI)

Michael S. Branicky, Python program

EXAMPLE

a(7) = prime 1123 with 7 prime anagrams 1213, 1231, 1321, 2113, 2131, 2311, 3121.

PROG

(Python) # see link for faster version

from sympy import isprime

from itertools import permutations

def anagrams(n):

  s = str(n)

  return set(int("".join(p)) for p in permutations(s) if p[0] != '0')

def num_prime_anagrams(n): return sum(isprime(i) for i in anagrams(n))

def a(n):

  if n == 0: return 2

  k = 3

  while not isprime(k) or num_prime_anagrams(k) != n+1: k += 2

  return k

print([a(n) for n in range(39)]) # Michael S. Branicky, Feb 13 2021

CROSSREFS

Cf. A039986, A046810.

Sequence in context: A277469 A046888 A046890 * A046811 A046813 A208316

Adjacent sequences:  A166918 A166919 A166920 * A166922 A166923 A166924

KEYWORD

nonn,base

AUTHOR

Pierre CAMI, Oct 23 2009

EXTENSIONS

Definition edited and a(0) added by Chai Wah Wu, Dec 26 2016

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified August 5 03:00 EDT 2021. Contains 346457 sequences. (Running on oeis4.)