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!)
A113030 Largest prime arising that can be formed by stringing together the decimal expansions of some or all of the first n numbers in some order. 0
2, 31, 4231, 5431, 65423, 7652413, 8765423, 98765431, 10987653421, 111098765423, 12111098765413, 13121110987654231, 141312111098765213, 15141312111098763241, 16151413121110987654213, 171615141312111098764523 (list; graph; refs; listen; history; text; internal format)
OFFSET
2,1
LINKS
EXAMPLE
a(3) = 31 as 321 or any other three digit permutation is not a prime and 23 < 31. Any permutation of all or a few of the first five numbers 1,2,3,4,5,gives the largest prime 5431. Hence a(5) = 5431.
MATHEMATICA
for 4<n<20 (* first do *) Needs["DiscreteMath`Combinatorica`"] (* then *) f[n_] := Block[{a = Flatten@IntegerDigits@Range[n, 6, -1], b = Flatten[ Permutations /@ Flatten[ Table[ KSubsets[ Range@5, i], {i, 5}], 1], 1], t = {}}, Do[AppendTo[t, Join[a, b[[k]] ]], {k, 325}]; Max@Select[FromDigits /@ t, PrimeQ[ # ] &]]; Table[ f[n], {n, 5, 18}] (* Robert G. Wilson v *)
CROSSREFS
Sequence in context: A350940 A244441 A004072 * A247873 A281901 A357176
KEYWORD
base,nonn
AUTHOR
Amarnath Murthy, Jan 03 2006
EXTENSIONS
a(7)-a(18) from Robert G. Wilson v, Jan 11 2006
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 March 19 04:58 EDT 2024. Contains 370952 sequences. (Running on oeis4.)