Dynamic Exploration of Prime and Composite Numbers

Dynamic Exploration of Prime and Composite Numbers
Loading the math board and drawing, please wait…
2020-08-17 22:29
① This example demonstrates an interactive tool that dynamically generates and displays prime and composite numbers within a user‑defined range. ② Core mathematical concepts include the definition of primes, composite factorization, integer factorisation, and the filtering and sorting of integer sequences. ③ Construction highlights: Sequence creates the integer list; KeepIf and If test primality; Flatten, Sort, and Length process factor lists; InputBox, Button, and Textfield controls provide user interaction and language switching. ④ Suitable for middle‑school number theory introduction, high‑school discrete mathematics, and self‑directed inquiry learning, serving as a classroom demo or homework resource.

GeoGebra Commands & Parameters

  1. Textfield(n) → InputBox1
  2. Reverse(KeepIf[IsInteger[k], k, Sequence[n / i, i, floor(sqrt(n)) + 1, n]]) → l1
  3. KeepIf(IsInteger[k], k, Sequence[n / i, i, 1, floor(sqrt(n))]) → l2
  4. Flatten(Zip[{a, b}, a, l1, b, l2]) → l3
  5. If(IsInteger[sqrt(n)], Append[l3, sqrt(n)], l3) → listFactor
  6. Sequence(Text[listFactor(i)] + "\,,\," + (If[Mod[i, 10] ≟ 0, "\\", ""]), i, 1, t) → listFactorText
  7. Length(listFactor) → f
  8. Sort(listFactor) → listFactorSort
  9. Sequence(Text[listFactorSort(i)] + "\,,\," + (If[Mod[i, 10] ≟ 0, "\\", ""]), i, 1, t) → listFactorTextSort

AI Drawing Prompt Reference

Create a dynamic display of prime and composite numbers, allowing the user to input a range. The software will generate all primes and composites within that range and list them in order. First, create an input box for the user to define the range, then generate all integers within that range, filter out primes and composites, decompose them into factors, and finally sort and display the factor lists.
The prompt above was compiled from the original drawing commands and is for reference only.