三数的最大公因数与最小公倍数——质因数分解演示
几何画板及绘图内容加载中,请稍等……
① 本范例演示如何利用质因数分解同时求出三个整数的最大公因数(HCF)与最小公倍数(LCM)。② 涉及核心数学概念:质因数分解、最大公因数、最小公倍数、集合运算(交集、并集)及乘积运算。③ 作图要点:使用 GeoGebra 命令 Factors 分解质因数,Unique 去重,Sort 排序,Zip 组合列表,KeepIf 筛选公共因数,Product 计算乘积,If 条件判断,Textfield 与 LaTeX 显示结果,配合输入框(inputBox1‑3)、按钮(button0)及多语言切换(buttonLang)实现交互。④ 适用于初中数学“数论”章节教学、高中复习以及自学演示,也可作为编程教学中列表处理的范例。
GeoGebra 命令及参数
Factors(b) → M2Unique(PrimeFactors[b]) → listBFactors(a) → M1Unique(PrimeFactors[a]) → listAFactors(c) → M3Unique(PrimeFactors[c]) → listCSort(Union[Union[listA, listB], listC]) → listPrimeZip(If[Defined[IndexOf[k, listB]], Element[M2, IndexOf[k, listB], 2], 0], k, listPrime) → listB2Zip(If[Defined[IndexOf[k, listC]], Element[M3, IndexOf[k, listC], 2], 0], k, listPrime) → listC2Zip(If[Defined[IndexOf[k, listA]], Element[M1, IndexOf[k, listA], 2], 0], k, listPrime) → listA2Zip({k, Min[{m, n, p}]}, k, listPrime, m, listA2, n, listB2, p, listC2) → listHCFKeepIf(Element[k, 2] ≠ 0, k, listHCF) → listHCF'Product(Zip[Element[k, 1]^(Element[k, 2]), k, listHCF']) → resultHCFIf(listHCF' ≟ {}, 1, resultHCF) → resultHCF'Zip(((Element[p, 1] * If[Element[p, 2] ≠ 1, (("^{" * Element[p, 2]) * "}")]) * If[{p} ≠ Last[M1], UnicodeToLetter[8901], ""]), p, M1) → listTextATextfield(a) → inputBox1Zip(((Element[p, 1] * If[Element[p, 2] ≠ 1, (("^{" * Element[p, 2]) * "}")]) * If[{p} ≠ Last[M2], UnicodeToLetter[8901], ""]), p, M2) → listTextBTextfield(b) → inputBox2Zip(((Element[p, 1] * If[Element[p, 2] ≠ 1, (("^{" * Element[p, 2]) * "}")]) * If[{p} ≠ Last[listHCF'], UnicodeToLetter[8901], ""]), p, listHCF') → listTextHCFZip({k, Max[{m, n, p}]}, k, listPrime, m, listA2, n, listB2, p, listC2) → listLCMZip(((Element[p, 1] * If[Element[p, 2] ≠ 1, (("^{" * Element[p, 2]) * "}")]) * If[{p} ≠ Last[listLCM], UnicodeToLetter[8901], ""]), p, listLCM) → listTextLCMLaTeX("\text{LCM= }" + (Sum[listTextLCM])) → textLCMTextfield(c) → inputBox3Zip(((Element[p, 1] * If[Element[p, 2] ≠ 1, (("^{" * Element[p, 2]) * "}")]) * If[{p} ≠ Last[M3], UnicodeToLetter[8901], ""]), p, M3) → listTextCProduct(Zip[Element[k, 1]^(Element[k, 2]), k, listLCM]) → resultLCM
AI 绘图提示语参考
绘制一个交互式数论教学面板,包含三个输入框分别用于输入三个整数,以及一个计算按钮。面板中央展示每个整数的质因数分解式,以质数底数和指数的形式排列。下方分别显示最大公因数(HCF)和最小公倍数(LCM)的结果,每个结果都附带其质因数分解式,指数取三个数中对应质数的最小值(HCF)或最大值(LCM)。所有分解式按质数从小到大排序,并用乘号连接。另有一个语言切换按钮,可在中文和英文界面间切换。
以上提示语为根据原始绘图命令整理而来,仅供参考。