Skip to content

Fun Mathematics

Short description

Create a program that demonstrates a mathematical curiosity in a playful and visual way. Instead of heavy theory, the focus is on showing surprising patterns or properties that make math enjoyable. Examples include a generator for happy numbers, an Ulam spiral, or other small “math art” experiments.

Quote

In Doctor Who (“42”), the Tenth Doctor complained about falling standards in recreational mathematics—after all, who doesn’t know what a happy prime is?

  • Happy number – a number that eventually reaches 1 when replaced by the sum of the squares of its digits.
  • Ulam spiral – a spiral of integers where prime numbers form unexpected patterns.
  • Number patterns – surprising regularities hidden in arithmetic.
  • Mathematical visualization – showing abstract ideas in a visible form.
  • Exploratory programming – learning by coding small, curious experiments.

High-level technical guidelines

  • Use Python loops and functions to implement number generators.
  • Print results in the command-line using simple symbols or grids.
  • For visual extensions, try libraries like matplotlib for plots or spirals.
  • Start with a single curiosity (e.g., happy numbers) before combining several.
  • Keep the code simple and playful—exploration is the main goal.

Using GPT with an expert persona

Using GPT with an expert persona can be a powerful way to simulate conversations with specialists, helping you quickly understand new concepts, explore different perspectives, and even discover useful features or requirements you might not have thought of on your own. Since this is a learning environment, you can also safely test the boundaries of what GPT knows and where it fails, without any risk to your job or reputation—making it a low-stakes, high-value tool for practicing how to ask good questions, evaluate answers critically, and deepen your understanding.

...but the responsibility for correctness and implementation is still yours!

When using the expert persona prompt, treat GPT as a helpful consultant, not an unquestionable authority. The answers can give you inspiration, explanations, or practical examples, but you should always double-check information in reliable sources and test ideas in your own code. Think of it as brainstorming with an expert partner—you get useful guidance, but the responsibility for correctness and implementation is still yours.

Sample expert persona prompt

You are a friendly but professional consultant helping early-year software engineering students create playful demonstrations of recreational mathematics. Take on the perspectives of a mathematician who enjoys number curiosities, a computer scientist specializing in mathematical visualization, a teacher who explains abstract ideas in simple, engaging ways, a software engineer building small exploratory programs, and a Doctor Who fan who delights in “brainy” math references like happy primes. Be constructive, but let the students guide the discussion. If they drift from a professional tone, gently remind them. Always explain domain-specific terminology in simple words, and encourage students to ask questions if something is unclear. Ask as many clarification questions as needed to ensure you and the student are fully aligned before giving detailed answers.

Roles

  • Recreational mathematician – suggests engaging curiosities (happy numbers, Ulam spiral) and explains the underlying patterns simply.
  • Math visualization engineer – maps results to clear terminal grids or lightweight plots that reveal structure at a glance.
  • Software engineer (exploratory prototypes) – builds small, modular generators with clean CLIs and easy toggles for experiments.
  • Teacher/communicator – writes friendly prompts, tooltips, and examples that make the math approachable for beginners.
  • Performance & correctness tester – verifies outputs (e.g., primality, happiness cycles) and keeps runtimes sensible at larger scales.
  • Fan end-user (Doctor Who/math nerd) – playtests for delight, replayability, and fun nods like “happy primes.”