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
k i Adding contests to the Contest Collections
dcouchman   1
N Apr 5, 2023 by v_Enhance
Want to help AoPS remain a valuable Olympiad resource? Help us add contests to AoPS's Contest Collections.

Find instructions and a list of contests to add here: https://artofproblemsolving.com/community/c40244h1064480_contests_to_add
1 reply
dcouchman
Sep 9, 2019
v_Enhance
Apr 5, 2023
k i Zero tolerance
ZetaX   49
N May 4, 2019 by NoDealsHere
Source: Use your common sense! (enough is enough)
Some users don't want to learn, some other simply ignore advises.
But please follow the following guideline:


To make it short: ALWAYS USE YOUR COMMON SENSE IF POSTING!
If you don't have common sense, don't post.


More specifically:

For new threads:


a) Good, meaningful title:
The title has to say what the problem is about in best way possible.
If that title occured already, it's definitely bad. And contest names aren't good either.
That's in fact a requirement for being able to search old problems.

Examples:
Bad titles:
- "Hard"/"Medium"/"Easy" (if you find it so cool how hard/easy it is, tell it in the post and use a title that tells us the problem)
- "Number Theory" (hey guy, guess why this forum's named that way¿ and is it the only such problem on earth¿)
- "Fibonacci" (there are millions of Fibonacci problems out there, all posted and named the same...)
- "Chinese TST 2003" (does this say anything about the problem¿)
Good titles:
- "On divisors of a³+2b³+4c³-6abc"
- "Number of solutions to x²+y²=6z²"
- "Fibonacci numbers are never squares"


b) Use search function:
Before posting a "new" problem spend at least two, better five, minutes to look if this problem was posted before. If it was, don't repost it. If you have anything important to say on topic, post it in one of the older threads.
If the thread is locked cause of this, use search function.

Update (by Amir Hossein). The best way to search for two keywords in AoPS is to input
[code]+"first keyword" +"second keyword"[/code]
so that any post containing both strings "first word" and "second form".


c) Good problem statement:
Some recent really bad post was:
[quote]$lim_{n\to 1}^{+\infty}\frac{1}{n}-lnn$[/quote]
It contains no question and no answer.
If you do this, too, you are on the best way to get your thread deleted. Write everything clearly, define where your variables come from (and define the "natural" numbers if used). Additionally read your post at least twice before submitting. After you sent it, read it again and use the Edit-Button if necessary to correct errors.


For answers to already existing threads:


d) Of any interest and with content:
Don't post things that are more trivial than completely obvious. For example, if the question is to solve $x^{3}+y^{3}=z^{3}$, do not answer with "$x=y=z=0$ is a solution" only. Either you post any kind of proof or at least something unexpected (like "$x=1337, y=481, z=42$ is the smallest solution). Someone that does not see that $x=y=z=0$ is a solution of the above without your post is completely wrong here, this is an IMO-level forum.
Similar, posting "I have solved this problem" but not posting anything else is not welcome; it even looks that you just want to show off what a genius you are.

e) Well written and checked answers:
Like c) for new threads, check your solutions at least twice for mistakes. And after sending, read it again and use the Edit-Button if necessary to correct errors.



To repeat it: ALWAYS USE YOUR COMMON SENSE IF POSTING!


Everything definitely out of range of common sense will be locked or deleted (exept for new users having less than about 42 posts, they are newbies and need/get some time to learn).

The above rules will be applied from next monday (5. march of 2007).
Feel free to discuss on this here.
49 replies
ZetaX
Feb 27, 2007
NoDealsHere
May 4, 2019
On existence of infinitely many positive integers satisfying
shivangjindal   22
N 18 minutes ago by atdaotlohbh
Source: European Girls' Mathematical Olympiad-2014 - DAY 1 - P3
We denote the number of positive divisors of a positive integer $m$ by $d(m)$ and the number of distinct prime divisors of $m$ by $\omega(m)$. Let $k$ be a positive integer. Prove that there exist infinitely many positive integers $n$ such that $\omega(n) = k$ and $d(n)$ does not divide $d(a^2+b^2)$ for any positive integers $a, b$ satisfying $a + b = n$.
22 replies
+1 w
shivangjindal
Apr 12, 2014
atdaotlohbh
18 minutes ago
standard Q FE
jasperE3   3
N an hour ago by ErTeeEs06
Source: gghx, p19004309
Find all functions $f:\mathbb Q\to\mathbb Q$ such that for any $x,y\in\mathbb Q$:
$$f(xf(x)+f(x+2y))=f(x)^2+f(y)+y.$$
3 replies
jasperE3
Apr 20, 2025
ErTeeEs06
an hour ago
Equations
Jackson0423   2
N an hour ago by rchokler
Solve the system of equations
\[
\begin{cases}
x - y z = 1,\\[2pt]
y - z x = 2,\\[2pt]
z - x y = 4.
\end{cases}
\]
2 replies
Jackson0423
5 hours ago
rchokler
an hour ago
Find all functions
Pirkuliyev Rovsen   2
N an hour ago by ErTeeEs06
Source: Cup in memory of A.N. Kolmogorov-2023
Find all functions $f\colon \mathbb{R}\to\mathbb{R}$ such that $f(a-b)f(c-d)+f(a-d)f(b-c){\leq}(a-c)f(b-d)$ for all $a,b,c,d{\in}R$


2 replies
Pirkuliyev Rovsen
Feb 8, 2025
ErTeeEs06
an hour ago
Circumcircle excircle chaos
CyclicISLscelesTrapezoid   25
N 2 hours ago by bin_sherlo
Source: ISL 2021 G8
Let $ABC$ be a triangle with circumcircle $\omega$ and let $\Omega_A$ be the $A$-excircle. Let $X$ and $Y$ be the intersection points of $\omega$ and $\Omega_A$. Let $P$ and $Q$ be the projections of $A$ onto the tangent lines to $\Omega_A$ at $X$ and $Y$ respectively. The tangent line at $P$ to the circumcircle of the triangle $APX$ intersects the tangent line at $Q$ to the circumcircle of the triangle $AQY$ at a point $R$. Prove that $\overline{AR} \perp \overline{BC}$.
25 replies
CyclicISLscelesTrapezoid
Jul 12, 2022
bin_sherlo
2 hours ago
hard problem
Cobedangiu   7
N 2 hours ago by arqady
Let $x,y,z>0$ and $xy+yz+zx=3$ : Prove that :
$\sum  \ \frac{x}{y+z}\ge\sum  \frac{1}{\sqrt{x+3}}$
7 replies
Cobedangiu
Apr 2, 2025
arqady
2 hours ago
Combo problem
soryn   2
N 2 hours ago by Anulick
The school A has m1 boys and m2 girls, and ,the school B has n1 boys and n2 girls. Each school is represented by one team formed by p students,boys and girls. If f(k) is the number of cases for which,the twice schools has,togheter k girls, fund f(k) and the valute of k, for which f(k) is maximum.
2 replies
soryn
Today at 6:33 AM
Anulick
2 hours ago
Calculate the distance of chess king!!
egxa   4
N 2 hours ago by Primeniyazidayi
Source: All Russian 2025 9.4
A chess king was placed on a square of an \(8 \times 8\) board and made $64$ moves so that it visited all squares and returned to the starting square. At every moment, the distance from the center of the square the king was on to the center of the board was calculated. A move is called $\emph{pleasant}$ if this distance becomes smaller after the move. Find the maximum possible number of pleasant moves. (The chess king moves to a square adjacent either by side or by corner.)
4 replies
egxa
Apr 18, 2025
Primeniyazidayi
2 hours ago
As some nations like to say "Heavy theorems mostly do not help"
Assassino9931   9
N 3 hours ago by EVKV
Source: European Mathematical Cup 2022, Senior Division, Problem 2
We say that a positive integer $n$ is lovely if there exist a positive integer $k$ and (not necessarily distinct) positive integers $d_1$, $d_2$, $\ldots$, $d_k$ such that $n = d_1d_2\cdots d_k$ and $d_i^2 \mid n + d_i$ for $i=1,2,\ldots,k$.

a) Are there infinitely many lovely numbers?

b) Is there a lovely number, greater than $1$, which is a perfect square of an integer?
9 replies
Assassino9931
Dec 20, 2022
EVKV
3 hours ago
congruence
moldovan   5
N 3 hours ago by EVKV
Source: Canada 2004
Let $p$ be an odd prime. Prove that:
\[\displaystyle\sum_{k=1}^{p-1}k^{2p-1} \equiv \frac{p(p+1)}{2} \pmod{p^2}\]
5 replies
moldovan
Jun 26, 2009
EVKV
3 hours ago
Checking a summand property for integers sufficiently large.
DinDean   1
N 3 hours ago by Double07
For any fixed integer $m\geqslant 2$, prove that there exists a positive integer $f(m)$, such that for any integer $n\geqslant f(m)$, $n$ can be expressed by a sum of positive integers $a_i$'s as
\[n=a_1+a_2+\dots+a_m,\]where $a_1\mid a_2$, $a_2\mid a_3$, $\dots$, $a_{m-1}\mid a_m$.
1 reply
DinDean
4 hours ago
Double07
3 hours ago
real+ FE
pomodor_ap   4
N 4 hours ago by jasperE3
Source: Own, PDC001-P7
Let $f : \mathbb{R}^+ \to \mathbb{R}^+$ be a function such that
$$f(x)f(x^2 + y f(y)) = f(x)f(y^2) + x^3$$for all $x, y \in \mathbb{R}^+$. Determine all such functions $f$.
4 replies
pomodor_ap
Yesterday at 11:24 AM
jasperE3
4 hours ago
FE solution too simple?
Yiyj1   8
N 4 hours ago by lksb
Source: 101 Algebra Problems from the AMSP
Find all functions $f: \mathbb{R} \rightarrow \mathbb{R}$ such that the equality $$f(f(x)+y) = f(x^2-y)+4f(x)y$$holds for all pairs of real numbers $(x,y)$.

My solution

I feel like my solution is too simple. Is there something I did wrong or something I missed?
8 replies
Yiyj1
Apr 9, 2025
lksb
4 hours ago
Polynomials in Z[x]
BartSimpsons   16
N 4 hours ago by bin_sherlo
Source: European Mathematical Cup 2017 Problem 4
Find all polynomials $P$ with integer coefficients such that $P (0)\ne  0$ and $$P^n(m)\cdot P^m(n)$$is a square of an integer for all nonnegative integers $n, m$.

Remark: For a nonnegative integer $k$ and an integer $n$, $P^k(n)$ is defined as follows: $P^k(n) = n$ if $k = 0$ and $P^k(n)=P(P(^{k-1}(n))$ if $k >0$.

Proposed by Adrian Beker.
16 replies
BartSimpsons
Dec 27, 2017
bin_sherlo
4 hours ago
f(n+1) = f(n) + 2^f(n) implies f(n) distinct mod 3^2013
v_Enhance   51
N Yesterday 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
Yesterday 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
331 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
596 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