Join our FREE webinar on May 1st to learn about managing anxiety.

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
H not needed
dchenmathcounts   47
N a minute ago by AshAuktober
Source: USEMO 2019/1
Let $ABCD$ be a cyclic quadrilateral. A circle centered at $O$ passes through $B$ and $D$ and meets lines $BA$ and $BC$ again at points $E$ and $F$ (distinct from $A,B,C$). Let $H$ denote the orthocenter of triangle $DEF.$ Prove that if lines $AC,$ $DO,$ $EF$ are concurrent, then triangle $ABC$ and $EHF$ are similar.

Robin Son
47 replies
dchenmathcounts
May 23, 2020
AshAuktober
a minute ago
Counting graph theory
MathSaiyan   1
N 4 minutes ago by biomathematics
Source: PErA 2025/6
Let $m$ and $n$ be positive integers. For a connected simple graph $G$ on $n$ vertices and $m$ edges, we consider the number $N(G)$ of orientations of (all of) its edges so that, in the resulting directed graph, every vertex has even outdegree.
Show that $N(G)$ only depends on $m$ and $n$, and determine its value.
1 reply
1 viewing
MathSaiyan
Mar 17, 2025
biomathematics
4 minutes ago
hard problem
Cobedangiu   14
N an hour ago by IceyCold
Let $a,b,c>0$ and $a+b+c=3$. Prove that:
$\dfrac{4}{a+b}+\dfrac{4}{b+c}+\dfrac{4}{c+a} \le \dfrac{1}{a}+\dfrac{1}{b}+\dfrac{1}{c}+3$
14 replies
Cobedangiu
Apr 21, 2025
IceyCold
an hour ago
Vasc = 1?
Li4   8
N an hour ago by IceyCold
Source: 2025 Taiwan TST Round 3 Independent Study 1-N
Find all integer tuples $(a, b, c)$ such that
\[(a^2 + b^2 + c^2)^2 = 3(a^3b + b^3c + c^3a) + 1. \]
Proposed by Li4, Untro368, usjl and YaWNeeT.
8 replies
Li4
Apr 26, 2025
IceyCold
an hour ago
Inequalities
sqing   16
N Yesterday at 5:25 PM by martianrunner
Let $ a,b \in [0 ,1] . $ Prove that
$$\frac{a}{ 1-ab+b }+\frac{b }{ 1-ab+a } \leq 2$$$$ \frac{a}{ 1+ab+b^2 }+\frac{b }{ 1+ab+a^2 }+\frac{ab }{2+ab }  \leq 1$$$$\frac{a}{ 1-ab+b^2 }+\frac{b }{ 1-ab+a^2 }+\frac{1 }{1+ab  }\leq \frac{5}{2}$$$$\frac{a}{ 1-ab+b^2 }+\frac{b }{ 1-ab+a^2 }+\frac{1 }{1+2ab  }\leq \frac{7}{3}$$$$\frac{a}{ 1+ab+b^2 }+\frac{b }{ 1+ab+a^2 } +\frac{ab }{1+ab }\leq \frac{7}{6 }$$
16 replies
sqing
Apr 25, 2025
martianrunner
Yesterday at 5:25 PM
Sequence
lgx57   7
N Yesterday at 3:38 PM by jasperE3
$a_1=1,a_{n+1}=a_n+\frac{1}{a_n}$. Find the general term of $\{a_n\}$.
7 replies
lgx57
Apr 27, 2025
jasperE3
Yesterday at 3:38 PM
Geometry Angle Chasing
Sid-darth-vater   6
N Yesterday at 2:18 PM by sunken rock
Is there a way to do this without drawing obscure auxiliary lines? (the auxiliary lines might not be obscure I might just be calling them obscure)

For example I tried rotating triangle MBC 80 degrees around point C (so the BC line segment would now lie on segment AC) but I couldn't get any results. Any help would be appreciated!
6 replies
Sid-darth-vater
Apr 21, 2025
sunken rock
Yesterday at 2:18 PM
Inequlities
sqing   26
N Yesterday at 1:27 PM by sqing
Let $ a,b,c\geq 0 $ and $ a^2+ab+bc+ca=3 .$ Prove that$$\frac{1}{1+a^2}+ \frac{1}{1+b^2}+  \frac{1}{1+c^2} \geq \frac{3}{2}$$$$\frac{1}{1+a^2}+ \frac{1}{1+b^2}+ \frac{1}{1+c^2}-bc \geq -\frac{3}{2}$$
26 replies
sqing
Jul 19, 2024
sqing
Yesterday at 1:27 PM
BABBAGE'S THEOREM EXTENSION
Mathgloggers   0
Yesterday at 12:18 PM
A few days ago I came across. this interesting result is someone interested in proving this.

$\boxed{\sum_{k=1}^{p-1} \frac{1}{k} \equiv \sum_{k=p+1}^{2p-1} \frac{1}{k} \equiv \sum_{k=2p+1}^{3p-1}\frac{1}{k} \equiv.....\sum_{k=p(p-1)+1}^{p^2-1}\frac{1}{k} \equiv 0(mod p^2)}$
0 replies
Mathgloggers
Yesterday at 12:18 PM
0 replies
N.S. condition of passing a fixed point for a function
Kunihiko_Chikaya   1
N Yesterday at 11:29 AM by Mathzeus1024
Let $ f(t)$ be a function defined in any real numbers $ t$ with $ f(0)\neq 0.$ Prove that on the $ x-y$ plane, the line $ l_t : tx+f(t) y=1$ passes through the fixed point which isn't on the $ y$ axis in regardless of the value of $ t$ if only if $ f(t)$ is a linear function in $ t$.
1 reply
Kunihiko_Chikaya
Sep 6, 2009
Mathzeus1024
Yesterday at 11:29 AM
Dot product
SomeonecoolLovesMaths   4
N Yesterday at 11:25 AM by quasar_lord
How to prove that dot product is distributive?
4 replies
SomeonecoolLovesMaths
Monday at 6:06 PM
quasar_lord
Yesterday at 11:25 AM
Inequalities
sqing   6
N Yesterday at 8:58 AM by sqing
Let $a,b,c\geq 0,ab+bc+ca>0$ and $a+b+c=3$. Prove that
$$\frac{8}{3}\leq\frac{(a+b)(b+c)(c+a)}{ab+bc+ca}\leq 3$$$$3\leq\frac{(a+b)(2b+c)(c+a)}{ab+bc+ca}\leq 6$$$$\frac{3}{2}\leq\frac{(a+b)(2b+c)(c+ a)}{ab+bc+2ca}\leq 6$$$$1\leq\frac{(a+b)(2b+c)(c+ a)}{ab+bc+ 3ca}\leq 6$$
6 replies
sqing
Dec 22, 2023
sqing
Yesterday at 8:58 AM
BrUMO 2025 Team Round Problem 3
lpieleanu   2
N Yesterday at 8:57 AM by nehareddyk009
Bruno and Brutus are running on a circular track with a $20$ foot radius. Bruno completes $5$ laps every hour, while Brutus completes $7$ laps every hour. If they start at the same point but run in opposite directions, how far along the track’s circumference (in feet) from the starting point are they when they meet for the sixth time? Note: Do not count the moment they start running as a meeting point.
2 replies
lpieleanu
Apr 27, 2025
nehareddyk009
Yesterday at 8:57 AM
Inequalities
sqing   6
N Yesterday at 8:42 AM by sqing
Let $x\in(-1,1). $ Prove that
$$  \dfrac{1}{\sqrt{1-x^2}} + \dfrac{1}{2+ x^2}  \geq  \dfrac{3}{2}$$$$ \dfrac{2}{\sqrt{1-x^2}} + \dfrac{1}{1+x^2} \geq 3$$
6 replies
sqing
Apr 26, 2025
sqing
Yesterday at 8:42 AM
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
6877 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
478 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
196 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
498 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
1533 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
217 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