login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A046892 Number of permutations of digits of A046891(n) that are primes. 3
0, 1, 2, 3, 4, 5, 8, 9, 10, 11, 13, 16, 18, 22, 31, 34, 37, 39, 40, 49, 52, 64, 80, 87, 93, 115, 121, 144, 149, 160, 172, 225, 233, 298, 299, 308, 384, 399, 408, 423, 475, 484, 569, 571, 738, 806, 835, 863, 934, 1247, 1413, 1525, 1739, 1775, 2282, 2303, 2325 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,3
LINKS
Michael S. Branicky, Table of n, a(n) for n = 1..91
MATHEMATICA
a = {}; b = -1; Do[c = Count[ PrimeQ[ FromDigits /@ Permutations[IntegerDigits[n]]], True]; If[c > b, b = c; a = Append[a, c]], {n, 1, 10^8}]; a
PROG
(Python)
from sympy import prime
from gmpy2 import is_prime
from sympy.utilities.iterables import multiset_permutations as mp
from itertools import count, islice, combinations_with_replacement as mc
def f(n): return sum(1 for p in mp(str(n)) if is_prime(t:=int("".join(p))))
def bgen(d):
for f in "123456789":
yield from map(int, (f+"".join(m) for m in mc("0123456789", d-1)))
def agen():
record = -1
for d in count(1):
for k in bgen(d):
v = f(k)
if v > record:
record = v
yield v
print(list(islice(agen(), 30))) # Michael S. Branicky, Feb 17 2024
CROSSREFS
Sequence in context: A047369 A004827 A155941 * A068406 A276878 A047247
KEYWORD
nonn,base
AUTHOR
STATUS
approved

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

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 25 03:15 EDT 2024. Contains 371964 sequences. (Running on oeis4.)