$n=%v$

$ 階梯問題 $

n = 1 (slider from 1 to 7, step 1)
A = (5.08, -1.62)
a_1 = PolyLine(A, A + (0, 1), A + (1, 1))
a_2 = PolyLine(A + (1, 1), A + (1, 2), A + (2, 2))
a_3 = PolyLine(A + (2, 2), A + (2, 3), A + (3, 3))
a_4 = PolyLine(A + (3, 3), A + (3, 4), A + (4, 4))
a_5 = PolyLine(A + (4, 4), A + (4, 5), A + (5, 5))
a_6 = PolyLine(A + (5, 5), A + (5, 6), A + (6, 6))
a_7 = PolyLine(A + (6, 6), A + (6, 7), A + (7, 7))
a1 = 1
a2 = 2
a3: a1 + a2
a4: a3 + a2
a5: a3 + a4
a6: a5 + a4
a7: a5 + a6
text1: "a_1=" + (LaTeX[a1]) + ""
text2: "a_2=" + (LaTeX[a2]) + ""
text3: "a_3=a_1+a_2=" + (LaTeX[a1]) + "+" + (LaTeX[a2]) + "=" + (LaTeX[a1 + a2]) + ""
text4: "a_4=a_2+a_3=" + (LaTeX[a2]) + "+" + (LaTeX[a3]) + "=" + (LaTeX[a2 + a3]) + ""
text5: "a_5=a_3+a_4=" + (LaTeX[a3]) + "+" + (LaTeX[a4]) + "=" + (LaTeX[a3 + a4]) + ""
text6: "a_6=a_4+a_5=" + (LaTeX[a4]) + "+" + (LaTeX[a5]) + "=" + (LaTeX[a4 + a5]) + ""
text7: "a_7=a_5+a_6=" + (LaTeX[a5]) + "+" + (LaTeX[a6]) + "=" + (LaTeX[a5 + a6]) + ""
b_7 = PolyLine(A, A + (7, 0), A + (7, 7))
b_6 = PolyLine(A, A + (6, 0), A + (6, 6))
b_5 = PolyLine(A, A + (5, 0), A + (5, 5))
b_4 = PolyLine(A, A + (4, 0), A + (4, 4))
b_3 = PolyLine(A, A + (3, 0), A + (3, 3))
b_2 = PolyLine(A, A + (2, 0), A + (2, 2))
b_1 = PolyLine(A, A + (1, 0), A + (1, 1))
text8: "\left\lbrace " + (LaTeX[a1]) + "," + (LaTeX[a2]) + "," + (LaTeX[a3]) + "," + (LaTeX[a4]) + "," + (LaTeX[a5]) + "," + (LaTeX[a6]) + "," + (LaTeX[a7]) + " \right\rbrace "
t_{Question}: "$一樓至二樓之間有" + (LaTeX[n]) + "級樓梯，\;某人上樓每次跨1級或2級，\;則方法有幾種?$"
text9: "" + (LaTeX[If[n ≟ 1, "1", If[n ≟ 2, "(1,1),(2)", If[n ≟ 3, "(1,1,1),(2,1),(1,2)", If[n ≟ 4, "(1,1,1,1),(2,1,1),(1,2,1),(1,1,2),(2,2)", If[n ≟ 5, "(1,1,1,1,1),(2,1,1,1),(1,2,1,1),(1,1,2,1),(1,1,1,2),(2,2,1),(2,1,2),(1,2,2)", If[n ≟ 6, "(1,1,1,1,1,1),(2,1,1,1,1)等5個,(2,2,1,1)等6個,(2,2,2)", If[n ≟ 7, "(1,1,1,1,1,1,1),(2,1,1,1,1,1)等6個,(2,2,1,1,1)等10個,(2,2,2,1)等4個"]]]]]]]]) + ""
poly1, a, b, c, d = Polygon(A, A + (1, 0), A + (1, 1), A + (0, 1))
poly2, a_8, e, f, g, h, i = Polygon(A, A + (2, 0), A + (2, 2), A + (1, 2), A + (1, 1), A + (0, 1))
poly3, a_9, j, k, l, m, p, q, r = Polygon(A, A + (3, 0), A + (3, 3), A + (2, 3), A + (2, 2), A + (1, 2), A + (1, 1), A + (0, 1))
poly4, a_{10}, s, t, c_1, d_1, e_1, f_1, g_1, h_1, i_1 = Polygon(A, A + (4, 0), A + (4, 4), A + (3, 4), A + (3, 3), A + (2, 3), A + (2, 2), A + (1, 2), A + (1, 1), A + (0, 1))
poly5, j_1, k_1, l_1, m_1, n_1, p_1, q_1, r_1, s_1, t_1, c_2, d_2 = Polygon(A, A + (5, 0), A + (5, 5), A + (4, 5), A + (4, 4), A + (3, 4), A + (3, 3), A + (2, 3), A + (2, 2), A + (1, 2), A + (1, 1), A + (0, 1))
poly6, e_2, f_2, g_2, h_2, i_2, j_2, k_2, l_2, m_2, n_2, p_2, q_2, r_2, s_2 = Polygon(A, A + (6, 0), A + (6, 6), A + (5, 6), A + (5, 5), A + (4, 5), A + (4, 4), A + (3, 4), A + (3, 3), A + (2, 3), A + (2, 2), A + (1, 2), A + (1, 1), A + (0, 1))
poly7, a_{11}, t_2, c_3, d_3, e_3, f_3, g_3, h_3, i_3, j_3, k_3, l_3, m_3, n_3, p_3, q_3 = Polygon(A, A + (7, 0), A + (7, 7), A + (6, 7), A + (6, 6), A + (5, 6), A + (5, 5), A + (4, 5), A + (4, 4), A + (3, 4), A + (3, 3), A + (2, 3), A + (2, 2), A + (1, 2), A + (1, 1), A + (0, 1))