Logo

Greetings from The On-Line Encyclopedia of Integer Sequences!

Hints

Search: id:A113030
Displaying 1-1 of 1 results found. page 1
     Format: long | short | internal | text      Sort: relevance | references | number      Highlight: on | off
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
1
2, 31, 4231, 5431, 65423, 7652413, 8765423, 98765431, 10987653421, 111098765423, 12111098765413, 13121110987654231, 141312111098765213, 15141312111098763241, 16151413121110987654213, 171615141312111098764523 (list; graph; listen)
OFFSET

2,1

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: A010789 A134646 A004072 this_sequence A030001 A018802 A004842

Adjacent sequences: A113027 A113028 A113029 this_sequence A113031 A113032 A113033

KEYWORD

base,nonn

AUTHOR

Amarnath Murthy (amarnath_murthy(AT)yahoo.com), Jan 03 2006

EXTENSIONS

a(7)-a(18) from Robert G. Wilson v (rgwv(at)rgwv.com), Jan 11 2006

page 1

Search completed in 0.005 seconds

Lookup | Welcome | Find friends | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Transforms | Puzzles | Hot | Classics
More pages | Superseeker | Maintained by N. J. A. Sloane (njas@research.att.com)

Last modified November 25 20:09 EST 2009. Contains 167514 sequences.


AT&T Labs Research