A355249 Maximal GCD of three positive integers with sum n.
1, 1, 1, 2, 1, 2, 3, 2, 1, 4, 1, 2, 5, 4, 1, 6, 1, 5, 7, 2, 1, 8, 5, 2, 9, 7, 1, 10, 1, 8, 11, 2, 7, 12, 1, 2, 13, 10, 1, 14, 1, 11, 15, 2, 1, 16, 7, 10, 17, 13, 1, 18, 11, 14, 19, 2, 1, 20, 1, 2, 21, 16, 13, 22, 1, 17, 23, 14, 1, 24, 1, 2, 25, 19, 11, 26, 1, 20, 27, 2, 1, 28
Offset: 3
Keywords
Crossrefs
Programs
-
Mathematica
a[n_] := GCD @@@ IntegerPartitions[n, {3}] // Max; Table[a[n], {n, 3, 100}] (* Jean-François Alcover, Sep 21 2022 *)
-
Python
from math import gcd def a(n): return max(gcd(i, j, n-i-j) for i in range(1, n//3+1) for j in range(i, n//3+1)) print([a(n) for n in range(3, 85)]) # Michael S. Branicky, Jun 26 2022