Stay ahead of learning milestones! Enroll in a class over the summer!

G
Topic
First Poster
Last Poster
k a April Highlights and 2025 AoPS Online Class Information
jlacosta   0
Apr 2, 2025
Spring is in full swing and summer is right around the corner, what are your plans? At AoPS Online our schedule has new classes starting now through July, so be sure to keep your skills sharp and be prepared for the Fall school year! Check out the schedule of upcoming classes below.

WOOT early bird pricing is in effect, don’t miss out! If you took MathWOOT Level 2 last year, no worries, it is all new problems this year! Our Worldwide Online Olympiad Training program is for high school level competitors. AoPS designed these courses to help our top students get the deep focus they need to succeed in their specific competition goals. Check out the details at this link for all our WOOT programs in math, computer science, chemistry, and physics.

Looking for summer camps in math and language arts? Be sure to check out the video-based summer camps offered at the Virtual Campus that are 2- to 4-weeks in duration. There are middle and high school competition math camps as well as Math Beasts camps that review key topics coupled with fun explorations covering areas such as graph theory (Math Beasts Camp 6), cryptography (Math Beasts Camp 7-8), and topology (Math Beasts Camp 8-9)!

Be sure to mark your calendars for the following events:
[list][*]April 3rd (Webinar), 4pm PT/7:00pm ET, Learning with AoPS: Perspectives from a Parent, Math Camp Instructor, and University Professor
[*]April 8th (Math Jam), 4:30pm PT/7:30pm ET, 2025 MATHCOUNTS State Discussion
April 9th (Webinar), 4:00pm PT/7:00pm ET, Learn about Video-based Summer Camps at the Virtual Campus
[*]April 10th (Math Jam), 4:30pm PT/7:30pm ET, 2025 MathILy and MathILy-Er Math Jam: Multibackwards Numbers
[*]April 22nd (Webinar), 4:00pm PT/7:00pm ET, Competitive Programming at AoPS (USACO).[/list]
Our full course list for upcoming classes is below:
All classes run 7:30pm-8:45pm ET/4:30pm - 5:45pm PT unless otherwise noted.

Introductory: Grades 5-10

Prealgebra 1 Self-Paced

Prealgebra 1
Sunday, Apr 13 - Aug 10
Tuesday, May 13 - Aug 26
Thursday, May 29 - Sep 11
Sunday, Jun 15 - Oct 12
Monday, Jun 30 - Oct 20
Wednesday, Jul 16 - Oct 29

Prealgebra 2 Self-Paced

Prealgebra 2
Sunday, Apr 13 - Aug 10
Wednesday, May 7 - Aug 20
Monday, Jun 2 - Sep 22
Sunday, Jun 29 - Oct 26
Friday, Jul 25 - Nov 21

Introduction to Algebra A Self-Paced

Introduction to Algebra A
Monday, Apr 7 - Jul 28
Sunday, May 11 - Sep 14 (1:00 - 2:30 pm ET/10:00 - 11:30 am PT)
Wednesday, May 14 - Aug 27
Friday, May 30 - Sep 26
Monday, Jun 2 - Sep 22
Sunday, Jun 15 - Oct 12
Thursday, Jun 26 - Oct 9
Tuesday, Jul 15 - Oct 28

Introduction to Counting & Probability Self-Paced

Introduction to Counting & Probability
Wednesday, Apr 16 - Jul 2
Thursday, May 15 - Jul 31
Sunday, Jun 1 - Aug 24
Thursday, Jun 12 - Aug 28
Wednesday, Jul 9 - Sep 24
Sunday, Jul 27 - Oct 19

Introduction to Number Theory
Thursday, Apr 17 - Jul 3
Friday, May 9 - Aug 1
Wednesday, May 21 - Aug 6
Monday, Jun 9 - Aug 25
Sunday, Jun 15 - Sep 14
Tuesday, Jul 15 - Sep 30

Introduction to Algebra B Self-Paced

Introduction to Algebra B
Wednesday, Apr 16 - Jul 30
Tuesday, May 6 - Aug 19
Wednesday, Jun 4 - Sep 17
Sunday, Jun 22 - Oct 19
Friday, Jul 18 - Nov 14

Introduction to Geometry
Wednesday, Apr 23 - Oct 1
Sunday, May 11 - Nov 9
Tuesday, May 20 - Oct 28
Monday, Jun 16 - Dec 8
Friday, Jun 20 - Jan 9
Sunday, Jun 29 - Jan 11
Monday, Jul 14 - Jan 19

Intermediate: Grades 8-12

Intermediate Algebra
Monday, Apr 21 - Oct 13
Sunday, Jun 1 - Nov 23
Tuesday, Jun 10 - Nov 18
Wednesday, Jun 25 - Dec 10
Sunday, Jul 13 - Jan 18
Thursday, Jul 24 - Jan 22

Intermediate Counting & Probability
Wednesday, May 21 - Sep 17
Sunday, Jun 22 - Nov 2

Intermediate Number Theory
Friday, Apr 11 - Jun 27
Sunday, Jun 1 - Aug 24
Wednesday, Jun 18 - Sep 3

Precalculus
Wednesday, Apr 9 - Sep 3
Friday, May 16 - Oct 24
Sunday, Jun 1 - Nov 9
Monday, Jun 30 - Dec 8

Advanced: Grades 9-12

Olympiad Geometry
Tuesday, Jun 10 - Aug 26

Calculus
Tuesday, May 27 - Nov 11
Wednesday, Jun 25 - Dec 17

Group Theory
Thursday, Jun 12 - Sep 11

Contest Preparation: Grades 6-12

MATHCOUNTS/AMC 8 Basics
Wednesday, Apr 16 - Jul 2
Friday, May 23 - Aug 15
Monday, Jun 2 - Aug 18
Thursday, Jun 12 - Aug 28
Sunday, Jun 22 - Sep 21
Tues & Thurs, Jul 8 - Aug 14 (meets twice a week!)

MATHCOUNTS/AMC 8 Advanced
Friday, Apr 11 - Jun 27
Sunday, May 11 - Aug 10
Tuesday, May 27 - Aug 12
Wednesday, Jun 11 - Aug 27
Sunday, Jun 22 - Sep 21
Tues & Thurs, Jul 8 - Aug 14 (meets twice a week!)

AMC 10 Problem Series
Friday, May 9 - Aug 1
Sunday, Jun 1 - Aug 24
Thursday, Jun 12 - Aug 28
Tuesday, Jun 17 - Sep 2
Sunday, Jun 22 - Sep 21 (1:00 - 2:30 pm ET/10:00 - 11:30 am PT)
Monday, Jun 23 - Sep 15
Tues & Thurs, Jul 8 - Aug 14 (meets twice a week!)

AMC 10 Final Fives
Sunday, May 11 - Jun 8
Tuesday, May 27 - Jun 17
Monday, Jun 30 - Jul 21

AMC 12 Problem Series
Tuesday, May 27 - Aug 12
Thursday, Jun 12 - Aug 28
Sunday, Jun 22 - Sep 21
Wednesday, Aug 6 - Oct 22

AMC 12 Final Fives
Sunday, May 18 - Jun 15

F=ma Problem Series
Wednesday, Jun 11 - Aug 27

WOOT Programs
Visit the pages linked for full schedule details for each of these programs!


MathWOOT Level 1
MathWOOT Level 2
ChemWOOT
CodeWOOT
PhysicsWOOT

Programming

Introduction to Programming with Python
Thursday, May 22 - Aug 7
Sunday, Jun 15 - Sep 14 (1:00 - 2:30 pm ET/10:00 - 11:30 am PT)
Tuesday, Jun 17 - Sep 2
Monday, Jun 30 - Sep 22

Intermediate Programming with Python
Sunday, Jun 1 - Aug 24
Monday, Jun 30 - Sep 22

USACO Bronze Problem Series
Tuesday, May 13 - Jul 29
Sunday, Jun 22 - Sep 1

Physics

Introduction to Physics
Wednesday, May 21 - Aug 6
Sunday, Jun 15 - Sep 14
Monday, Jun 23 - Sep 15

Physics 1: Mechanics
Thursday, May 22 - Oct 30
Monday, Jun 23 - Dec 15

Relativity
Sat & Sun, Apr 26 - Apr 27 (4:00 - 7:00 pm ET/1:00 - 4:00pm PT)
Mon, Tue, Wed & Thurs, Jun 23 - Jun 26 (meets every day of the week!)
0 replies
jlacosta
Apr 2, 2025
0 replies
ineq.trig.
wer   16
N 14 minutes ago by mpcnotnpc
If a, b, c are the sides of a triangle, show that: $\frac{a}{b+c}+\frac{b}{c+a}+\frac{c}{a+b}+\frac{r}{R}\le2$
16 replies
wer
Jul 5, 2014
mpcnotnpc
14 minutes ago
Show that this ceil is even
YLG_123   5
N 16 minutes ago by EeEApO
Source: Brazil EGMO TST1 2023 #2
Let $p$ and $q$ be distinct odd primes. Show that
$$\bigg\lceil \dfrac{p^q+q^p-pq+1}{pq} \bigg\rceil$$is even.
5 replies
YLG_123
Jan 29, 2024
EeEApO
16 minutes ago
a MID(point) geo problem
sketchydealer05   63
N 21 minutes ago by Avron
Source: EGMO 2023/2
We are given an acute triangle $ABC$. Let $D$ be the point on its circumcircle such that $AD$ is a diameter. Suppose that points $K$ and $L$ lie on segments $AB$ and $AC$, respectively, and that $DK$ and $DL$ are tangent to circle $AKL$.
Show that line $KL$ passes through the orthocenter of triangle $ABC$.
63 replies
sketchydealer05
Apr 16, 2023
Avron
21 minutes ago
Either \frac{n^4+m}{m^2+n^2} or \frac{n^4-m}{m^2-n^2} is integer
AlperenINAN   4
N an hour ago by Primeniyazidayi
Source: 2023 Turkey Junior National Olympiad P3
Let $m,n$ be relatively prime positive integers. Prove that the numbers
$$\frac{n^4+m}{m^2+n^2} \qquad \frac{n^4-m}{m^2-n^2}$$cannot be integer at the same time.
4 replies
AlperenINAN
Dec 22, 2023
Primeniyazidayi
an hour ago
No more topics!
Factorial: n!|a^n+1
Nima Ahmadi Pour   66
N Apr 5, 2025 by cursed_tangent1434
Source: IMO Shortlist 2005 N4, Iran preparation exam
Find all positive integers $ n$ such that there exists a unique integer $ a$ such that $ 0\leq a < n!$ with the following property:
\[ n!\mid a^n + 1
\]

Proposed by Carlos Caicedo, Colombia
66 replies
Nima Ahmadi Pour
Apr 24, 2006
cursed_tangent1434
Apr 5, 2025
Source: IMO Shortlist 2005 N4, Iran preparation exam
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
Nima Ahmadi Pour
160 posts
#1 • 17 Y
Y by Davi-8191, tenplusten, Mathuzb, nguyendangkhoa17112003, rashah76, itslumi, Adventure10, megarnie, TheHawk, yshk, Mango247, Sedro, cubres, and 4 other users
Find all positive integers $ n$ such that there exists a unique integer $ a$ such that $ 0\leq a < n!$ with the following property:
\[ n!\mid a^n + 1
\]

Proposed by Carlos Caicedo, Colombia
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
jin
383 posts
#2 • 5 Y
Y by Adventure10, TheHawk, yshk, Mango247, and 1 other user
If $n$ is even,$a^n+1=x^2+1,(x=a^{\frac{n}{2}})$
So 3 doesn't divide $a^n+1$ and we see 3 doesn't divide $n!$
So $n=2$.
But what if $n$ is odd,
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
Megus
1198 posts
#3 • 4 Y
Y by Adventure10, TheHawk, yshk, Mango247
We can use well-known (actually I never proved it with $a+1$ but rather $a-1$ but in this case I bet result is still valid and proof doesn't change much [induction])

if $p^b || a+1$ then $p^c || n$ is equivalent to $p^{b+c}||a^n+1$. Using that $v_p (n!)= \sum_{i=1} ^{\infty} [\frac{n}{p^i} ]$ we can compare $v_p(a^n+1)$ and $v_p(n!)$ and quickly bring whole problem to checking manually some small $n$.
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
ZetaX
7579 posts
#4 • 4 Y
Y by Adventure10, TheHawk, sabkx, Mango247
No you cant since there are $\infty$ many $n$ with that property :D
Or how would you do it¿
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
Megus
1198 posts
#5 • 3 Y
Y by Adventure10, TheHawk, Mango247
I would fix $n$ and assume that there exist such an $a$, then use above (from which we get bound on $n$) - is there really infinite number of solutions ? :huh: (can you show some infinite family of solutions)

Edit: I've seen my mistake - I thought $0 \leq a < n$ :blush:
This post has been edited 3 times. Last edited by Megus, Apr 25, 2006, 7:28 PM
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
ZetaX
7579 posts
#6 • 3 Y
Y by Adventure10, TheHawk, Mango247
Exactly the primes work :)
But I will not post a proof that they work since this spoils half of the problem.
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
rem
1434 posts
#7 • 3 Y
Y by Adventure10, TheHawk, Mango247
Nima Ahmadi Pour wrote:
Find all $n$ such that there exists a unique integer $a$ such that $0\leq a<n!$ with the following property:
\[ n!|a^n+1  \]
If $n!$ divides $a^n+1$ then $gcd(n,a) = 1$. But $a < n$. Hence $a = 0$ or $1$. Then $n!$ can be $1$ or $2$, so $n$ is $1$ or $2$.
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
ZetaX
7579 posts
#8 • 3 Y
Y by Adventure10, TheHawk, Mango247
Surely not, just try $n=3,5,7,...$ ;)
I think you missinterpreted some places of $!$'s.
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
rem
1434 posts
#9 • 3 Y
Y by Adventure10, TheHawk, Mango247
Sorry :blush: it's $a<n!$
I 'll try to come up with a solution
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
cefer
293 posts
#10 • 11 Y
Y by Illuzion, Polynom_Efendi, Feridimo, Adventure10, aidan0626, TheHawk, yshk, sabkx, Mango247, and 2 other users
Check that for $n=2,3$ there is unique $a$ satisfying problem. Now assume $n \geq 4$.
- If $n$ is even then $4|n!$. Hence $4|a^n+1$ and we get a contradiction.

- If $n$ is odd composite then there are at least two such $a$'s: Obviously for $a=n!-1$ we have $n!|a^n+1$. Lets prove that if $a=(n-1)!-1$ then $n!|a^n+1$. Note that
\[a^n+1=((n-1)!-1)^n+1=((n-1)!)^2A+(n-1)!n-1+1=((n-1)!)^2A+n!\]
Because $n$ is composite $n!|((n-1)!)^2$ and so $n!|a^n+1$. Hence there are at least two such $a$'s.

- If $n$ is prime then there is unique such $a$: Let $n!=p!=r_1^{a_1}r_2^{a_2}....r_k^{a_k}$ be the prime factorization of $n!$ and let $(r,b)=(r_i,a_i)$ for some $i$ so that $r^b|a^p+1$. Then $r^b|a^{2p}-1$ and from Euler's theorem we also have $r^b|a^{r^{b-1}(r-1)}-1$. So $r^b|a^d-1$ where $d=\gcd(2p,r^{b-1}(r-1))|2$ . If $d=1$ then $a^p+1\equiv 2 \mod r^b$ which is obviously a contradiction. So $d=2$ and $r^b|a^2-1=(a-1)(a+1)$. If $r$ is odd then then $a\equiv 1 \mod r^b$ or $a\equiv -1 \mod r^b$. As above we must have $a \equiv -1 \mod r^b$. If $r=2$ then taking $a=2k+1$ gives $2^{b-2}|k(k+1)$. If $k\equiv 0 \mod 2^{b-2}$ then $a^p+1=(2k+1)^p+1\equiv 2 \mod 2^{b-1}$. Since $b \geq 3$ this is a contradiction. So $k\equiv -1 \mod 2^{b-2}$ and $a\equiv -1 \mod 2^{b-1}$. If $a\equiv 2^{b-1}-1 \mod 2^b$ then
\[a^p+1 \equiv (2^{b-1}-1)^p+1 \equiv 2^{b-1} \mod 2^b\]
This gives $a\equiv -1 \mod 2^b$. Thus we proved that $a\equiv -1 \mod r_i^{a_i}$ for all $i$. From the Chinese remainder theorem this system of equations has unique solution in $[1, r_1^{a_1}r_2^{a_2}....r_k^{a_k})=[1, p!)$. Hence when $n$ is prime there is unique such $a$.
This post has been edited 1 time. Last edited by cefer, May 22, 2014, 12:32 PM
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
The QuattoMaster 6000
1184 posts
#11 • 4 Y
Y by TheHawk, Adventure10, Mango247, and 1 other user
I have the same as cefer for evens and primes, but my proof for odd composite is a little different.
Solution
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
bodan
267 posts
#12 • 5 Y
Y by pavel kozlov, TheHawk, Adventure10, Mango247, and 1 other user
Note that $ n = 1, 2, 3$ are solutions. Suppose that $ n \geq 4$ is a solution, and let $ a$ be the unique integer. $ a$ and $ n!$ are relatively prime, since $ (a, n!) \leq (a^n, n!) \leq (a^n, a^n + 1) = 1$.

I. The equation $ x^n \equiv_{n!} 1$ does not have a solution in $ 2 \leq x \leq n!$.
Proof. Suppose the contrary, and let $ 2 \leq x \leq n!$ be a solution to that equation. Then $ (ax)^n \equiv a^n x^n \equiv - 1 \pmod {n!},$ hence $ ax \equiv_{n!} a$ hence $ x \equiv_{n!} 1,$ contradiction.

II. $ n$ is prime.
Proof. Suppose the contrary, and let $ q$ be the least prime divisor of $ n,$ so that $ 2q \leq n.$ Then $ q \,|\, \tfrac{n!}{q},$ and $ x = \tfrac{n!}{q} + 1$ satisfies $ x^n - 1 = \tfrac{n!}{p} (1 + x + \cdots + x^{n - 1})$ and also $ 1 + x + \cdots + x^{n - 1} \equiv_p 1 + 1 + \cdots + 1 \equiv_p 0,$ hence $ n!$ divides $ x^n - 1,$ contradiction.

III. All primes are solutions.
Proof Let $ p$ be a prime. Then $ a = p! - 1$ is a solution to $ p! \,|\, a^p + 1.$ Suppose that $ b$ is another solution, then (because both are relatively prime to $ p!,$) $ b^{ - 1}a \bmod p!$ is a solution to $ x^p \equiv_{p!} 1,$ then $ (x, p!) = 1$ so if $ \delta$ is the order of $ x$ modulo $ p!$ it must be $ \delta \, |\, p$ and $ \delta \,|\, \phi(p!),$ and since $ (p, \phi(p!)) = 1,$ $ \delta = 1,$ so $ x = 1.$ Hence $ b^{ - 1} a = 1$ so $ a = b$ and we have that $ a$ is indeed unique.
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
Zhero
2043 posts
#13 • 6 Y
Y by TheHawk, Adventure10, Mango247, and 3 other users
Is this right?
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
sjaelee
485 posts
#14 • 5 Y
Y by B.J.W.T, yayitsme, TheHawk, Adventure10, Mango247
Solution with help from dinoboy and yugrey
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
JuanOrtiz
366 posts
#15 • 2 Y
Y by TheHawk, Adventure10
Easy problem. This is my solution

ONE MUST NOT FORGET: Also note that if $n=1$, the only possible $a$ is $a=0$ since $0 \le 0 \textless 1$ and it works, so $n=1$ works.
Zhero wrote:
Note that $ n \neq 1$, since we cannot find an integer between 0 and 1!.
That is wrong since $n=1$ is possible.


So we are done and the answer is answer
Z K Y
G
H
=
a