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.
%I A083427 #27 Mar 04 2020 16:55:20 %S A083427 2,23,257,2357,112573,11132357,1113223537,111317193257,11131719223357, %T A083427 1113171922335437,111317192232934157,11131719223293135773, %U A083427 1113171922329313375759,111317192232931337415743,11131719223293133741435717 %N A083427 Smallest prime which is a concatenation of n distinct primes. %e A083427 a(5) = 112573 is a concatenation of 11,2,5,7 and 3 and is the smallest such prime. %e A083427 a(7) <= 1113223537 = 11//13//2//23//5//3//7. - _R. J. Mathar_, Mar 19 2011 %e A083427 a(8) <= 111317193257 = 11//13//17//19//3//2//5//7. - _Jonathan Vos Post_, Mar 20 2006 %e A083427 a(9) <= 11131719223357 = 11//13//17//19//2//23//3//5//7. - _R. J. Mathar_, Mar 19 2011 %o A083427 (Sage) %o A083427 concat = lambda x: Integer(''.join(str(i) for i in x),base=10) %o A083427 def A083427(n): %o A083427 def primelists(sofar, widths): %o A083427 if not widths: yield sofar; return %o A083427 w = widths[0] %o A083427 for p in prime_range(10**(w-1), 10**w): %o A083427 if p not in sofar: %o A083427 for pv in primelists(sofar+[p], widths[1:]): %o A083427 yield pv %o A083427 for numdig in PositiveIntegers(): %o A083427 least = None %o A083427 for part in Partitions(numdig, length=n): %o A083427 if list(part).count(1) > 4: continue # optimization %o A083427 for sizes in Permutations(part): %o A083427 for plist in primelists([], sizes): %o A083427 x = concat(plist) %o A083427 if is_prime(x): least = min(x, least) if least else x %o A083427 # since x is increasing in this inner loop, %o A083427 # no need to continue if we can't improve %o A083427 if least and x >= least: break %o A083427 if least: return least # _D. S. McNeil_, Mar 20 2011 %Y A083427 Cf. A000040. %K A083427 base,more,nonn %O A083427 1,1 %A A083427 _Amarnath Murthy_ and Meenakshi Srikanth (menakan_s(AT)yahoo.com), Apr 29 2003 %E A083427 a(7), a(8) from _Jonathan Vos Post_, Mar 20 2006 %E A083427 a(7) corrected by _Emmanuel Vantieghem_, Mar 19 2011 %E A083427 a(8) deleted on grounds that it is quite likely to be wrong. - _N. J. A. Sloane_, Mar 19 2011 %E A083427 a(7)-a(15) from _D. S. McNeil_, Mar 20 2011