DoingMaths - Free maths worksheets
  • Home
  • Algebra
    • Algebraic expressions
    • Algebraic equations
    • Expanding brackets
    • Index notation
    • Inequalities
    • Quadratic equations
    • Sequences
    • Simultaneous equations
    • Straight line graphs
    • Substitution
  • Shapes, space and measures
    • Angles
    • Circles
    • Circle theorems
    • Compound measures
    • Construction
    • Distance/speed-time graphs
    • Length, area and volume
    • Metric and Imperial conversions
    • Metric units of measurement
    • Proof
    • Pythagoras' Theorem
    • Scale factors, similarity and congruence
    • Symmetry and reflection
    • Time
    • Trigonometry
  • Number
    • Primary Addition and Subtraction
    • Addition and subtraction
    • Basic number work
    • BODMAS/PEMDAS/BIDMAS
    • Compound percentage change
    • Decimals
    • Factors and Multiples
    • Fractions
    • Fractions, decimals and percentages
    • Money
    • Multiplication and division
    • Percentages
    • Ratio and Proportion
    • Rounding and estimating
    • Standard form
  • Statistics and Probability
    • Averages and the Range
    • Box plots
    • Collecting data
    • Pie charts
    • Probability
  • More
    • Starters >
      • Puzzles and riddles
      • Maths Wordsearches
      • More Maths Lesson Starter Ideas
    • Christmas Maths Activities
    • Maths Articles >
      • Revision and How-To Guides >
        • How do Scale Factors Work for Area and Volume?
        • Edexcel GCSE Maths 2023 Paper 2: The Final Question
        • How to Find the Average From a Frequency Table
        • What Do the Angles in a Polygon Add Up To?
        • How to Integrate by Parts: Calculus Help
        • How to Use Pythagoras' Theorem
        • How to Calculate Compound Percentage Changes
        • How to Find Equivalent Fractions
        • How to Find the Averages and Range From Grouped Data
        • How to Factorise a Quadratic Algebraic Equation
        • How to Expand a Pair of Brackets
        • How to Complete the Square
        • How to Find the Average of a Group of Numbers
        • Hannah's Sweets - Tricky GCSE Question
        • Why Do We Rationalise the Denominator?
        • How to Add, Subtract, Multiply and Divide Fractions
        • How to Answer the 'Impossible' Question on the Edexcel GCSE Maths Paper 2022
        • How to Draw Pie Charts
        • How to Differentiate From First Principles
        • How to Solve Direct Proportion Questions
        • How to Calculate a Percentage of an Amount Using a Decimal Multiplier
        • How to Find the Lowest Common Multiple and Highest Common Factor of Two Numbers
        • How to Write a Number as a Product of Its Prime Factors
        • How to Solve a Quadratic Equation: 3 Methods
        • How To Solve the GCSE Maths Question That's Leaving Parents Stumped
        • How to Multiply Decimal Numbers Without a Calculator
      • How Many Gifts Do I Get Over the Twelve Days of Christmas?
      • How to Find the Sum of a Geometric Sequence
      • The Maths Behind A4 Paper
      • The Monty Hall Problem
      • Rationalizing the Denominator
      • How Do Binary Numbers Work?
      • Rice on a Chessboard
      • How to Prove Pi Equals 2
      • What is the Maximum Score in Ten-Pin Bowling?
      • The Prisoner's Dilemma
      • How Many Socks Make a Pair?
      • Four Interesting Types of Mathematical Numbers
      • How to Add the Numbers 1-100 Quickly
      • What Is the Sum of the Sequence 1, 1/2, 1/4, 1/8, 1/16, ...?
      • Find the Answer to 8×9×10×11×12 Without Using a Calculator
      • How to Prove that the Square root of 2 is Irrational
      • Three Interesting Fractals From Koch, Sierpinski and Cantor
      • How Many Squares Are on a Chessboard?
      • Different Kinds of Prime Numbers
      • How to Do Long Multiplication Using Napier's Method
      • The Handshake Problem
      • Why You Should Always Order the Large Pizza
      • Maximizing the Area of a Rectangle
      • Speed Arithmetic - How to Multiply by 11 Without a Calculator
      • Speed Arithmetic - How to Multiply and Divide by 5 Without a Calculator
      • Pythagoras' Theorem - A Proof
      • How Large Is Infinity?
      • Interesting Facts About Pascal's Triangle
      • Why Does Time Slow Down as You Approach the Speed of Light?
      • Five of History's Most Influential Women in STEM
      • Five More of History's Most Influential Women in STEM
      • How Likely Are You to Hit the Centre of the Archery Target?
      • Find Four Primes Smaller Than 100 Which Are Factors Of 3^32 − 2^32
      • Bertrand's Paradox: A Problem in Probability Theory
      • What Is an Erdős Number?
      • Three of Isaac Newton's Most Important Contributions to the World
      • Mathematical Numbers: What Is 'e'?
      • Hilbert's Paradox of the Grand Hotel: Another Look at Infinity
      • Decreasing the Circumference of Differently Sized Circles: A Counterintuitive Cricket Problem
      • Zeno's Paradox: Achilles and the Tortoise
      • What Are Hexadecimal Numbers?
      • Why Do We Split a Circle Into 360 Degrees?
      • N-bonacci Sequences - Taking Fibonacci Further
      • Being Careful When You Average an Average: A Basketball Problem
      • What Is a Dudeney Number?
      • Every Prime Number Larger Than 3 Is 1 Away From a Multiple of 6: A Proof
      • Why Do Buses Come in Threes?
      • A Quick Way to Solve 1000^2 − 999^2: The Difference of Two Squares
      • What Are Triangular Numbers?
      • What Is the Collatz Conjecture?
      • How to Make a Mathematical Paper Snowflake
      • What Is the Unexpected Hanging Paradox?
      • What Is Pi?
      • Is There a Biggest Prime Number or Do They Continue Infinitely?
    • A-Level Maths Paper Walkthroughs >
      • A-Level Maths, Edexcel, June 2018, Paper Walkthroughs >
        • A-Level Maths, June 2018, Pure Paper 1 Question Walkthroughs
        • A-Level Maths, June 2018, Pure Paper 2, Question Walkthroughs
        • A-Level Maths, June 2018, Statistics and Mechanics, Question Walkthroughs
      • A-Level Maths, Edexcel, June 2019, Paper Walkthroughs >
        • A-Level Maths, June 2019, Pure Paper 1, Question Walkthroughs
        • A-Level Maths, June 2019, Pure Paper 2, Question Walkthrough
        • A-Level Maths, June 2019, Statistics and Mechanics, Walkthrough answers
      • A-Level Maths, Edexcel, October 2020, Paper Walkthroughs >
        • A-Level Maths, October 2020, Pure Mathematics Paper 1, Question Walkthroughs
        • A-Level Maths, October 2020, Pure Mathematics Paper 2, Question Walkthroughs
        • A-Level Maths, October 2020, Statistics and Mechanics, Walkthrough answers
      • A-Level Maths, Edexcel, October 2021, Paper Walkthroughs >
        • A-Level Maths, October 2021, Pure Mathematics, Paper 1 Walkthroughs
        • A-Level Maths, October 2021, Pure Mathematics Paper 2 Walkthroughs
        • A-Level Maths, October 2021, Statistics and Mechanics, Walkthrough answers
      • A-Level Maths, Edexcel, June 2022, Paper 1 Walkthroughs
    • Mathematician of the Month
    • Tricky Geometry Problems
    • DoingMaths video channel
    • DoingMaths Shop
    • Contact us
    • Privacy policy

Every Prime Number Larger Than 3 Is 1 Away From a Multiple of 6: A Proof

Examples of prime numbers 1 away from a multiple of 6
Prime numbers one away from a multiple of 6
It may seem surprising, but every prime number, with the exception of the first two primes, 2 and 3, is within 1 of a multiple of 6. It doesn't matter how big the prime is, it will always be either a multiple of 6 plus 1 or a multiple of 6 minus 1.
For example, let's start with a small prime, 37. 37 = 36 + 1, with 36 being a multiple of 6. We can pick a larger prime such as 839. This equals 840 − 1 where 840 is a multiple of 6 (140 × 6 to be precise). Try to think of some prime numbers yourself; they will always be 1 away from a multiple of 6.
We could keep on checking examples and always getting this result, but as there are an infinite number of primes, doing this won't prove anything. Let's have a look at how we can prove this formally.

What is a prime number?​

The first thing we need to do before delving into the proof is to look at what exactly a prime number is.
A prime number is a whole number with exactly two factors: one and itself.
For example, 8 is not a prime number as it has four factors: 1, 2, 4 and 8. Meanwhile, 7 is a prime as its only factors are 1 and 7.
One important thing to take note of from the definition is that 1 is not a prime number as it has only one factor, itself, as opposed to the two needed for a prime.

How to prove our statement

We are now going to look at proving our statement.
To set up our proof, we need to think of all numbers in relation to multiples of 6.
If we take any multiple of 6, we can write it as 6n, where n is a whole number. E.g. 42 = 6 × 7, 126 = 6 × 21 etc.
If we take our 6n and add another 6, we will get the next multiple of 6, which can therefore be written as 6n + 6.
We can see from our definition that 6n and 6n + 6 cannot be prime as they must both be divisible by 6 as well as 1, and 6 is itself divisible by 2 and 3. They must, therefore, have more factors than just 1 and themselves.
Now we have our two consecutive multiples of 6; we can write all of the numbers in between them in terms of 6n. These will be 6n + 1, 6n + 2, 6n + 3, 6n + 4 and 6n + 5, as can be seen in the picture below.
Numbers written in terms of 6n
Numbers written in terms of 6n
With a bit of thought, we can see that all whole numbers are either a multiple of 6 or a multiple of 6 plus 1, 2, 3, 4, or 5. Therefore, every whole number can be written as 6n, 6n +1, 6n + 2, 6n + 3, 6n + 4 or 6n + 5 for some whole number n.
Let's look more closely at these.
We have already seen that 6n itself cannot be prime, but what about the others?
6n + 2 can be factorised to give us 6n + 2 = 2(3n + 1). As this is a whole number (3n + 1) multiplied by 2, then it must have 2 as a factor; hence, it cannot be prime.
In a similar fashion, 6n + 4 = 2(3n + 2), so again, it cannot be a prime number.
The number in the middle of our list is 6n + 3. This equals 3(2n + 1); hence, it has 3 as a factor and also cannot be a prime number.
The two remaining numbers in our list are 6n + 1 and 6n + 5. These do not factorise and, hence, have no obvious factors. In practice, they might have a factor, e.g., 6 × 4 + 1 = 25, which has the factor 5, but we cannot show a definite factor for all n in the way we can for 6n + 2 and the others. This means that 6n + 1 and 6n + 5 are the only numbers on the list that can possibly be prime.

Summary

To summarise:
  • We have shown that all numbers can be written as one of 6n, 6n + 1, 6n + 2, 6n + 3, 6n + 4 and 6n + 5 for some whole number n.
  • 6n, 6n + 2, 6n + 3 and 6n + 4 always have extra factors regardless of the value of n; hence, they can never be prime numbers.
  • The only positions that can possibly be prime are 6n + 1 (a multiple of 6, plus 1) and 6n + 5 (the next multiple of 6, minus 1)
  • Therefore, all prime numbers are within 1 of a multiple of 6.
Remember, we are not saying that all numbers of the form 6n + 1 or 6n + 5 are prime. We are saying that these are the only numbers that can possibly be prime.

Comments

​Don't forget to leave your comments below.
Home      Algebra      Shapes, space and measures      Number      Data handling      Starters      Internet articles      DoingMaths Youtube channel
© Copyright DoingMaths free worksheets 2026 - All Rights Reserved
  • Home
  • Algebra
    • Algebraic expressions
    • Algebraic equations
    • Expanding brackets
    • Index notation
    • Inequalities
    • Quadratic equations
    • Sequences
    • Simultaneous equations
    • Straight line graphs
    • Substitution
  • Shapes, space and measures
    • Angles
    • Circles
    • Circle theorems
    • Compound measures
    • Construction
    • Distance/speed-time graphs
    • Length, area and volume
    • Metric and Imperial conversions
    • Metric units of measurement
    • Proof
    • Pythagoras' Theorem
    • Scale factors, similarity and congruence
    • Symmetry and reflection
    • Time
    • Trigonometry
  • Number
    • Primary Addition and Subtraction
    • Addition and subtraction
    • Basic number work
    • BODMAS/PEMDAS/BIDMAS
    • Compound percentage change
    • Decimals
    • Factors and Multiples
    • Fractions
    • Fractions, decimals and percentages
    • Money
    • Multiplication and division
    • Percentages
    • Ratio and Proportion
    • Rounding and estimating
    • Standard form
  • Statistics and Probability
    • Averages and the Range
    • Box plots
    • Collecting data
    • Pie charts
    • Probability
  • More
    • Starters >
      • Puzzles and riddles
      • Maths Wordsearches
      • More Maths Lesson Starter Ideas
    • Christmas Maths Activities
    • Maths Articles >
      • Revision and How-To Guides >
        • How do Scale Factors Work for Area and Volume?
        • Edexcel GCSE Maths 2023 Paper 2: The Final Question
        • How to Find the Average From a Frequency Table
        • What Do the Angles in a Polygon Add Up To?
        • How to Integrate by Parts: Calculus Help
        • How to Use Pythagoras' Theorem
        • How to Calculate Compound Percentage Changes
        • How to Find Equivalent Fractions
        • How to Find the Averages and Range From Grouped Data
        • How to Factorise a Quadratic Algebraic Equation
        • How to Expand a Pair of Brackets
        • How to Complete the Square
        • How to Find the Average of a Group of Numbers
        • Hannah's Sweets - Tricky GCSE Question
        • Why Do We Rationalise the Denominator?
        • How to Add, Subtract, Multiply and Divide Fractions
        • How to Answer the 'Impossible' Question on the Edexcel GCSE Maths Paper 2022
        • How to Draw Pie Charts
        • How to Differentiate From First Principles
        • How to Solve Direct Proportion Questions
        • How to Calculate a Percentage of an Amount Using a Decimal Multiplier
        • How to Find the Lowest Common Multiple and Highest Common Factor of Two Numbers
        • How to Write a Number as a Product of Its Prime Factors
        • How to Solve a Quadratic Equation: 3 Methods
        • How To Solve the GCSE Maths Question That's Leaving Parents Stumped
        • How to Multiply Decimal Numbers Without a Calculator
      • How Many Gifts Do I Get Over the Twelve Days of Christmas?
      • How to Find the Sum of a Geometric Sequence
      • The Maths Behind A4 Paper
      • The Monty Hall Problem
      • Rationalizing the Denominator
      • How Do Binary Numbers Work?
      • Rice on a Chessboard
      • How to Prove Pi Equals 2
      • What is the Maximum Score in Ten-Pin Bowling?
      • The Prisoner's Dilemma
      • How Many Socks Make a Pair?
      • Four Interesting Types of Mathematical Numbers
      • How to Add the Numbers 1-100 Quickly
      • What Is the Sum of the Sequence 1, 1/2, 1/4, 1/8, 1/16, ...?
      • Find the Answer to 8×9×10×11×12 Without Using a Calculator
      • How to Prove that the Square root of 2 is Irrational
      • Three Interesting Fractals From Koch, Sierpinski and Cantor
      • How Many Squares Are on a Chessboard?
      • Different Kinds of Prime Numbers
      • How to Do Long Multiplication Using Napier's Method
      • The Handshake Problem
      • Why You Should Always Order the Large Pizza
      • Maximizing the Area of a Rectangle
      • Speed Arithmetic - How to Multiply by 11 Without a Calculator
      • Speed Arithmetic - How to Multiply and Divide by 5 Without a Calculator
      • Pythagoras' Theorem - A Proof
      • How Large Is Infinity?
      • Interesting Facts About Pascal's Triangle
      • Why Does Time Slow Down as You Approach the Speed of Light?
      • Five of History's Most Influential Women in STEM
      • Five More of History's Most Influential Women in STEM
      • How Likely Are You to Hit the Centre of the Archery Target?
      • Find Four Primes Smaller Than 100 Which Are Factors Of 3^32 − 2^32
      • Bertrand's Paradox: A Problem in Probability Theory
      • What Is an Erdős Number?
      • Three of Isaac Newton's Most Important Contributions to the World
      • Mathematical Numbers: What Is 'e'?
      • Hilbert's Paradox of the Grand Hotel: Another Look at Infinity
      • Decreasing the Circumference of Differently Sized Circles: A Counterintuitive Cricket Problem
      • Zeno's Paradox: Achilles and the Tortoise
      • What Are Hexadecimal Numbers?
      • Why Do We Split a Circle Into 360 Degrees?
      • N-bonacci Sequences - Taking Fibonacci Further
      • Being Careful When You Average an Average: A Basketball Problem
      • What Is a Dudeney Number?
      • Every Prime Number Larger Than 3 Is 1 Away From a Multiple of 6: A Proof
      • Why Do Buses Come in Threes?
      • A Quick Way to Solve 1000^2 − 999^2: The Difference of Two Squares
      • What Are Triangular Numbers?
      • What Is the Collatz Conjecture?
      • How to Make a Mathematical Paper Snowflake
      • What Is the Unexpected Hanging Paradox?
      • What Is Pi?
      • Is There a Biggest Prime Number or Do They Continue Infinitely?
    • A-Level Maths Paper Walkthroughs >
      • A-Level Maths, Edexcel, June 2018, Paper Walkthroughs >
        • A-Level Maths, June 2018, Pure Paper 1 Question Walkthroughs
        • A-Level Maths, June 2018, Pure Paper 2, Question Walkthroughs
        • A-Level Maths, June 2018, Statistics and Mechanics, Question Walkthroughs
      • A-Level Maths, Edexcel, June 2019, Paper Walkthroughs >
        • A-Level Maths, June 2019, Pure Paper 1, Question Walkthroughs
        • A-Level Maths, June 2019, Pure Paper 2, Question Walkthrough
        • A-Level Maths, June 2019, Statistics and Mechanics, Walkthrough answers
      • A-Level Maths, Edexcel, October 2020, Paper Walkthroughs >
        • A-Level Maths, October 2020, Pure Mathematics Paper 1, Question Walkthroughs
        • A-Level Maths, October 2020, Pure Mathematics Paper 2, Question Walkthroughs
        • A-Level Maths, October 2020, Statistics and Mechanics, Walkthrough answers
      • A-Level Maths, Edexcel, October 2021, Paper Walkthroughs >
        • A-Level Maths, October 2021, Pure Mathematics, Paper 1 Walkthroughs
        • A-Level Maths, October 2021, Pure Mathematics Paper 2 Walkthroughs
        • A-Level Maths, October 2021, Statistics and Mechanics, Walkthrough answers
      • A-Level Maths, Edexcel, June 2022, Paper 1 Walkthroughs
    • Mathematician of the Month
    • Tricky Geometry Problems
    • DoingMaths video channel
    • DoingMaths Shop
    • Contact us
    • Privacy policy