通过列举因数找最大公因数

通过列举因数找最大公因数
几何画板及绘图内容加载中,请稍等……
2020-07-26 03:04
①本范例演示通过列举两个数的所有因数来找出它们的最大公因数(HCF);②涉及的核心数学概念为最大公因数、因数分解、集合运算;③作图要点——从下方『构造摘要』提炼用到了 Append(追加元素)、If(条件判断)、Intersection(交集)、Zip(组合)等 GeoGebra 命令/对象;④适合初中数学教学,用于帮助学生直观理解最大公因数的概念和计算方法。

GeoGebra 命令及参数

  1. Append("", Sequence[Text[i], i, 1, 100]) → listNum
  2. If(SelectedIndex[listNum2] > 1, SelectedIndex[listNum2] - 1) → n2
  3. If(Defined[n2], Reverse[KeepIf[IsInteger[k], k, Sequence[n2 / i, i, 1, n2]]], {0}) → listFactor2
  4. If(SelectedIndex[listNum1] > 1, SelectedIndex[listNum1] - 1) → n1
  5. If(Defined[n1], Reverse[KeepIf[IsInteger[k], k, Sequence[n1 / i, i, 1, n1]]], {0}) → listFactor1
  6. Intersection(listFactor1, listFactor2) → listCF
  7. If(listFactor1 ≟ {0} ∨ t1 ≟ 0, {0}, First[listFactor1, t1]) → listFactor1Partial
  8. If(Length[listFactor1] ≤ 1, 1, Length[listFactor1]) → t1max
  9. If(Length[listFactor2] ≤ 1, 1, Length[listFactor2]) → t2max
  10. Zip(If[IndexOf[k, listCF] ≥ 1 ∧ box1, "\red{", ""] + (Text[k]) + (If[IndexOf[k, listCF] ≥ 1 ∧ box1, "}", ""]) + "\,,\,", k, listFactor1Partial) → listFactorText1
  11. If(listFactor2 ≟ {0} ∨ t2 ≟ 0, {0}, First[listFactor2, t2]) → listFactor2Partial
  12. Zip(If[IndexOf[k, listCF] ≥ 1 ∧ box1, "\red{", ""] + (Text[k]) + (If[IndexOf[k, listCF] ≥ 1 ∧ box1, "}", ""]) + "\,,\,", k, listFactor2Partial) → listFactorText2
  13. If(listFactorText1 ≟ {}, " ", Sum[listFactorText1] + " ") → textSum1
  14. If(listFactorText2 ≟ {}, " ", Sum[listFactorText2] + " ") → textSum2