$ 不定方程式的正偶數解 $

$Step=%v$

$case%v$

$ \fgcolor{red}{思考} $
$不管幾個偶數相加還是偶數$

$ 將剩下的球，\;每\;2\;個為一組 $

$ 將\;2\;組球分給\;4\;人，\;$
$每人可兼得或不得 $

$⇒C^{4+2-1}_2=\frac{5!}{3!\cdot 2!}= H^4_2 $

每人先分兩球

n = 12 (slider from 12 to 18, step 6)
s = 0 (slider from 0 to 7, step 1)
ca = 2 (slider from 1 to 3, step 1)
A = (0.6, 0.96)
B: A + (3, 0)
C: A + (6, 0)
D: A + (9, 0)
lista = Sequence(Translate[Ball, (0.75 * j, 0)], j, 0, n - 1)
E: A + (0, -4)
list1 = Sequence(Polygon[A + (1.5 * j, 0), A + (1.5 * (j + 1), 0), A + (1.5 * (j + 1), -0.75), A + (1.5 * j, -0.75)], j, 0, 7)
list2 = Sequence(Polygon[A + (1.5 * j, -0.75), A + (1.5 * (j + 1), -0.75), A + (1.5 * (j + 1), -1.5), A + (1.5 * j, -1.5)], j, 0, 7)
list3 = Sequence(Polygon[A + (1.5 * j, -1.5), A + (1.5 * (j + 1), -1.5), A + (1.5 * (j + 1), -2.25), A + (1.5 * j, -2.25)], j, 0, 7)
list4 = Sequence(Polygon[A + (1.5 * j, -2.25), A + (1.5 * (j + 1), -2.25), A + (1.5 * (j + 1), -3), A + (1.5 * j, -3)], j, 0, 7)
a_1 = PolyLine(A, A + (3, 0), A + (3, -2.25), A + (0, -2.25), A)
a_2 = PolyLine(A + (3, 0), A + (6, 0), A + (6, -2.25), A + (3, -2.25), A + (3, 0))
a_3 = PolyLine(A + (6, 0), A + (9, 0), A + (9, -2.25), A + (6, -2.25), A + (6, 0))
a_4 = PolyLine(A + (9, 0), A + (12, 0), A + (12, -2.25), A + (9, -2.25), A + (9, 0))
list5 = Sequence(E + (0.75 * j, 0), j, 0, n - 1)
F_1: E + (7.5, 0)
F_2: E + (6, 0)
F_3: E + (4.5, 0)
F_4: E + (3, 0)
G_1: A + (0, -0.75)
G_2: A + (3, -0.75)
G_3: A + (6, -0.75)
G_4: A + (9, -0.75)
t = 0 (slider from 0 to 4, step 0.0010)
H_1: F_1 + t * Vector[F_1, G_1]
H_2: F_2 + (t - 1) * Vector[F_2, G_2]
H_3: F_3 + (t - 2) * Vector[F_3, G_3]
H_4: F_4 + (t - 3) * Vector[F_4, G_4]
text12: "$ 將\;" + (LaTeX[n]) + "\;個球分給A,B,C,D四人,$
$每人得" + (LaTeX[If[ca ≟ 1, "非負偶數", If[ca ≟ 2, "正偶數", "正奇數"]]]) + "個球，\;試求方法數. $"
PolyA, e, a, b, c = Polygon(E, E + (1.5, 0), E + (1.5, 0.75), E + (0, 0.75))
PolyB, d, f, g, h = Polygon(E + (1.5, 0), E + (3, 0), E + (3, 0.75), E + (1.5, 0.75))
Poly1, b_1, c_1, d_1, e_1 = Polygon(A - (0, 1.5), A + (1.5, -1.5), A + (1.5, -0.75), A + (0, -0.75))
Poly2, f_1, g_1, h_1, i_1 = Polygon(A + (1.5, -1.5), A + (3, -1.5), A + (3, -0.75), A + (1.5, -0.75))
Poly3, j_1, k_1, l_1, m_1 = Polygon(A + (3, -1.5), A + (4.5, -1.5), A + (4.5, -0.75), A + (3, -0.75))
Poly4, n_1, p_1, q_1, r_1 = Polygon(A + (4.5, -1.5), A + (6, -1.5), A + (6, -0.75), A + (4.5, -0.75))
Poly5, s_1, t_1, b_2, c_2 = Polygon(A + (6, -1.5), A + (7.5, -1.5), A + (7.5, -0.75), A + (6, -0.75))
Poly6, d_2, e_2, f_2, g_2 = Polygon(A + (7.5, -1.5), A + (9, -1.5), A + (9, -0.75), A + (7.5, -0.75))
Poly7, h_2, i_2, j_2, k_2 = Polygon(A + (9, -1.5), A + (10.5, -1.5), A + (10.5, -0.75), A + (9, -0.75))
Poly8, l_2, m_2, n_2, p_2 = Polygon(A + (10.5, -1.5), A + (12, -1.5), A + (12, -0.75), A + (10.5, -0.75))
Polya, q_2, r_2, s_2, t_2 = Polygon(A + (0, -1.5), A + (1.5, -1.5), A + (1.5, -2.25), A + (0, -2.25))
Polyb, b_3, c_3, d_3, e_3 = Polygon(A + (1.5, -1.5), A + (3, -1.5), A + (3, -2.25), A + (1.5, -2.25))
Polyc, f_3, g_3, h_3, i_3 = Polygon(A + (3, -1.5), A + (4.5, -1.5), A + (4.5, -2.25), A + (3, -2.25))
Polyd, j_3, k_3, l_3, m_3 = Polygon(A + (4.5, -1.5), A + (6, -1.5), A + (6, -2.25), A + (4.5, -2.25))
Polye, n_3, p_3, q_3, r_3 = Polygon(A + (6, -1.5), A + (7.5, -1.5), A + (7.5, -2.25), A + (6, -2.25))
Polyf, s_3, t_3, b_4, c_4 = Polygon(A + (7.5, -1.5), A + (9, -1.5), A + (9, -2.25), A + (7.5, -2.25))
Polyg, d_4, e_4, f_4, g_4 = Polygon(A + (9, -1.5), A + (10.5, -1.5), A + (10.5, -2.25), A + (9, -2.25))
Polyh, h_4, i_4, j_4, k_4 = Polygon(A + (10.5, -1.5), A + (12, -1.5), A + (12, -2.25), A + (10.5, -2.25))
ta = false
te = false
zd = false
zc = false
th = false
tb = false
tf = false
za = false
ze = false
zh = false
tc = false
tg = false
zb = false
zf = false
zg = false
td = false
listq: {If[ta ≟ true, 1, 0], If[tb ≟ true, 1, 0], If[tc ≟ true, 1, 0], If[td ≟ true, 1, 0], If[te ≟ true, 1, 0], If[tf ≟ true, 1, 0], If[tg ≟ true, 1, 0], If[th ≟ true, 1, 0], If[za ≟ true, 1, 0], If[zb ≟ true, 1, 0], If[zc ≟ true, 1, 0], If[zd ≟ true, 1, 0], If[ze ≟ true, 1, 0], If[zf ≟ true, 1, 0], If[zg ≟ true, 1, 0], If[zh ≟ true, 1, 0]}
p = Sum(listq)
listg = Sequence(Polygon[E + (1.5 * j, 0), E + (1.5 * (j + 1), 0), E + (1.5 * (j + 1), 0.75), E + (1.5 * j, 0.75)], j, 0, If[n ≟ 12, 1, 8])
text11: "$ 試求方程式\;x+y+z＋u=" + (LaTeX[n]) + "\;$
$的" + (LaTeX[If[ca ≟ 1, "非負偶數解", If[ca ≟ 2, "正偶數解", If[ca ≟ 3, "正奇數解"]]]]) + " $"