A083427 Smallest prime which is a concatenation of n distinct primes.
2, 23, 257, 2357, 112573, 11132357, 1113223537, 111317193257, 11131719223357, 1113171922335437, 111317192232934157, 11131719223293135773, 1113171922329313375759, 111317192232931337415743, 11131719223293133741435717
Offset: 1
Examples
a(5) = 112573 is a concatenation of 11,2,5,7 and 3 and is the smallest such prime. a(7) <= 1113223537 = 11//13//2//23//5//3//7. - _R. J. Mathar_, Mar 19 2011 a(8) <= 111317193257 = 11//13//17//19//3//2//5//7. - _Jonathan Vos Post_, Mar 20 2006 a(9) <= 11131719223357 = 11//13//17//19//2//23//3//5//7. - _R. J. Mathar_, Mar 19 2011
Crossrefs
Cf. A000040.
Programs
-
Sage
concat = lambda x: Integer(''.join(str(i) for i in x),base=10) def A083427(n): def primelists(sofar, widths): if not widths: yield sofar; return w = widths[0] for p in prime_range(10**(w-1), 10**w): if p not in sofar: for pv in primelists(sofar+[p], widths[1:]): yield pv for numdig in PositiveIntegers(): least = None for part in Partitions(numdig, length=n): if list(part).count(1) > 4: continue # optimization for sizes in Permutations(part): for plist in primelists([], sizes): x = concat(plist) if is_prime(x): least = min(x, least) if least else x # since x is increasing in this inner loop, # no need to continue if we can't improve if least and x >= least: break if least: return least # D. S. McNeil, Mar 20 2011
Extensions
a(7), a(8) from Jonathan Vos Post, Mar 20 2006
a(7) corrected by Emmanuel Vantieghem, Mar 19 2011
a(8) deleted on grounds that it is quite likely to be wrong. - N. J. A. Sloane, Mar 19 2011
a(7)-a(15) from D. S. McNeil, Mar 20 2011