Finding H.C.F. by Listing Factors – Interactive GeoGebra Example

Finding H.C.F. by Listing Factors – Interactive GeoGebra Example
Loading the math board and drawing, please wait…
2020-01-06 21:39
① This interactive GeoGebra example demonstrates how to find the Highest Common Factor (H.C.F.) of two numbers by listing all their factors, with a bilingual (Chinese/English) interface. ② The core mathematical concepts are factors, common factors, and the highest common factor, fundamental topics in arithmetic and number theory. ③ Construction highlights: the applet uses GeoGebra commands such as Append, If, Intersection, and Zip to dynamically generate factor lists (listFactor1, listFactor2), compute the common factors via Intersection (listCF), and extract the maximum using If and Max; interactive objects include input boxes (box1, box2), buttons (buttonSetPos, button0, buttonLang), and text displays (textFactor1, textFactor2, textHCF) for updating results and switching languages. ④ It is suitable for upper primary to lower secondary students learning factors and H.C.F., and for teachers creating interactive practice or demonstrations to clarify the listing method step by step.

GeoGebra Commands & Parameters

  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