A354599 Maximal GCD of nine positive integers with sum n.
1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 3, 2, 1, 3, 1, 2, 3, 2, 1, 4, 1, 2, 3, 4, 1, 3, 1, 4, 5, 2, 1, 4, 1, 5, 3, 4, 1, 6, 5, 4, 3, 2, 1, 6, 1, 2, 7, 4, 5, 6, 1, 4, 3, 7, 1, 8, 1, 2, 5, 4, 7, 6, 1, 8, 9, 2, 1, 7, 5, 2, 3, 8, 1, 10, 7, 4, 3, 2, 5, 8, 1, 7, 11, 10
Offset: 9
Keywords
Crossrefs
Programs
-
Maple
b:= proc(n, i, t) option remember; `if`(n=0, signum(t), `if`(min(i, t)<1, 1, max(b(n, i-1, t), igcd(b(n-i, min(n-i, i), t-1), i)))) end: a:= n-> `if`(n<9, 0, b(n$2, 9)): seq(a(n), n=9..200); # Alois P. Heinz, Jul 13 2022
-
Mathematica
b[n_, i_, t_] := b[n, i, t] = If[n == 0, Sign[t], If[Min[i, t] < 1, 1, Max[b[n, i - 1, t], GCD[b[n - i, Min[n - i, i], t - 1], i]]]]; a[n_] := If[n < 9, 0, b[n, n, 9]]; Table[a[n], {n, 9, 100}] (* Jean-François Alcover, Sep 21 2022, after Alois P. Heinz *)