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.

A046890 a(n) is the least integer that has exactly n anagrams that are primes.

This page as a plain text file.
%I A046890 #26 Jul 08 2024 10:39:04
%S A046890 1,2,13,113,149,1013,1039,1247,1123,1349,1579,1237,10127,10238,10139,
%T A046890 10235,10234,10457,11579,10789,10237,11239,12457,10279,12349,12347,
%U A046890 13678,12359,14579,13489,10379,12367,12389,23579,13579,100349,12379
%N A046890 a(n) is the least integer that has exactly n anagrams that are primes.
%C A046890 An anagram is a permutation of digits not beginning with 0.
%H A046890 Michael S. Branicky, <a href="/A046890/b046890.txt">Table of n, a(n) for n = 0..8004</a> (search of numbers with <= 12 digits; terms 0..511 from Chai Wah Wu)
%t A046890 ap[n_] := Count[FromDigits /@ Select[Permutations[IntegerDigits[n]], First[#] != 0 &], _?PrimeQ]; t = {1}; Do[i = 1; While[ap[i] != n, i++]; AppendTo[t, i], {n, 30}]; t (* _Jayanta Basu_, Jun 29 2013 *)
%o A046890 (Python)
%o A046890 from sympy import isprime
%o A046890 from sympy.utilities.iterables import multiset_permutations as mp
%o A046890 from itertools import count, islice, combinations_with_replacement as mc
%o A046890 def nd(d): yield from ("".join((f,)+m) for f in "123456789" for m in mc("0123456789", d-1))
%o A046890 def c(s): return sum(1 for p in mp(s) if p[0]!="0" and isprime(int("".join(p))))
%o A046890 def agen(): # generator of sequence terms
%o A046890     n, adict = 0, dict()
%o A046890     for digs in count(1):
%o A046890         for s in nd(digs):
%o A046890             v = c(s)
%o A046890             if v not in adict: adict[v] = int(s)
%o A046890             while n in adict: yield adict[n]; n += 1
%o A046890 print(list(islice(agen(), 40))) # _Michael S. Branicky_, Feb 08 2023
%Y A046890 Cf. A046810.
%K A046890 nonn,base
%O A046890 0,2
%A A046890 _David W. Wilson_