Making an algorithm to find prime factors of a number, I realized that as every prime beyond $2$ can be written as $2n+1$, every one beyond $2$ and $3$ can be written as $6n\pm1$. Is there a formula for primes beyond $2$,$3$, and $5$? And is there a general formula that all primes beyond a given prime can be expressed as (of course not bijectively) ?
2026-04-19 12:45:29.1776602729
Formulas beyond $6k \pm 1$ for primes.
112 Views Asked by Bumbble Comm https://math.techqa.club/user/bumbble-comm/detail At
1
There are 1 best solutions below
Related Questions in ALGEBRA-PRECALCULUS
- How to show that $k < m_1+2$?
- What are the functions satisfying $f\left(2\sum_{i=0}^{\infty}\frac{a_i}{3^i}\right)=\sum_{i=0}^{\infty}\frac{a_i}{2^i}$
- Finding the value of cot 142.5°
- Why is the following $\frac{3^n}{3^{n+1}}$ equal to $\frac{1}{3}$?
- Extracting the S from formula
- Using trigonometric identities to simply the following expression $\tan\frac{\pi}{5} + 2\tan\frac{2\pi}{5}+ 4\cot\frac{4\pi}{5}=\cot\frac{\pi}{5}$
- Solving an equation involving binomial coefficients
- Is division inherently the last operation when using fraction notation or is the order of operation always PEMDAS?
- How is $\frac{\left(2\left(n+1\right)\right)!}{\left(n+1\right)!}\cdot \frac{n!}{\left(2n\right)!}$ simplified like that?
- How to solve algebraic equation
Related Questions in NUMBER-THEORY
- Maximum number of guaranteed coins to get in a "30 coins in 3 boxes" puzzle
- Interesting number theoretical game
- Show that $(x,y,z)$ is a primitive Pythagorean triple then either $x$ or $y$ is divisible by $3$.
- About polynomial value being perfect power.
- Name of Theorem for Coloring of $\{1, \dots, n\}$
- Reciprocal-totient function, in term of the totient function?
- What is the smallest integer $N>2$, such that $x^5+y^5 = N$ has a rational solution?
- Integer from base 10 to base 2
- How do I show that any natural number of this expression is a natural linear combination?
- Counting the number of solutions of the congruence $x^k\equiv h$ (mod q)
Related Questions in ELEMENTARY-NUMBER-THEORY
- Maximum number of guaranteed coins to get in a "30 coins in 3 boxes" puzzle
- Interesting number theoretical game
- How do I show that if $\boldsymbol{a_1 a_2 a_3\cdots a_n \mid k}$ then each variable divides $\boldsymbol k $?
- Using only the digits 2,3,9, how many six-digit numbers can be formed which are divisible by 6?
- Algebra Proof including relative primes.
- How do I show that any natural number of this expression is a natural linear combination?
- Counting the number of solutions of the congruence $x^k\equiv h$ (mod q)
- algebraic integers of $x^4 -10x^2 +1$
- What exactly is the definition of Carmichael numbers?
- Number of divisors 888,888.
Related Questions in PRIME-NUMBERS
- New prime number
- Confirmation of Proof: $\forall n \in \mathbb{N}, \ \pi (n) \geqslant \frac{\log n}{2\log 2}$
- How do I prove this question involving primes?
- What exactly is the definition of Carmichael numbers?
- I'm having a problem interpreting and starting this problem with primes.
- Decimal expansion of $\frac{1}{p}$: what is its period?
- Multiplying prime numbers
- Find the number of relatively prime numbers from $10$ to $100$
- A congruence with the Euler's totient function and sum of divisors function
- Squares of two coprime numbers
Trending Questions
- Induction on the number of equations
- How to convince a math teacher of this simple and obvious fact?
- Find $E[XY|Y+Z=1 ]$
- Refuting the Anti-Cantor Cranks
- What are imaginary numbers?
- Determine the adjoint of $\tilde Q(x)$ for $\tilde Q(x)u:=(Qu)(x)$ where $Q:U→L^2(Ω,ℝ^d$ is a Hilbert-Schmidt operator and $U$ is a Hilbert space
- Why does this innovative method of subtraction from a third grader always work?
- How do we know that the number $1$ is not equal to the number $-1$?
- What are the Implications of having VΩ as a model for a theory?
- Defining a Galois Field based on primitive element versus polynomial?
- Can't find the relationship between two columns of numbers. Please Help
- Is computer science a branch of mathematics?
- Is there a bijection of $\mathbb{R}^n$ with itself such that the forward map is connected but the inverse is not?
- Identification of a quadrilateral as a trapezoid, rectangle, or square
- Generator of inertia group in function field extension
Popular # Hahtags
second-order-logic
numerical-methods
puzzle
logic
probability
number-theory
winding-number
real-analysis
integration
calculus
complex-analysis
sequences-and-series
proof-writing
set-theory
functions
homotopy-theory
elementary-number-theory
ordinary-differential-equations
circles
derivatives
game-theory
definite-integrals
elementary-set-theory
limits
multivariable-calculus
geometry
algebraic-number-theory
proof-verification
partial-derivative
algebra-precalculus
Popular Questions
- What is the integral of 1/x?
- How many squares actually ARE in this picture? Is this a trick question with no right answer?
- Is a matrix multiplied with its transpose something special?
- What is the difference between independent and mutually exclusive events?
- Visually stunning math concepts which are easy to explain
- taylor series of $\ln(1+x)$?
- How to tell if a set of vectors spans a space?
- Calculus question taking derivative to find horizontal tangent line
- How to determine if a function is one-to-one?
- Determine if vectors are linearly independent
- What does it mean to have a determinant equal to zero?
- Is this Batman equation for real?
- How to find perpendicular vector to another vector?
- How to find mean and median from histogram
- How many sides does a circle have?
Your own observations and the comments can be encompassed by a generalization.
The primorial function (indicated by $\#$) is similar to the factorial function. It returns the product of the first $n$ prime numbers: $p_n\#=\prod_{i=1}^{n}p_i$ where $p_1=2,p_2=3,p_3=5,$ etc. Accordingly, $p_1\#=2,\ p_2\#=6,\ p_3\#=30$, etc.
You have observed that all primes greater than $p_1=2$ can be represented as $2k\pm 1=k\cdot p_1\# \pm1$ and all primes greater than $p_2=3$ can be represented as $6k\pm 1=k\cdot p_2\# \pm 1$. J.W. Tanner comments that all primes greater than $p_3=5$ can be represented as $30k\pm \{1,7,11,13\}=k\cdot p_3\# \pm \{1,7,11,13\}$. We can generalize and say that for any prime number $p_m$, all of the primes larger than $p_m$ will have the form $k\cdot p_m\# \pm \{S_m\}$ where $\{S_m\}$ is the set of numbers that includes $1$ and every prime $p_j$ such that $p_m<p_j<p_m\#$. Note that $k$ may take the value $0$.
It should be plain that such numbers are not divisible by any prime $\le p_m$, since $p_m\#$ is divisible by the primes $p_1,p_2,\dots , p_m$ but no member of $\{S_m\}$ is, and hence the sums or differences cannot be.
Since the number of members of $\{S_m\}$ becomes large very quickly as the index $m$ increases, this formulation quickly becomes not particularly efficient (some might say unwieldy), and most practitioners are content to stop at saying that primes greater than $3$ have the form $6k\pm 1$
I note that Tanner's list did not include the primes $17,19,23,29$ which would be included in the formulation I just provided. This is because (per the Goldbach conjecture) the even number $p_m\#$ can be resolved into the sum of two primes, and the primes not listed by Tanner are the Goldbach complements (with respect to $30$) of the numbers he listed. That is, $17$ is the complement of $13$, $19$ is the complement of $11$, etc. with regard to summing to $30$.
The comment by The Demonix_Hermit is to be strictly regarded. Although every prime larger than $p_m$ will have the form $k\cdot p_m\# \pm \{S_m\}$, it will not be the case that every number of that form will be a prime.