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!)
A065851 Let u be any string of n digits from {0,...,9}; let f(u) = number of distinct primes, not beginning with 0, formed by permuting the digits of u; then a(n) = max_u f(u). 11
1, 2, 4, 11, 39, 148, 731, 4333, 26519, 152526, 1251724 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
COMMENTS
From David A. Corneth, Jan 25 2022: (Start)
a(12) >= 7627713. a(13) >= 49545041.
There are A006879(12) = 33489857205 primes with 12 digits. There are 2.4*10^11 numbers with 12 digits that are coprime to 30 (i.e. end in 1, 3, 7, 9 and have a digital sum not divisible by 3).
On average one in 2.4*10^11/33489857205 ~= 7.166 of these numbers with 12 digits is prime.
Let maxqprimes(d) be the number of permutations of digits of d without leading 0 and ending in 1, 3, 7 or 9.
Let qprimes(d) be the number of permutations of digits of d (without leading 0 and ending in 1, 3, 7 or 9) that are prime.
a(12) = 7627713 if for some number with 12 digits we have maxprimes(d)/qprimes(d) < 5 (found via a brute force check). This is much less than the expected 7.166.
(At least) 101233456789 with 12 digits has maxqprimes(101233456789) = 54432000. This d = 101233456789 has a shared record for largest value for maxqprimes(d), along with d in {101234567789, 101234567899, 102334567789, 102345677899}. This gives maxqprimes(101233456789)/qprimes(101233456789) ~= 7.136, close to the expected 7.166.
The values d that have maxqprimes(d) >= 5*7627713 all have maxqprimes(d)/qprimes(d) >= 7.13.
For a(12) there are 2.4*10^11 checks needed if we do not use the found bound of 7627713. If we do we can bring down the search space by a factor of about 4 (without any heuristic). If we increase to 7*7627713 we only have about 9*10^8 needed checks left to do. (End)
LINKS
EXAMPLE
a(2) = 2 because 13 and 31 are primes.
a(3) = 4 because {149, 419, 491, 941} or {179, 197, 719, 971} or {379, 397, 739, 937} are primes. - R. J. Mathar, Apr 23 2016
MATHEMATICA
c[x_] := Module[{},
Length[Select[Permutations[x],
First[#] != 0 && PrimeQ[FromDigits[#, 10]] &]]];
A065851[n_] := Module[{i},
Return[Max[Map[c, DeleteDuplicatesBy[Tuples[Range[0, 9], n],
Table[Count[#, i], {i, 0, 9}] &]]]]];
Table[A065851[n], {n, 1, 6}] (* Robert Price, Mar 30 2019 *)
PROG
(Python)
from sympy import isprime
from itertools import combinations_with_replacement
from sympy.utilities.iterables import multiset_permutations
def a(n): return max(sum(1 for p in multiset_permutations(u) if p[0] != "0" and isprime(int("".join(p)))) for u in combinations_with_replacement("0123456789", n) if sum(int(ui) for ui in u)%3)
print([a(n) for n in range(1, 7)]) # Michael S. Branicky, Jan 24 2022
CROSSREFS
Sequence in context: A101898 A193188 A216810 * A173938 A242790 A013044
KEYWORD
nonn,base,more
AUTHOR
Sascha Kurz, Nov 24 2001
EXTENSIONS
1 more term from Sean A. Irvine, Sep 06 2009
Definition corrected by David A. Corneth, Apr 23 2016
a(11) from David A. Corneth, Jan 25 2022
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 19 11:31 EDT 2024. Contains 371792 sequences. (Running on oeis4.)