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
Interesting inequalities
sqing   0
4 minutes ago
Source: Own
Let $ a,b,c\geq 0 ,b+c-ca=1 $ and $ c+a-ab=3.$ Prove that
$$a+\frac{19}{10}b-bc\leq 2-\sqrt 2$$$$a+\frac{17}{10}b+c-bc\leq  3$$$$ a^2+\frac{9}{5}b-bc\leq 6-4\sqrt 2$$$$ a^2+\frac{8}{5}b^2-bc\leq 6-4\sqrt 2$$$$a+1.974873b-bc\leq 2-\sqrt 2$$$$a+1.775917b+c-bc\leq  3$$

0 replies
sqing
4 minutes ago
0 replies
Two permutations
Nima Ahmadi Pour   12
N 28 minutes ago by Zhaom
Source: Iran prepration exam
Suppose that $ a_1$, $ a_2$, $ \ldots$, $ a_n$ are integers such that $ n\mid a_1 + a_2 + \ldots + a_n$.
Prove that there exist two permutations $ \left(b_1,b_2,\ldots,b_n\right)$ and $ \left(c_1,c_2,\ldots,c_n\right)$ of $ \left(1,2,\ldots,n\right)$ such that for each integer $ i$ with $ 1\leq i\leq n$, we have
\[ n\mid a_i - b_i - c_i
\]

Proposed by Ricky Liu & Zuming Feng, USA
12 replies
Nima Ahmadi Pour
Apr 24, 2006
Zhaom
28 minutes ago
Easy Number Theory
math_comb01   37
N 44 minutes ago by John_Mgr
Source: INMO 2024/3
Let $p$ be an odd prime and $a,b,c$ be integers so that the integers $$a^{2023}+b^{2023},\quad b^{2024}+c^{2024},\quad a^{2025}+c^{2025}$$are divisible by $p$.
Prove that $p$ divides each of $a,b,c$.
$\quad$
Proposed by Navilarekallu Tejaswi
37 replies
math_comb01
Jan 21, 2024
John_Mgr
44 minutes ago
ALGEBRA INEQUALITY
Tony_stark0094   3
N an hour ago by sqing
$a,b,c > 0$ Prove that $$\frac{a^2+bc}{b+c} + \frac{b^2+ac}{a+c} + \frac {c^2 + ab}{a+b} \geq a+b+c$$
3 replies
Tony_stark0094
6 hours ago
sqing
an hour ago
No more topics!
f(n+1) = f(n) + 2^f(n) implies f(n) distinct mod 3^2013
v_Enhance   51
N Monday at 9:54 AM by cursed_tangent1434
Source: USA TSTST 2013, Problem 8
Define a function $f: \mathbb N \to \mathbb N$ by $f(1) = 1$, $f(n+1) = f(n) + 2^{f(n)}$ for every positive integer $n$. Prove that $f(1), f(2), \dots, f(3^{2013})$ leave distinct remainders when divided by $3^{2013}$.
51 replies
v_Enhance
Aug 13, 2013
cursed_tangent1434
Monday at 9:54 AM
f(n+1) = f(n) + 2^f(n) implies f(n) distinct mod 3^2013
G H J
G H BBookmark kLocked kLocked NReply
Source: USA TSTST 2013, Problem 8
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
NoctNight
108 posts
#42
Y by
We induct to prove the statement: For integers $k\geq 0$ and $n\geq 1$, we have that
$$\{f(n),f(n+1),\ldots, f(3^k-1+n)\}=\{1,3,5,\ldots, 2\cdot 3^k-1\}$$modulo $2\cdot 3^k$. The base case $k=0$ is trivial since $f(n)$ is always odd. Now assume it is true for $k=m$. Since $\phi(2\cdot 3^{m+1})=\phi(3^{m+1})=2\cdot 3^m$, we have that
\begin{align*}
f(a+3^m)-f(a)&\equiv f(a+3^m - 1)+2^{f(a+3^m - 1)}-f(a-1)-2^{f(a-1)}\pmod{2\cdot 3^{m+1}}\\
&\equiv f(a+3^m-1)-f(a-1)\\
&\vdots\\
&\equiv f(3^m+1)-1\\
&\equiv 2^{f(3^m)}+2^{f(3^m-1)}+\ldots+2^{f(2)}+2^{f(1)}+1-1\\
&\equiv \sum_{i=1}^{3^m} 2^{2i-1}\\
&\equiv 2\cdot \frac{4^{3^m}-1}{4-1}\\
&\equiv 2\cdot \frac{4^{3^m}-1}{3}
\end{align*}By LTE,
$$\nu_3\left(\frac{4^{3^m}-1}{3}\right)=\nu_3(4-1)+\nu_3(3^m)-1=m$$so we have that $f(a+3^m)-f(a)\equiv 2\cdot 3^m, 4\cdot 3^m$ modulo $2\cdot 3^{m+1}$ because $f(a+3^m)-f(a)$ is even and has $\nu_3$ equal to $m$. Thus, $\left\{f(n+i), f(n+i+3^m), f(n+i+2\cdot 3^m\right\}=\{f(n+i),f(n+i)+2\cdot 3^{m+1}, f(n+i)+4\cdot 3^{m+1}\}$. Therefore:
$$\{f(n),\ldots, f(n+3^{m+1}\}=\{1,3,5,\ldots, 2\cdot 3^{m+1}-1\}$$modulo $2\cdot 3^{m+1}$ completing the inductive step and proof by setting $n=1$.
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
eibc
600 posts
#43
Y by
Replace $2013$ with $k$; then we will in fact show that $f(x), f(x + 1) \ldots, f(x + 3^{k} - 1)$ leave distinct remainders when divided by $3^k$ for any positive integer $x$ by induction on $k$. The base case of $k = 1$ is easy to verify. Now, assume that the statement holds for an arbitrary $k$. We will prove it holds for $k + 1$. Notice that
$$\begin{aligned} f(x + 3^{k}) - f(x) &= f(n + 3^{k} - 1) + 2^{f(x + 3^{k} - 1)} - f(x) \\ &= f(x + 3^{k} - 2) + 2^{f(x + 3^{k} - 2)} + 2^{f(x + 3^{k} - 1)} - f(x) \\ &\vdots \\ &= f(x) + 2^{f(x)} + 2^{f(x + 1)} + \cdots + 2^{f(x + 3^{k} - 1}) - f(x) \\ &= 2^{f(x)} + 2^{f(x + 1)} + \cdots + 2^{f(x + 3^{k} - 1)}. \end{aligned}$$By the inductive hypothesis, we know that $f(x), f(x + 1), \ldots, f(x + 3^k - 1)$ are distinct modulo $3^k$. Additionally, since all outputs of $f$ are odd, they must in fact be a permutation of $\{1, 3, 5, \ldots, 2 \cdot 3^k - 1\}$ modulo $2 \cdot 3^k$. Therefore, since $2^{2 \cdot 3^k} \equiv 1 \pmod {3^{k + 1}}$ by Euler, our above sum is equivalent to
$$\begin{aligned} 2^1 + 2^3 + \cdots + 2^{2 \cdot 3^k - 1} &\equiv \frac{2(4^{3^k} - 1)}{4 - 1} \pmod {3^{k + 1}}. \end{aligned}$$But from LTE, we have $\nu_3(4^{3^k} - 1) = \nu_2(4 - 1) + \nu_2(3^k) = k + 1$, so $\nu_3(f(x + 3^k) - f(x)) = k$. Thus, we have $f(x + 2 \cdot 3^k) - f(x + 3^k)) \equiv f(x + 3^k) - f(x) \equiv \alpha 3^k \pmod {3^{k + 1}}$ for some fixed $\alpha \in \{1, 2\}$. Using the inductive hypothesis again, this finishes the induction.
This post has been edited 2 times. Last edited by eibc, Aug 13, 2023, 2:01 AM
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
huashiliao2020
1292 posts
#44
Y by
This was a relatively easier problem 45 min solve :coolspeak:

We'll prove that $f(n),f(n+1),...,f(n+3^k-1)$ leave different residues mod $3^k$ by induction; the base case k=1 is obvious since mod 3 it's f(n),f(n)-1,...
Note that all f(n) are odd since the first term is odd and then it's odd+2^.=odd; also note that by recursion $f(n)=f(n-1)+2^{n-1}=f(n-2)+2^{n-1}+2^{n-2}=...=2^{n-1}+2^{n-2}+...+1$. We'll prove it for k+1, assuming the induction for the numbers less than it are already proven; call the inductive hypothesis returning distinct residues and that the exponent is taken mod $3^k2$ by Euler's theorem (1). We have $$ f(x + 3^{k}) - f(x) \equiv 2^{f(x)} + 2^{f(x + 1)} + \dots + 2^{f(x + 3^{k} - 1)}\stackrel{(1)}{\equiv}2^1+2^3+...+2^{3^k2-1}\equiv\frac{2(4^{3^k} - 1)}{4 - 1}\stackrel{LTE:\nu_3(4^{3^k}-1)=k+1}{\equiv}3^kc\pmod {3^{k + 1}}$$for some constant c either 1 or 2; by the same reasoning $$f(x+3^k2)-f(x+3^k)\equiv2^{f(x+3^k)}+2^{f(x+3^k+1)}+\dots\equiv2^1+2^3+...+2^{3^k2-1}\equiv3^kc\pmod {3^{k+1}}$$for the same c; in particular, no matter the choice, it's obvious they're all distinct since $2c,c\not\equiv0\pmod 3$, and modulo $3^{k+1}$ adding $3^kc$ sufficiently separates the residues in each group (one spans from $[0,3^k-1]$, another from $[3^k,3^k2-1]$, and a third from $[3^k2,3^{k+1}-1]$). $\blacksquare$
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
peace09
5417 posts
#45
Y by
Click to reveal hidden text
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
joshualiu315
2513 posts
#46
Y by
We will prove by induction that for any $3^k$ consecutive values of $f$ are different modulo $3^k$. The base case $k=1$ is clearly true.

Assume the inductive statement holds to $n=m$. Since powers of $2$ cycle every $2 \cdot 3^k$ in mod $3^{k+1}$ and all of the terms are odd, we have

\begin{align*}
f(n+3^k)-f(n) &= \sum_{i=n}^{n+3^k-1} 2^{f(i)} \pmod{3^{k+1}} \\
&\equiv \sum_{i=1}^{3^k} 2^{2i-1} \pmod{3^{k+1}} \\
&\equiv 2 \cdot \frac{4^{3^k}-1}{3} \pmod{3^{k+1}}
\end{align*}
LTE gives us $v_3 (4^{3^k}-1) = v_3(4-1)+v_3(3^k)=k+1$, so

\[v_3 \left(2 \cdot \frac{4^{3^k}-1}{3} \right) = k\]
Thus, $f(n)$, $f(n+3^k)$, $f(n+2 \cdot 3^k)$ have different residues mod $3^{k+1}$, completing the inductive step. $\square$
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
Leo.Euler
577 posts
#47
Y by
woah nice, 15 minute solve.
Claim: $\nu_3(f(a+3^i)-f(a)) = i$.
Proof. Induct on $k$, with the base case $i=0$ trivial. Then write \[ f(a+3^i)-f(a) = \sum_{n=a}^{a+3^i-1} f(n+1)-f(n) = \sum_{n=a}^{a+3^i-1} 2^{f(n)}. \]By inductive hypothesis, all of the $f(n)$ for $a \le n \le a+3^i - 1$ leave distinct residues modulo $3^i$, and note in general that $f$ takes odd integer values. Thus modulo $3^{i+1}$, we can use FLT to find that \[ f(a+3^i)-f(a) \equiv \sum_{k=1}^{3^k} 2^{2k-1} = 2 \cdot \frac{4^i-1}{3}. \]Now taking $\nu_3$ we have by LTE that $\nu_3(f(a+3^i)-f(a)) = i$, as desired.
:yoda:

A consequence of the claim is that $f(a)$, $f(a+3^i)$, and $f(a+2 \cdot 3^i)$ have distinct residues modulo $3^{i+1}$.

Now given $f(a+\Delta)-f(a)$, write $\Delta$ in ternary so that \[ \Delta = \sum_{i} b_i \cdot 3^{a_i} \]for distinct $a_i$ and a sequence $b_i$ of numbers in $\{1, 2\}$. Thus we see by the claim's consequence that \[ \nu_3(f(a+\Delta)-f(a)) = \nu_3(\Delta) \]by basic $\nu_3$ properties, which finishes.
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
shendrew7
794 posts
#48
Y by
We use induction to show that $f(1), f(2), \ldots$ has period $3^m$ in modulo $3^m$. (Note that during a given period, we cannot have a residue repeat.) The base case $m=1$ is easy to verify. We then show the hypothesis holds for $n=k+1$ given that it holds for $n=k$. The problem then rests on the following:

Claim: We have $v_3\left(f(n+2 \cdot 3^k)-f(n)\right) = v_3\left(f(n+3^k)-f(n)\right) = k$ for all positive integers $n$.

We use our recursion to evaluate
\[f(n+3^k)-f(n) = 2^{f(n)} + 2^{f(n+1)} + \ldots + 2^{f(n+3^k-1)}.\]
Using modulo $3^{k+1}$, Euler's Totient Theorem tells us to look at the exponents modulo $2 \cdot 3^k$. Clearly every exponent is odd, and our inductive hypothesis tells us each leaves a distinct residue modulo $3^k$, so this expression is equivalent to
\[2^1 + 2^3 + \ldots + 2^{2 \cdot 3^k-1} \equiv \frac{2 \left(4^{3^k}-1\right)}{3} \pmod{3^{k+1}}.\]
Now we see that $f(n+2 \cdot 3^k)-f(n)$ is equivalent twice this expression, so their $v_3$'s should be equal. We finish using LTE, as
\[v_3\left(\frac{2 \left(4^{3^k}-1\right)}{3}\right) = v_3(4-1) + v_3(3^k) - 1 = k. \quad {\color{blue} \Box}\]
Thus we know $f(1), \ldots, f(3^{n+1})$ leave distinct residues modulo $3^{n+1}$, completing our induction. $\blacksquare$
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
Shreyasharma
678 posts
#49
Y by
We claim that any $3^m$ values for $n$ gives $f(n)$ with $n \leq 3^m$ distinct remainders when divided by $3^m$.

Note that $f$ is always odd. Now we induct. Say that the desired holds true for $n = 3^{m-1}$ and that the sequence $f(n)$ is periodic modulo $3^{m-1}$, with period $3^{m-1}$. We now show similar statements hold for $3^m$. Clearly it suffices to show that $f(k)$, $f(k + 3^{m-1})$ and $f(k + 2 \cdot 3^{m-1})$ leave distinct remainders modulo $3^m$.

Now we can compute,
\begin{align*}
f(3^{m-1} + k) &= f(3^{m-1} + k - 1) + 2^{f(3^{m-1} + k - 1)}\\
&= f(3^{m-1} + k - 2) + 2^{f(3^{m-1} + k - 1)} + 2^{f(3^{m-1} + k - 2)}\\
&\vdots\\
&= f(k) + \sum_{i = 1}^{3^{m-1}} 2^{f(3^{m-1} + k - i)}
\end{align*}Then it suffices to show that,
\begin{align*}
\sum_{i = 1}^{3^{m-1}} 2^{f(3^{m-1} + k - i)} \not\equiv 0 \pmod{3^m}
\end{align*}Note that $\phi(3^m) = 2 \cdot 3^{m-1}$. Then noting that any $3^{m-1}$ consecutive terms of $f$ leave distinct remainders modulo $3^{m-1}$ from our induction combined with the fact that $f$ is always odd we must have,
\begin{align*}
\{f(3^{m-1} + k - 1), f(3^{m-1}+k - 2), \dots, f(k) \} \equiv (1, 3, 5, \dots, 2 \cdot 3^{m-1} - 1) \pmod{2 \cdot 3^{m-1}}
\end{align*}Thus we have,
\begin{align*}
\sum_{i = 1}^{3^{m-1}} 2^{f(3^{m-1} + k - i)} =\sum_{i=1}^{3^{m-1}} 2^{2i - 1} \pmod{3^m}
\end{align*}Now from sum of geometric series we have,
\begin{align*}
\sum_{i=1}^{3^{m-1}} 2^{2i - 1} = 2 \cdot \left(\frac{4^{3^{m-1}} - 1}{3} \right)
\end{align*}Now it suffices to show $\nu_3(4^{3^{m-1}} - 1) \leq m$, as then we will have that the product is nonzero modulo $3^m$. However LTE we find,
\begin{align*}
\nu_3(4^{3^{m-1}} - 1) = m
\end{align*}as desired.
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
dolphinday
1323 posts
#50
Y by
Our goal is to prove that $f(n)$, $f(n + 3^k)$, and $f(n + 2 \cdot 3^k)$ all have different residues$\pmod{3^{k+1}}$, which we will accomplish by induction.
Our $k = 1$ case is obviously true.
$\newline$
Now, we need to prove that $f(n + 3^k) - f(n) \not\equiv 0 \pmod{3^{k+1}}$.
Notice that
\[f(n + 3^k) - f(n) = \sum_{i=0}^{i = 3^k - 1} 2^{f(n) + i}\]Since $\phi(3^{k+1}) = 2 \cdot 3^k$, we will take the exponents of this expression mod $2 \cdot 3^k$, which results in
\[\sum_{i=0}^{3^k-1} 2^{2i+1}\]which is equivalent to
\[2 \cdot \frac{4^{3^k} - 1}{3}\]By LTE, $v_3$ of this expression is equal to $k$, which is less than $k + 1$, so $f(n + 3^k)$ and $f(n)$ are distinct, modulo $3^{k+1}$.
This post has been edited 1 time. Last edited by dolphinday, Feb 1, 2024, 1:47 PM
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
blueprimes
334 posts
#51
Y by
Really nice problem.

We will prove a stronger claim, that the remainders when $f(1), f(2), \dots, f(3^m)$ leave distinct remainders when divided by $3^m$ for all positive integers $m$. The $m = 1$ case is easy to verify. Now assume the claim for $m$, we will prove for $m + 1$.

Lemma 1. The order of $2 \pmod{3^{m + 1}}$ is $2 \cdot 3^m$.

Proof. Let the order be $t$, clearly it is even. By Lifting the Exponent Lemma, we obtain
$$m + 1 = \nu_3 \left((2^2)^{t / 2} - 1^{t/2} \right) = \nu_3(2^2 - 1) + \nu_3(t / 2),$$then the result follows.

Claim 1. The remainder when $f(k + 3^m) - f(k)$ is divided by $3^{m + 1}$ for positive integers $1 \le k \le 2 \cdot 3^m$ is some constant $d$, and $d$ is either $3^m$ or $2 \cdot 3^m$.

Proof. Clearly $f(n)$ is odd for all $n \in \mathbb{N}$, then the residues of $f(1), f(2), \dots, f(3^m)$ in $\pmod{2 \cdot 3^m}$ are some permutation of $\{ 1, 3, 5, \dots, 2 \cdot 3^m - 1 \}$ by the Chinese Remainder Theorem. Then by Lemma 1, we have
$$f(3^m + 1) \equiv f(1) + 2^{f(1)} + 2^{f(2)} + \dots + 2^{f(3^m)} \equiv f(1) + 2^1 + 2^3 + \dots + 2^{2 \cdot 3^m - 1} \equiv f(1) + 2 \left(\frac{2^{2 \cdot 3^m} - 1}{3} \right) \pmod{3^{m + 1}}.$$
By Lifting the Exponent Lemma,
$$\nu_3 \left((2^2)^{3^m} - 1^{3^m} \right) = \nu_3(2^2 - 1) + \nu_3(3^m) = m + 1,$$then clearly the remainder when $f(3^m + 1) - f(1)$ is divided by $3^{m + 1}$ is $3^m$ or $2 \cdot 3^m$. Now repeatedly applying this process for the next set of remainders, we will constantly generate a unique remainder $\pmod{3^{m + 1}}$. Note that the process works as the remainders when $f(k), f(k + 1), \dots, f(k + 3^m - 1)$ are divided by $\pmod{3^m}$ will always be made all distinct.

The latter claim finishes as for any residue $r$ of $3^m$, we have $r, r + d, r + 2d$ leaving distinct residues in $3^{m + 1}$. Our induction is complete. Now let $m = 2013$, and we are done. $\blacksquare$
This post has been edited 1 time. Last edited by blueprimes, Apr 8, 2024, 3:16 PM
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
Markas
105 posts
#52
Y by
We will prove by induction that $f(1),f(2), \cdots , f(3^n)$ have distinct remainders $\pmod 3^n$. Base case: n=1. Obviously $1,3,11 \pmod 3$ have distinct residues modulo 3. Induction hypothesis: Assume it holds for n=k.

Now we will prove it for k+1. We can see that $\phi (3^{k+1}) = 2.3^k$. So ${ord}_2(3^{k+1}) \mid 2.3^k$. If $f(x) \equiv f(y) \pmod {3^k}$ then $f(x) \equiv f(y) \pmod {2.3^k}$, since f(n) is odd for all n $\Rightarrow$ $2^{f(x)} \equiv 2^{f(y)} \pmod {3^{k+1}}$.

By the induction hypothesis $f(1), f(2), \cdots , f(3^k)$ is a complete residue system mod $3^k$. Then $f(3^{k}+1) \equiv f(z) \pmod {3^k}$ $\Rightarrow$ $2^{f(3^k +1)} \equiv 2^{f(z)} \pmod {3^{k+1}}$. So now we have $f(3^k +2) - f(3^k +1) \equiv f(z+1) - f(z) \pmod {3^{k+1}}$ $\Rightarrow$ $f(3^k + 2) \equiv f(z+1) \pmod {3^k}$. So $f(3^k +3) - f(3^k+2) = f(z+2) - f(z+1)$. Continuing this $f(3^k+s) - f(3^k+1) \equiv f(z+s-1) - f(z) \pmod {3^{k+1}}$.

Now, using the fact that f is always odd, and the hypothesis we have, $f(3^k+1) = 1 + \sum_{i=1}^{3^k} 2^{f(i)} \equiv 2+2^3 +2^5 +\cdots +2^{2.3^k - 1} \equiv 2 \cdot \frac{2^{2.3^k} - 1}{3} +1 \pmod {3^{k+1}}$. But $v_3 (2^{2 \cdot 3^k} - 1) = k+1$ $\Rightarrow$ $f(3^k + 1) \equiv 1 \pmod {3^k}$, but $f(3^k+1) \not \equiv 1 \pmod {3^{k+1}}$ Hence $f$ is periodic modulo $3^k$. But $f(3^k) \not \equiv f(1) \pmod {3^{k+1}}$ Clearly, this shows that $f(1), f(2), \dots f(2 \cdot 3^k)$ are all distinct mod $3^{k+1}$. Also, $f(2 \cdot 3^k +1)- f(3^k +1) \equiv f(3^k +1)-f(1) \equiv m.3^k$ $\Rightarrow$ $f(2 \cdot 3^k+1) \equiv 2.m 3^k +1$ where $ m \in \{1,2 \}$.
But $2.m \not \equiv m \pmod 3$. So $f(2.3^k+1)$ is distinct from all previous values and using the periodicity, we are ready.
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
numbertheory97
42 posts
#53
Y by
Fix some $k$, and consider the assertion that $f(n + 1), f(n + 2), \dots, f(n + 3^k)$ are distinct mod $3^k$ for all integers $n \geq 0$. We prove this by induction on $k$, with the base case $k = 1$ trivial (the sequence repeats $1, 0, 2, 1, 0, 2, \dots$ mod $3$). This clearly implies the $k = 2013$ case.

We prove the following lemma first, which allows us to lift from $3^k$ to $3^{k + 1}$.

Claim: Let $\ell$ be a positive integer. Then $\text{ord}_{3^\ell}(2) = 2 \cdot 3^{\ell - 1}$.

Proof. Let $r = \text{ord}_{3^\ell}(2)$. Clearly $r$ is even (otherwise $2^r \equiv 2 \pmod 3$), so by LTE we have \[\nu_3(2^r - 1) = \nu_3(4^{r/2} - 1) = \nu_3(r/2) + \nu_3(4 - 1) = \nu_3(r) + 1.\]Since $3^\ell \mid 2^r - 1$, it follows that $3^{\ell - 1} \mid r$. Thus $r$ is divisible by $2 \cdot 3^{\ell - 1}$, and by minimality we have $r = 2 \cdot 3^{\ell - 1}$ as claimed. $\square$

Continuing with the problem, suppose the result holds for some $k$, and let $n$ be a positive integer. We're given that $f(n + 1), f(n + 2), \dots, f(n + 3^k)$ are distinct mod $3^k$, and since $f(m)$ is odd for all positive integers $m$, $f(n + 1), f(n + 2), \dots, f(n + 3^k)$ form a permutation of $1, 3, 5, \dots, 2 \cdot 3^k - 1$ mod $2 \cdot 3^{k - 1}$. Thus we have \[f(n + 3^k + 1) = f(n + 3^k) + 2^{f(n + 3^k)} = \dots = f(n + 1) + \sum_{i = 1}^{3^k} 2^{f(n + i)}\]\[ \equiv f(n + 1) + \sum_{i = 1}^{3^k} 2^{2i - 1} = f(n + 1) + \frac23\left(4^{3^k} - 1\right).\]But since \[\nu_3\left(\frac23\left(4^{3^k} - 1\right)\right) = \nu_3\left(4^{3^k} - 1\right) - 1 = k\]by LTE again, we obtain $\nu_3(f(n + 3^k + 1) - f(n + 1)) = k$. By similar arguments, for each $i = 1, 2, \dots, 3^k - 1$, the values $f(n + i), f(n + 2i), f(n + 3i)$ are in some order congruent to \[f(n + i), f(n + i) + 3^k, f(n + i) + 2 \cdot 3^k\]mod $3^{k + 1}$, which combined with the inductive hypothesis completes the induction. $\square$
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
mathwiz_1207
95 posts
#54
Y by
We will instead prove that for any $k \geq 1$, the sequence is periodic modulo $3^k$, with period exactly $3^k$. If $k = 1$, this is obviously true. Now, assume it is true for $k$, and notice that every term in the sequence is equivalent to $1 \pmod 2$. Thus, the sequence is in fact also periodic modulo $2 \cdot 3^k$, with period exactly $3^k$. Denote these residues as
\[a_1, a_2, \dots, a_{3^k}, a_1 , \dots \pmod {2 \cdot 3^k}\]Now, by Euler's theorem, we actually have that
\[f(n) \equiv f(n - 1) + 2^{a_{n-1}} \pmod {3^{k + 1}}\]Therefore,
\[f(n + 3^k) - f(n) \equiv 2^{a_1} + 2^{a_2} + \cdots + 2^{a_{3^k}} \pmod {3^{k + 1}}\]Since the order of $2$ is $2$, modulo $3$, by LTE we have
\[v_3(2^{2m} - 1) = 1 + v_3(m) \geq 3^{k + 1} \implies 3^k \mid m\]Therefore, $2$ is in fact a primitive root modulo $3^{k + 1}$, and since the $a_i's$ are odd,
\[2^{a_1} + 2^{a_2} + \cdots + 2^{a_{3^k}}\]covers every residue that is $2 \pmod 3$, so we in fact have
\[f(n + 3^k) - f(n) \equiv 2 + 5 + \cdots + 3^{k + 1} - 1 \equiv \frac{3^{k+1} + 1}{2} \cdot 3^k \pmod {3^{k + 1}}\]Thus, the smallest $a$ such that $f(n + a \cdot 3^k) - f(n) \equiv 0 \pmod {3^{k + 1}}$ is $3$, and we are done.
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
Maximilian113
550 posts
#55
Y by
We will show that for any $k \geq 1$ $f(n)$ has minimal period $3^k$ under modulo $3^k.$ We proceed with induction. The base case, $k=1,$ is trivial as $f(n)$ is odd so $2^{f(n)} \equiv -1 \pmod 3,$ and the sequence will always shift down by one.

Now, suppose that the proposition holds for some $k=r \geq 1.$ We show it for $k=r+1.$ By the inductive hypothesis, for nonnegative integers $\ell,$ $f(1+\ell 3^r), f(2+\ell 3^r), \cdots, f(3^r + \ell 3^r)$ is a complete residue system modulo $3^r.$ Apply this for $\ell=0, 1, 2$ so due to periodicity it suffices to show that $f(x), f(x+3^r), f(x+2 \cdot 3^r)$ are distinct modulo $3^{r+1}.$ But, since powers of $2$ repeat every $2 \cdot 3^r$ iterations mod $3^{r+1}$ by Euler's Theorem, it follows that by the inductive hypothesis, $$f(x+3^r) = 2^{f(x+3^r-1)}+2^{f(x+3^r-2)} + \cdots + 2^{f(x)} + f(x) \equiv f(x) + \left( 2^1+2^3+\cdots + 2^{2 \cdot 3^r-1} \right) \pmod {3^{r+1}}$$as $f(x)$ is always odd so by CRT $\{f(x+3^r-1), f(x+3^r-2), \cdots, f(x)\}$ is some permutation of the odd residues under mod $2\cdot 3^r.$ But $$v_3 \left( 2^1+2^3+\cdots+2^{2\cdot 3^r-1} \right) = v_3 \left( 2 \cdot \frac{4^{3^r}-1}{3} \right) = 3^r+1-1=3^r$$by LTE. Therefore $f(x),f(x+3^r), f(x+2 \cdot 3^r)$ are indeed distinct modulo $3^{r+1},$ so our induction is complete. Now the result follows. QED
This post has been edited 1 time. Last edited by Maximilian113, Apr 1, 2025, 7:59 PM
Reason: typo
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
cursed_tangent1434
597 posts
#56
Y by
Extremely long and patchy writeup. Threefold-induction does the trick. We show the more general claim that $f(1),f(2),\dots , f(3^n)$ leave distinct remainders when divided by $3^n$. To do this we employ induction. The result is obvious when $n=1$ since $f(1)=1$ , $f(2)=3$ and $f(3)=11$. Now say the result holds for some positive integer $n\ge 1$ and we shall show it for $n+1$. First of all, note that $f(i)$ is odd for all positive integers $i$ by induction. Each claim proved below is considered to be the inductive step in a proof via induction, the base case $n=1$ being clear. We first show the following key claim.

Claim : For all positive integers $r$, $f(r) \equiv f(3^n+r) \pmod{3^n}$.

Proof : We approach this via induction on $r$ (within the master induction on $n$), dual inductive the claim (and equivalently $3^n \mid f(r)+f(r+1)+\dots +f(3^n+r-1)$) and the statement that $3^n \mid 2^{f(r)}+2^{f(r+1)}+\dots + 2^{f(3^n+r-1)}$ for all $r \in \mathbb{N}$. The base cases are clear by the inductive hypothesis (of our master induction). Now, say the claim holds for some $r \ge 1$ we wish to show it holds for $r+1$.

Note,
\begin{align*}
        f(r+1)+\dots + f(3^n+r) & = f(r+1)+f(r+2)+\dots + f(3^n+r-1) + \\
        &\left(f(r)+2^{f(r)}+2^{f(r+1)}+\dots +2^{f(3^n+r-1)}\right)\\
        & \equiv f(r+1)+f(r+2)+\dots + f(3^n+r-1) + f(r) \pmod{3^n}\\
        & \equiv 0 \pmod{3^n}
    \end{align*}As a corollary it follows that,
\[f(r+1)+f(r+2)+\dots + f(3^n+r) \equiv f(r)+f(r+1)+\dots + f(3^n+r-1) \pmod{3^n}\]which implies $f(r) \equiv f(3^n+r) \pmod{3^n}$ as claimed. However, since $f(i)$ is odd for all $i \in \mathbb{N}$ by the Chinese Remainder Theorem it also follows that $f(r) \equiv f(3^n+r) \pmod{2\cdot 3^n}$.

Completing the induction,
\begin{align*}
        2^{f(r+1)}+2^{f(r+2)}+\dots + 2^{f(3^n+r)} & \equiv 3\left(2^1+2^3 + \dots + 2^{2\cdot 3^n-1}\right)\\
        & \equiv 6\left (1+2^2+\dots + 2^{2\cdot 3^n-2}\right)\\
        &= 2(4^{3^n}-1)\\
        &\equiv 0 \pmod {3^n}
    \end{align*}As $f(1),f(2),\dots , f(3^{n-1}$ are distinct $\pmod{2\cdot 3^{n-1}}$ and the inductive hypothesis (of the claim) for $n-1$ holds, and also by the Lifting the Exponent Lemma it follows that $\nu_3(4^{3^n}-1) = \nu_3(4-1)+\nu_3(3^n)=n+1 >n$.

Thus, both claims of the induction have been verified completing the inductive step and proving the claim.

Before we proceed there are some minor observations we need to make.

Claim : For all non-negative integers $m$,
\[\frac{4^{3^m}-1}{3} \equiv 3^{m} \pmod{3^{m+1}}\]
Proof : Once again, we show the result using induction on $m$. The base cases $m=0,1,2$ are quite easy to check. Now say the claim holds for $m \ge 2$ so we wish to show it for $m+1$. By the Inductive hypothesis we can write,
\[\frac{4^{3^m}-1}{3} = (3l+1)3^m\]for some positive integer $l$. Now note,
\begin{align*}
        \frac{4^{3^{m+1}}-1}{3} &= \frac{4^{3^m}-1}{3} \left(4^{2\cdot 3^m}+ 4^{3^m} + 1\right) \\
        &= (3l+1)3^m \left(4^{2\cdot 3^m}+ 4^{3^m} + 1\right) \\
        &= (3l+1)3^m\left((3^{m+1}l+3^m+1)^2 + (3^{m+1}l+3^m+1) + 1\right)\\
        & \equiv 3^m(3l+1)(3\cdot 3^{m+1}l+3\cdot 3^m+3) \pmod{3^{m+2}}\\
        & = 3^{m+1}(3l+1)(3^{m+1}l+3^m+1)\\
        & \equiv 3^{m+1}(3^{m+1}l+3^m+1) \pmod{3^{m+2}}\\
        & \equiv 3^{m+1} \pmod{3^{m+2}}
    \end{align*}which completes the induction and we are done.

Now comes the key result which allows us to complete the master induction.

Claim : For all positive integers $r$ in the range $1 \le r \le 3^n$ we have $f(3^n+r) \equiv 2\cdot 3^n+f(r) \pmod{3^{n+1}}$.

Proof : With all our preceding claims in hand this is but a minor computation,
\begin{align*}
        f(3^n+r) & = f(r)+2^{f(r)}+2^{f(r+1)}+ \dots + 2^{f(3^n+r-1)} \\
        & \equiv f(r)+2^1 + 2^3 + \dots + 2^{2\cdot 3^n-1}\pmod{3^{n+1}}\\
        & = f(r) + 2\left(1+2^2+\dots 2^{2\cdot 3^n-2}\right)\\
        & = f(r) + \frac{2(4^{3^n}-1)}{3}\\
        &\equiv  f(r) + 2\cdot 3^n \pmod{3^{n+1}}
    \end{align*}since $f(r),f(r+1),\dots , f(3^n+r-1)$ are distinct $\pmod{2\cdot 3^{n}}$ by our first claim, and Euler's Generalization of Fermat's Little Theorem.

But this immediately completes the master induction since $f(1),f(2),\dots , f(3^n)$ are distinct $\pmod{3^n}$ and by the above claim, $f(r),f(3^n+r),f(2\cdot 3^n+r)$ are distinct $\pmod{3^{n+1}}$ for all $1 \le r \le 3^n$ which implies that $f(1),f(2),\dots , f(3^{n+1})$ are distinct $\pmod{3^{n+1}}$ as desired.
Z K Y
N Quick Reply
G
H
=
a