|
Search: id:A069869
|
|
|
| A069869 |
|
Largest prime that can be formed using a partition of n, or 0 if no such prime exists. |
|
+0 3
|
|
| 0, 11, 3, 211, 2111, 0, 112111, 1111211, 0, 11131111, 1121111111, 0, 111211111111, 2111111111111, 0, 31111111111111, 212111111111111, 0, 1111111111111111111, 2111111111111111111, 0, 111111111111111121111, 11111111111111111111111, 0
(list; graph; listen)
|
|
|
OFFSET
|
1,2
|
|
|
COMMENT
|
Conjecture: a(n) = 0 only for n = 1 or n = 3k.
|
|
EXAMPLE
|
a(4) = 211 as the partitions of 4 are (4), (3,1),( 2,2), (2,1,1) (1,1,1,1). The primes that can be formed are 13,31,211 and 211 is the largest prime using a partition.
|
|
MATHEMATICA
|
(* first do *) Needs["DiscreteMath`Combinatorica`"] (* then *) f[n_] := If[ PrimeQ@n, n, If[n > 5 && Mod[n, 3] == 0, 0, Block[{len = PartitionsP[n], p = Partitions[n], t = {}}, Do[ AppendTo[t, Select[FromDigits /@ Join @@@ IntegerDigits /@ Permutations@p[[i]], PrimeQ@# &]], {i, len}]; t = Union@Flatten@t; If[Length@t > 0, Max@t, 0]] ]]; Array[f, 29]
|
|
CROSSREFS
|
Cf. A069870, A004022.
Adjacent sequences: A069866 A069867 A069868 this_sequence A069870 A069871 A069872
Sequence in context: A102380 A038317 A079841 this_sequence A110782 A088073 A010187
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
Amarnath Murthy (amarnath_murthy(AT)yahoo.com), Apr 21 2002
|
|
EXTENSIONS
|
More terms from David Wasserman (wasserma(AT)spawar.navy.mil), Apr 30 2003
a(8) corrected and a(16)-a(24) added by Robert G. Wilson v (rgwv(AT)rgwv.com), Feb 06 2006
|
|
|
Search completed in 0.002 seconds
|