OFFSET
2,1
LINKS
Alois P. Heinz, Table of n, a(n) for n = 2..12500
FORMULA
For prime p>2, a(p) = a(2*p) = a(3*p) = p.
EXAMPLE
a(12) = 5, because 5 is the largest of all minimal primes in partitions of 12 into prime parts: [2,2,2,2,2,2], [2,2,2,3,3], [3,3,3,3], [2,2,3,5], [2,5,5], [2,3,7], [5,7].
MAPLE
b:= proc(n, p, t) option remember; `if`(n=0, 1, `if`(p>n, 0, (q->
add(b(n-p*j, q, 1), j=1..n/p)*t^p+b(n, q, t))(nextprime(p))))
end:
a:= n-> degree(b(n, 2, x)):
seq(a(n), n=2..100); # Alois P. Heinz, Mar 13 2020
MATHEMATICA
Array[If[PrimeQ@ #, #, Max@ IntegerPartitions[#, #/FactorInteger[#][[1, 1]], Prime@ Range@ PrimePi[# - 2]][[All, -1]] ] &, 60, 2] (* Michael De Vlieger, Jan 26 2020 *)
(* Second program: *)
b[n_, p_, t_] := b[n, p, t] = If[n == 0, 1, If[p > n, 0, Function[q, Sum[
b[n - p*j, q, 1], {j, 1, n/p}]*t^p + b[n, q, t]][NextPrime[p]]]];
a[n_] := Exponent[b[n, 2, x], x];
a /@ Range[2, 100] (* Jean-François Alcover, Jun 04 2021, after Alois P. Heinz *)
CROSSREFS
KEYWORD
nonn
AUTHOR
David James Sycamore, Jan 23 2020
STATUS
approved