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
For positive integers \( a, b, c \), find all possible positive integer values o
Jackson0423   11
N an hour ago by zoinkers
For positive integers \( a, b, c \), find all possible positive integer values of
\[
\frac{a}{b} + \frac{b}{c} + \frac{c}{a}.
\]
11 replies
Jackson0423
Apr 13, 2025
zoinkers
an hour ago
Set summed with itself
Math-Problem-Solving   1
N an hour ago by pi_quadrat_sechstel
Source: Awesomemath Sample Problems
Let $A = \{1, 4, \ldots, n^2\}$ be the set of the first $n$ perfect squares of nonzero integers. Suppose that $A \subset B + B$ for some $B \subset \mathbb{Z}$. Here $B + B$ stands for the set $\{b_1 + b_2 : b_1, b_2 \in B\}$. Prove that $|B| \geq |A|^{2/3 - \epsilon}$ holds for every $\epsilon > 0$.
1 reply
Math-Problem-Solving
Today at 1:59 AM
pi_quadrat_sechstel
an hour ago
(x+y) f(2yf(x)+f(y))=x^3 f(yf(x)) for all x,y\in R^+
parmenides51   12
N an hour ago by MuradSafarli
Source: Balkan BMO Shortlist 2015 A4
Find all functions $f: \mathbb{R}^{+} \rightarrow \mathbb{R}^{+}$ such that $$
(x+y)f(2yf(x)+f(y))=x^{3}f(yf(x)),  \ \ \ \forall x,y\in \mathbb{R}^{+}.$$
(Albania)
12 replies
1 viewing
parmenides51
Aug 5, 2019
MuradSafarli
an hour ago
Advanced topics in Inequalities
va2010   9
N an hour ago by Strangett
So a while ago, I compiled some tricks on inequalities. You are welcome to post solutions below!
9 replies
va2010
Mar 7, 2015
Strangett
an hour ago
Solve an equation
lgx57   2
N 4 hours ago by lgx57
Find all positive integers $n$ and $x$ such that:
$$2^{2n+1}-7=x^2$$
2 replies
lgx57
Mar 12, 2025
lgx57
4 hours ago
Indonesia Regional MO 2019 Part A
parmenides51   17
N 4 hours ago by Rohit-2006
Indonesia Regional MO
Year 2019 Part A

Time: 90 minutes Rules


p1. In the bag there are $7$ red balls and $8$ white balls. Audi took two balls at once from inside the bag. The chance of taking two balls of the same color is ...


p2. Given a regular hexagon with a side length of $1$ unit. The area of the hexagon is ...


p3. It is known that $r, s$ and $1$ are the roots of the cubic equation $x^3 - 2x + c = 0$. The value of $(r-s)^2$ is ...


p4. The number of pairs of natural numbers $(m, n)$ so that $GCD(n,m) = 2$ and $LCM(m,n) = 1000$ is ...


p5. A data with four real numbers $2n-4$, $2n-6$, $n^2-8$, $3n^2-6$ has an average of $0$ and a median of $9/2$. The largest number of such data is ...


p6. Suppose $a, b, c, d$ are integers greater than $2019$ which are four consecutive quarters of an arithmetic row with $a <b <c <d$. If $a$ and $d$ are squares of two consecutive natural numbers, then the smallest value of $c-b$ is ...


p7. Given a triangle $ABC$, with $AB = 6$, $AC = 8$ and $BC = 10$. The points $D$ and $E$ lies on the line segment $BC$. with $BD = 2$ and $CE = 4$. The measure of the angle $\angle DAE$ is ...


p8. Sequqnce of real numbers $a_1,a_2,a_3,...$ meet $\frac{na_1+(n-1)a_2+...+2a_{n-1}+a_n}{n^2}=1$ for each natural number $n$. The value of $a_1a_2a_3...a_{2019}$ is ....


p9. The number of ways to select four numbers from $\{1,2,3, ..., 15\}$ provided that the difference of any two numbers at least $3$ is ...


p10. Pairs of natural numbers $(m , n)$ which satisfies $$m^2n+mn^2 +m^2+2mn = 2018m + 2019n + 2019$$are as many as ...


p11. Given a triangle $ABC$ with $\angle ABC =135^o$ and $BC> AB$. Point $D$ lies on the side $BC$ so that $AB=CD$. Suppose $F$ is a point on the side extension $AB$ so that $DF$ is perpendicular to $AB$. The point $E$ lies on the ray $DF$ such that $DE> DF$ and $\angle ACE = 45^o$. The large angle $\angle AEC$ is ...


p12. The set of $S$ consists of $n$ integers with the following properties: For every three different members of $S$ there are two of them whose sum is a member of $S$. The largest value of $n$ is ....


p13. The minimum value of $\frac{a^2+2b^2+\sqrt2}{\sqrt{ab}}$ with $a, b$ positive reals is ....


p14. The polynomial P satisfies the equation $P (x^2) = x^{2019} (x+ 1) P (x)$ with $P (1/2)= -1$ is ....


p15. Look at a chessboard measuring $19 \times 19$ square units. Two plots are said to be neighbors if they both have one side in common. Initially, there are a total of $k$ coins on the chessboard where each coin is only loaded exactly on one square and each square can contain coins or blanks. At each turn. You must select exactly one plot that holds the minimum number of coins in the number of neighbors of the plot and then you must give exactly one coin to each neighbor of the selected plot. The game ends if you are no longer able to select squares with the intended conditions. The smallest number of $k$ so that the game never ends for any initial square selection is ....
17 replies
parmenides51
Nov 11, 2021
Rohit-2006
4 hours ago
How to prove one-one function
Vulch   6
N 4 hours ago by Vulch
Hello everyone,
I am learning functional equations.
To prove the below problem one -one function,I have taken two non-negative real numbers $ (1,2)$ from the domain $\Bbb R_{*},$ and put those numbers into the given function f(x)=1/x.It gives us 1=1/2.But it's not true.So ,it can't be one-one function.But in the answer,it is one-one function.Would anyone enlighten me where is my fault? Thank you!
6 replies
Vulch
Apr 11, 2025
Vulch
4 hours ago
Inequalities
sqing   6
N 4 hours ago by sqing
Let $ a,b,c> 0 $ and $  \frac{a}{a^2+ab+c}+\frac{b}{b^2+bc+a}+\frac{c}{c^2+ca+b} \geq 1$. Prove that
$$  a+b+c\leq 3    $$
6 replies
sqing
Apr 4, 2025
sqing
4 hours ago
hard number theory
eric201291   0
4 hours ago
Prove:There are no integers x, y, that y^2+9998587980=x^3.
0 replies
eric201291
4 hours ago
0 replies
Amc 10 mock
Mathsboy100   3
N 5 hours ago by iwastedmyusername
let \[\lfloor  x   \rfloor\]denote the greatest integer less than or equal to x . What is the sum of the squares of the real numbers x for which \[  x^2 - 20\lfloor x \rfloor + 19 = 0  \]
3 replies
Mathsboy100
Oct 9, 2024
iwastedmyusername
5 hours ago
Inequalities
lgx57   4
N 5 hours ago by pooh123
Let $0 < a,b,c < 1$. Prove that

$$a(1-b)+b(1-c)+c(1-a)<1$$
4 replies
lgx57
Mar 19, 2025
pooh123
5 hours ago
Let x,y,z be non-zero reals
Purple_Planet   3
N 5 hours ago by sqing
Let $x,y,z$ be non-zero real numbers. Define $E=\frac{|x+y|}{|x|+|y|}+\frac{|x+z|}{|x|+|z|}+\frac{|y+z|}{|y|+|z|}$, then the number of all integers which lies in the range of $E$ is equal to.
3 replies
Purple_Planet
Jul 16, 2019
sqing
5 hours ago
Identity Proof
jjsunpu   2
N 6 hours ago by fruitmonster97
Hi this is my identity I name it Excalibur

I proved it already using induction what other ways?
2 replies
jjsunpu
Today at 10:35 AM
fruitmonster97
6 hours ago
Three 3-digit numbers
miiirz30   5
N 6 hours ago by fruitmonster97
Leonard wrote three 3-digit numbers on the board whose sum is $1000$. All of the nine digits are different. Determine which digit does not appear on the board.

Proposed by Giorgi Arabidze, Georgia
5 replies
miiirz30
Mar 31, 2025
fruitmonster97
6 hours ago
gcd(f(m) + n, f(n) + m) bounded for m != n
62861   10
N Apr 7, 2025 by ihategeo_1969
Source: IMO 2015 Shortlist, N7
Let $\mathbb{Z}_{>0}$ denote the set of positive integers. For any positive integer $k$, a function $f: \mathbb{Z}_{>0} \to \mathbb{Z}_{>0}$ is called $k$-good if $\gcd(f(m) + n, f(n) + m) \le k$ for all $m \neq n$. Find all $k$ such that there exists a $k$-good function.

Proposed by James Rickards, Canada
10 replies
62861
Jul 7, 2016
ihategeo_1969
Apr 7, 2025
gcd(f(m) + n, f(n) + m) bounded for m != n
G H J
Source: IMO 2015 Shortlist, N7
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
62861
3564 posts
#1 • 4 Y
Y by mathmaths, Adventure10, Mango247, TheHU-1729
Let $\mathbb{Z}_{>0}$ denote the set of positive integers. For any positive integer $k$, a function $f: \mathbb{Z}_{>0} \to \mathbb{Z}_{>0}$ is called $k$-good if $\gcd(f(m) + n, f(n) + m) \le k$ for all $m \neq n$. Find all $k$ such that there exists a $k$-good function.

Proposed by James Rickards, Canada
This post has been edited 2 times. Last edited by 62861, Jul 20, 2016, 7:45 AM
Reason: added proposer
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
v_Enhance
6872 posts
#2 • 17 Y
Y by angiland, winnertakeover, ali.agh, pavel kozlov, Kayak, mijail, v4913, Kobayashi, HamstPan38825, Inconsistent, Jalil_Huseynov, Kingsbane2139, sabkx, Phorphyrion, Adventure10, Mango247, bhan2025
The answer is $k \ge 2$.

For mod $2$ reasons, it is easy to check that $k=1$ fails.

Now we construct a function $f$ for which $\gcd(fn+m, fm+n) \le 2$ for all $m \neq n$. We select our function $f$ of the form \[ f(n) = 2^{g(n)} - n - 1 \]for some large $g$, determined recursively by $g(1) = 1000$, and $g(k+1) = 1 + \left( 1000^{g(k)} \right)!$.

Now, assume $n > m$ and define \begin{align*} A &= fn + m = 2^{g(n)} - n + m - 1 \\ B &= fm + n = 2^{g(m)} - m + n - 1 \\ \implies A+B &= 2^{g(m)} + 2^{g(n)} - 2.  \end{align*}Since $A+B \equiv 2 \pmod 4$, $4 \nmid \gcd(A,B)$.

Now, suppose $p \mid B$ is an odd prime, hence $p \le B < 1000^{g(n-1)}$. Consequently, $g(n) \equiv 1 \pmod{p-1}$. So by Fermat's theorem, we obtain $A+B \equiv 2^{g(m)} \pmod p$, hence $p \nmid A+B$, which concludes the proof.
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
navi_09220114
475 posts
#3 • 2 Y
Y by Adventure10, Mango247
Answer: Such $k$-good functions exists for all $k\ge 2$ only.

First we claim that there is no $1$-good function. If there exist $m\neq n$ with $m, f(m)$ has same parity, and $n, f(n)$ has same parity, then $\gcd(f(m)+n, f(n)+m)$ is even, false. Then we can find two distinct $m, n$ with $m,f(m)$ has different parity and $n, f(n)$ has different parity, but then $\gcd(f(m)+n, f(n)+m)$ is still even, false.

Now we construct a $2$-good function. Take $f(m)=g(m)-m$, then we want to evaluate $d=\gcd(g(m)-m+n, g(n)-n+m)=\gcd(g(m)-m+n, g(m)+g(n))$, and we want to make $d\le 2$ for all $m,n \in \mathbb{N}$. First let us restrict $v_2(d)$. We may achieve this by defining $g(m)=2^{h(m)+1}-1$. Then $d|2^{h(m)+1}+2^{h(n)+1}-2$, but $4\nmid 2^{h(m)+1}+2^{h(n)+1}-2$ because $h(m), h(n) \ge 1$. So $v_2(d)\le 1$.

Now we define $h$ inductively. Set $h(1)=1$. Suppose we can define $h(1), h(2), \cdots h(k)$ for some $k$, it suffices to find $h(k+1)$ such that in the original function $f$, $\gcd(f(k+1)+m, f(m)+k+1) \le 2$ for all $m\le k$. Till this end, set $D=\max\{2^{h(i)+1}-i+(k+1)-1\}$ for all $1\le i\le k$, then if $p\mid g(m)-m+(k+1)=2^{h(m)+1}-m+(k+1)-1$, then $p\le D$. Take $Q$ to be the product of all odd primes at most $D$, then take $h(k+1)=\phi(Q)$. We claim that this choice works.

Indeed, if $p|2^{h(m)}+2^{\phi(Q)}-1$, then since $p\le D$, then $p\mid Q$, so $p\mid Q\mid 2^\phi(Q)-1 \Rightarrow p\mid 2{h(m)} \Rightarrow p=2$. So $d=\gcd(m+f(n),n+f(m))$ will not have odd prime factors, and $v_2(d)\le 1$, thus $d\le 2$. So this function is $2$-good, as desired.
This post has been edited 1 time. Last edited by navi_09220114, Jul 8, 2016, 10:57 AM
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
Bacteria
256 posts
#4 • 19 Y
Y by v_Enhance, 62861, ksun48, tenplusten, Kayak, AlastorMoody, Plops, mijail, khina, Justpassingby, gvole, Jalil_Huseynov, Kingsbane2139, sabkx, Adventure10, Mango247, thdnder, TheHU-1729, bhan2025
This is my problem! (James Rickards, Canada)
Until I saw the official solutions, I didn't know of an explicit function $f$ which worked (like in v_Enhance's solution).
A first approach to solving the problem (it was what I did initially at least) might take the form: set $f(1)=1$, and define $f$ recursively. Let $P$ be the set of odd primes and $4$, and assume $f$ has been defined up to $f(m-1)$. Let $S=\{p\in P \text{ such that } p\mid f(n)+m,\text{ some } n<m\}$. Then, using CRT define:
\begin{align*}
f(m)\equiv f(m-p) \pmod{p} \text{ for } p\in S, p<m\\
f(m)\equiv 0 \pmod{p} \text{ for } p\in S, p\geq m\\
\end{align*}This construction almost works, if $p\mid \gcd(f(m)+n,f(n)+m)$, then $p\in S$, so if $p\geq m$ then $p\mid n$, so $p\leq n< m\leq p$ contradiction. So $p<m$, and induction on the pair $(m-p,n)$ gives a contradiction, so the $\gcd$ is $1$ and you are done! So what went wrong?
The (quite easy to miss) problem is the case $n=m-p$, for then you can't use induction that $\gcd(f(m-p)+n,f(n)+m-p)=1$ (this is of course equal to $f(n)+n$ when $m-p=n$). Unfortunately this can't be resolved very easily as is, but if you go back and be more careful with residues and your definition of $f$, then you can modify this approach into a solution (make sure the set $f(n)+n$ does not take up too many residue classes modulo $p\in P$).
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
mathaddiction
308 posts
#5
Y by
The answers are all $k\geq 2$. We first show that there is no $1$-good function.
Indeed, we show that for all function $f:\mathbb Z_{>0}\to\mathbb Z_{>0}$ there exists $m,n$ such that
$$f(m)+n\text{ and }f(n)+m$$are both even. This is not hard. Notice that if $f(1),f(3)$ is both odd then $f(1)+3,f(3)+1$ is both even, therefore, $f(1),f(3)$ cannot both be odd, similarly $f(2),f(4)$ cannot both be even.

WLOG assume $f(1)$ is even while $f(2)$ is odd then $f(1)+2$ and $f(2)+1$ are both even as desired.

We now show that there is a $2$-good function. Let $P$ be the union of the set of odd primes and $4$. It suffices to show that there exists a function $f$ such that
$$p\nmid (f(m)+n,f(n)+m)$$for all $m\neq n$ and $p\in P$. We will strengthen the condition such that $f(n)+n$ is a prime for all $n$ and that $f(n)+n$ is injective.
We define $f$ recursively. Define $f(1)=1$, $f(2)=3$.
Now suppose we have define $f(1),f(2),...,f(n-1)$, we will assign a value for $f(n)$. We will do so by showing that given $p\in P$ there exists $0\leq g_p(n)\leq i$ such that
$$p\nmid (f(m)+n,g(p)+m)$$for every $1\leq m\leq n-1$. Then by Chinese Remainder Theorem we can take $f(n)\equiv g_p(n)\pmod p$ for all $p\in P$. If $p=3$ we can take
$$g_3(n)\equiv 2n-1\pmod 3$$If $p=4$ we can take $g_4(n)=2,1,3,2,3$ for $5\leq n\leq 8$ and extend it periodically with period $4$. Let $P_s$ be the set of elements in $P$ smaller than $n$. Suppose $p\in P_s$, we call $p$ bad if
$$f(n-p)\equiv -n\pmod p$$and good otherwise. Notice that if $p$ is good, then we can let $f(n)\equiv f(n-p)\pmod p$, then if $m<n$ we have
$$(f(n)+m,f(m)+n))\equiv (f(n-p)+m,f(m)+n-p)\not\equiv 0\pmod p$$So we can just take $g(p)\equiv f(n-p)\pmod p$.
Now suppose $p$ is bad. Since $f(m)+m$ is a prime by inductive hypothesis, for each $p$ there exists exactly one integer $n$ such that $n$ is bad. Therefore, we have $n<2p$ and $f(m)\equiv f(m-p)\pmod p$ for all $m=p+1,...,n-1$. Therefore, at most $n-2$ of the following numbers
$$\{f(1)+n,f(2)+n,...,f(n-1)+n\}$$will be equal to $0\pmod p$ (since $f(1)+n\not\equiv f(2)+n\pmod p$). Therefore suppose $p\nmid f(i)+n$ we can just take $g_p(n)\equiv -i\pmod p$.
If $p\in P$ and $p\geq n$ then again the following $n-1$
$$\{f(1)+n,f(2)+n,...,f(n-1)+n\}$$contain at most $n-2<m-1$ multiples of $p$, so suppose $p\nmid f(i)+n$ we can just take $g_p(n)\equiv -i\pmod p$.
This completes the proof.
Bacteria wrote:
This is my problem! (James Rickards, Canada)
Congratulations on finding such an amazing problem!
It turns out that my idea is exactly the same as yours. I try to construct the function recursively using the quite obvious way (CRT with $f(m)\equiv f(m-p)$ for every prime. But indeed I find out that it is impossible due to the case $n=m-p$. So basically all my wordy explanation is try to avoid that case.
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
squareman
966 posts
#6 • 1 Y
Y by JG666
The answer is $\boxed{k\ge2}.$

If we have two integers $m,n$ of different parities where $f(m), f(n)$ have different parities than $m,n$ respectively, then $2 \mid \gcd(f(m)+n, f(n)+m).$ Otherwise, there exists two integers $m,n$ of the same parity where $f(m), f(n)$ also have that same parity. Then $2 \mid \gcd(f(m)+n, f(n)+m)$ still.

It suffices to construct a $2$-good function, we construct this inductively. Let $f(1) = 2^2-1-1=2.$

Suppose we have constructed valid $m$ up to a certain $n.$ Then consider an integer $C$ larger than $f(m) + n$ for any $m < n.$ Then set $f(n) = 2^{C! + 1} - n-1.$

For any positive integer $m < n,$ we have $$f(m) + n + f(n) + m \equiv 2^{C!+1} + 2^{c} - 2 \equiv 2 \pmod{4}$$where we assume to have set $f(m) = 2^{c} - m - 1$ earlier, so $4$ does not divide the gcd. Also if prime $p$ divides $f(m) + n,$ then $p-1$ divides $C!$ and $$f(m) + n + f(n) + m \equiv 2^{C!+1} + 2^{c} - 2 \equiv 2^{c} \not\equiv 0 \pmod{p}$$by FLT, so this works. $\blacksquare$
This post has been edited 1 time. Last edited by squareman, Jul 4, 2022, 8:12 PM
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
IAmTheHazard
5001 posts
#7 • 1 Y
Y by TheHU-1729
rickards... :maybe:


The answer is $k \geq 2$.

I first show $k=1$ fails. Suppose that $f$ works. If it sends some odd $a_1$ to an even and some even $a_2$ to an odd, we get a contradiction since $2 \mid \gcd(f(a_1)+a_2,f(a_2)+a_1)$. Thus $f$ must either send all evens to evens or all odds to odds (possibly both), which clearly fails too.

I will now construct a function $f$ that is $2$-good, which finishes the problem. We construct $f$ of the form
$$f(n)=2^{g(n)}-n-1$$for a function $g$ that will be defined as follows: let $g(1)=1000$, and then recursively define $g(n)$ such that all the prime divisors of $f(m)+n=n-m+2^{g(n)}-1>0$ across any $m<n$ also divide $2^{g(n)}-2$, and $g(n)>g(n-1)$. This is easy: for each prime divisor $p$ just multiply a factor of $p-1$ to $g(n)-1$.

Now suppose some prime $p$ divides $\gcd(f(m)+n, f(n)+m)$, so it has to divide $2^{g(n)}-2$ as well. On the other hand, we require
$$p \mid m+n+f(m)+f(n)=2^{g(m)}+2^{g(n)}-2 \implies p \mid 2^{g(m)} \implies p=2.$$Furthermore, since $m+n+f(m)+f(n) \equiv 2 \pmod{4}$, we cannot have $4 \mid \gcd(f(m)+n,f(n)+m)$, hence we always have $\gcd(f(m)+n,f(n)+m) \leq 2$, as desired. $\blacksquare$


Remark: The driving motivation behind this solution is the fact that if we allow $f$ to go from $\mathbb{Z}^+ \to \mathbb{Z}$ then $f(n)=-n+1$ works perfectly, so we need a way to translate this to some $\mathbb{Z}^+ \to \mathbb{Z}^+$ function that sort of has the same behavior "modulo primes". My first idea was to define $f(n)=p_{g(n)}\#-n+1$ (a primorial that grows sufficiently large), but if you write stuff out you realize that it's more convenient to have $f(n)+n+1$ be a convenient form whose prime factors we can control easily: this turns out to be possible as well, and we're done!
This post has been edited 2 times. Last edited by IAmTheHazard, Oct 29, 2023, 5:49 PM
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
thdnder
194 posts
#8 • 2 Y
Y by TheHU-1729, Iveela
Answer: For all $k \ge 2$.

Firstly observe that there isn't any 1-good function because of modulo 2 reasons. Now we'll construct function $f$ for which $\gcd(f(m)+n, f(n)+m) \le 2$. We'll select $f(n) = 2^{g(n)} - n - 1$ for some $g \colon \mathbb{N} \to \mathbb{N}$. Let $N$ be a sufficiently large integer and let $g(1) = N$. Now we'll construct the sequence $g(n)$ recursively. Assume $g(1), \dots, g(n-1)$ are defined and we'll define $g(n)$ such a way:

$g(n) > \max(g(1), g(2), \dots, g(n-1))$ and for all primes $p$ less than $f(n-1) + n + 1$, $g(n) \equiv 1 (p-1)$.
Then it suffices to check that $\gcd(f(m) + n, f(n) + m) \le 2$ for all $1 \le m \le n - 1$. Since $f(m) + n + f(n) + m = 2^g(n) + 2^g(m) - 2 \equiv 2 (4)$, so $4 \nmid \gcd(f(m) + n, f(n) + m)$. Now assume the contrary, let $p$ be an odd prime that $p \mid \gcd(f(m) + n, f(n) + m)$. Since $p \mid f(m) + n$, so $p \le f(m) + n < f(n-1) + n + 1$, so $g(n) \equiv 1 (p-1)$. Thus by FLT, we have $f(n) + m = 2^{g(n)} - n - 1 + m \equiv 2 - n - 1 + m = m + 1 - n \equiv 0 (p)$. On the other hand, $0 \equiv f(m) + n = 2^{g(m)} - m - 1 + n \equiv 2^{g(m)} (p)$, so $p \mid 2^{g(m)}$, a contradiction. Thus $\gcd(f(m) + n, f(n) + m) \le 2$ for all $1 \le m \le n - 1$ and we can construct $g$ recursively. Thus we're done. $\blacksquare$

Remark: This is a very difficult problem, or I'm so bad at constructions. Somehow I managed to solve it, but it doesn't feel intuitive after solving it. Firstly I think if we let $f(m) + f(n) + m + n$ is a power of 2, then we only have to deal 4. Thus $f(n) = 1 - n$ perfectly work. And I think I have to enhance $f$, so my first idea was taking $f(n) = 2^{g(n)} - n$ and it didn't work well. And I think I should at least deal with 4, so I take $f(n) = 2^{g(n)} - n + 1$ and I thought defining $g$ recursively by using CRT would work. But it didn't work. :( It took almost 2 hours to realise that if we're gonna deal with 4, so $f(n) = 2^{g(n)} - n + 2k + 1$ would work. So I chose $f(n) = 2^{g(n)} - n - 1$ and that works perfectly. :-D
This post has been edited 3 times. Last edited by thdnder, Dec 12, 2023, 5:05 AM
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
awesomehuman
496 posts
#9
Y by
We claim the answer is $k\ge 2$.

Claim:
There is a $2$-good function.

Proof:
Let $p_1=4$ and $p_2, p_3,\dots$ be the odd primes in order.
We will recursively define sequences $x_1, x_2,\dots$, $s_1, s_2,\dots$, and $f(1), f(2),\dots$ of positive integers.
First, define $x_{1} =\dots = x_{10} = 1$, $s_1=10$, and $f(1) = p_1\dots p_{10}$.

Go through each value of $i>1$.
Define $s_i>s_{i-1}$ such that
\[p_{s_i}> i+\max_{m<i}(f(m)).\]Then, for each $s_{i-1}<j\le s_i$, choose a value of $x_j\not\equiv 0\pmod{p_j}$ such that
\[x_j+m+f(m)\not \equiv 0 \pmod{p_j}\]for all $m< i$. This is possible because $p_j>p_{s_{i-1}}\ge i$.
Then, choose $f(i)$ such that $i+f(i)\equiv x_j\pmod{p_j}$ for all $j\le s_i$.

Assume towards a contradiction that $p_i\mid f(a)+b$ and $p_i\mid f(b)+a$ for $a<b$.
Then, $p_i \le f(a)+b < p_{s_b}$. So, $f(b)+b \equiv x_i \pmod{p_i}$.
Let $r$ be the lowest number such that $s_r\ge i$.

Case 1: $a<r$

Then, by definition,
\[b+f(b)+a+f(a)\equiv x_i+a+f(a)\not \equiv 0\pmod{p_i},\]a contradiction.

Case 2: $a\ge r$

Then,
\[b+f(b)+a+f(a)\equiv 2x_i\not \equiv 0\pmod{p_i},\]a contradiction.

Claim:
There is no $1$-good function.

Proof:
Assume toward a contradiction $f$ is $1$-good.
There is at most $1$ value of $x$ such that $x\equiv f(x)\equiv 0\pmod{2}$
and at most $1$ value of $x$ such that $x\equiv f(x)\equiv 1\pmod{2}$.
So, there exists $a, b$ such that $a\equiv f(b)\equiv 0\pmod{2}$ and $b\equiv f(a)\equiv 1\pmod{2}$,
a contradiction.
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
YaoAOPS
1511 posts
#10 • 1 Y
Y by MS_asdfgzxcvb
your telling me this whole induction is what?


Note that a $1$-sunny function can't exist, since if $f$ maps infinitely many even numbers to even numbers or odd numbers to odd numbers, taking both $m, n$ to be that type of even / odd number gives $k \ge 2$. If there are infinitely many even numbers mapped to odd and odd mapped to even, then taking $m, n$ to be different parity that satisfy the above gives $k \ge 2$ as well.
We claim that a $2$-sunny function exists and construct it through transfinite induction.

Claim: Suppose that $m \mapsto -f(m)$ has no involutions and forms a digraph on residues $\pmod{p}$, other than $r + f(r) \equiv 0 \pmod{f(p)}$ holding for at most one number $r$. Then $p \nmid \gcd(f(m)+n, f(n)+m)$ for all $n, m$.
Proof. A contradiction can only occur if $n \equiv -f(m) \pmod{p}, m \equiv - f(n) \pmod{p}$. Our graph is just a non-involutive arrow graph with one node pointing to itself which still has no involutions other than taking that arrow twice, which can't occur since there's at most one $r$. $\blacksquare$
The idea is to iteratively construct this digraph for each prime $p$, at each time only worrying about finitely many primes.
For all small primes $k$ and $4$ we can manually construct a working digraph and function $f_p$ on residues $\pmod{p}$ that forms the digraph $G_p$.
Define a set $\mathcal{S}$ of dirty primes initially empty. Define a set $\mathcal{C}$ of completed primes containing all small primes and $4$.
Construct $f(n)$ by CRT to have its correct residue of $f_p(n) \pmod{f(p)}$. For each dirty prime $q$, we take $f(n) \equiv f_q(n)$ to continue building the digraph $G_q$ (at this point we have our one fixed number $r$). If $G_q$ has been specified for all residues properly, we remove $q$ from $\mathcal{S}$ and add it to $\mathcal{C}$.
We add all prime divisors of $n + f(n)$ to the set $\mathcal{S}$ of dirty primes (as this is their fixed point), which keeps it finite.
At the end of this transfinite induction process, all primes and $4$ are in $\mathcal{C}$, and thus by our claim $\gcd(f(m) + n, f(n) + m)$ isn't divisible by any element of $\mathcal{C}$ as desired.
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
ihategeo_1969
193 posts
#11
Y by
We claim answer is $\boxed{k \ge 2}$.

Proving $k=1$ doesn't work:


Assume for we find some valid $1$-sunny function. Now we look at $n \mapsto f(n)$ in $\mathbb{F}_2$, we get that there cant be more than one of $0 \mapsto 0$ or $1 \mapsto 1$.

Consequently both $0 \mapsto 1$ and $1 \mapsto 0$ cannot exist. But this means either the image of infinitely many odd $n$ or even $n$ aren't defined, contradiction.

Proving $k \ge 2$ works:

Define $f(n)=g(n)-n$. Now let \[g(1)=2 \text{ and } g(n)=2^{g(n-1)!+1}-1\]Say there exists some odd prime $q$ such that $q \mid \gcd(g(m)-m+n,g(n)-n+m)$ ($m < n$) and hence $q \le g(m)-m+n \le g(n-1)+1 \implies q-1 \mid g(n-1)!$. This means \[0 \equiv g(m)+g(n)=2^{g(m-1)!+1}+2^{g(n-1)!+1}-2 \equiv 2^{g(m-1)!+1} \pmod q\]Which is a contradiction. And obviously see that \[\nu_2 \left(2^{g(m-1)!+1}+2^{g(n-1)!+1}-2 \right)=1\]And so the $\gcd$ is always atmost $2$ as required.

Remark: Main motivation for the construction is that if $f$ was defined from $\mathbb{N} \to \mathbb{Z}$, then a much simpler $2$-sunny function existed which is just $n \mapsto 1-n$.
Z K Y
N Quick Reply
G
H
=
a