Summer is a great time to explore cool problems to keep your skills sharp!  Schedule a class today!

G
Topic
First Poster
Last Poster
k a June Highlights and 2025 AoPS Online Class Information
jlacosta   0
Jun 2, 2025
Congratulations to all the mathletes who competed at National MATHCOUNTS! If you missed the exciting Countdown Round, you can watch the video at this link. Are you interested in training for MATHCOUNTS or AMC 10 contests? How would you like to train for these math competitions in half the time? We have accelerated sections which meet twice per week instead of once starting on July 8th (7:30pm ET). These sections fill quickly so enroll today!

[list][*]MATHCOUNTS/AMC 8 Basics
[*]MATHCOUNTS/AMC 8 Advanced
[*]AMC 10 Problem Series[/list]
For those interested in Olympiad level training in math, computer science, physics, and chemistry, be sure to enroll in our WOOT courses before August 19th to take advantage of early bird pricing!

Summer camps are starting this month at the Virtual Campus in math and language arts that are 2 - to 4 - weeks in duration. Spaces are still available - don’t miss your chance to have a transformative summer experience. 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 upcoming events:
[list][*]June 5th, Thursday, 7:30pm ET: Open Discussion with Ben Kornell and Andrew Sutherland, Art of Problem Solving's incoming CEO Ben Kornell and CPO Andrew Sutherland host an Ask Me Anything-style chat. Come ask your questions and get to know our incoming CEO & CPO!
[*]June 9th, Monday, 7:30pm ET, Game Jam: Operation Shuffle!, Come join us to play our second round of Operation Shuffle! If you enjoy number sense, logic, and a healthy dose of luck, this is the game for you. No specific math background is required; all are welcome.[/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, Jun 15 - Oct 12
Monday, Jun 30 - Oct 20
Wednesday, Jul 16 - Oct 29
Sunday, Aug 17 - Dec 14
Tuesday, Aug 26 - Dec 16
Friday, Sep 5 - Jan 16
Monday, Sep 8 - Jan 12
Tuesday, Sep 16 - Jan 20 (4:30 - 5:45 pm ET/1:30 - 2:45 pm PT)
Sunday, Sep 21 - Jan 25
Thursday, Sep 25 - Jan 29
Wednesday, Oct 22 - Feb 25
Tuesday, Nov 4 - Mar 10
Friday, Dec 12 - Apr 10

Prealgebra 2 Self-Paced

Prealgebra 2
Monday, Jun 2 - Sep 22
Sunday, Jun 29 - Oct 26
Friday, Jul 25 - Nov 21
Sunday, Aug 17 - Dec 14
Tuesday, Sep 9 - Jan 13
Thursday, Sep 25 - Jan 29
Sunday, Oct 19 - Feb 22
Monday, Oct 27 - Mar 2
Wednesday, Nov 12 - Mar 18

Introduction to Algebra A Self-Paced

Introduction to Algebra A
Sunday, Jun 15 - Oct 12
Thursday, Jun 26 - Oct 9
Tuesday, Jul 15 - Oct 28
Sunday, Aug 17 - Dec 14
Wednesday, Aug 27 - Dec 17
Friday, Sep 5 - Jan 16
Thursday, Sep 11 - Jan 15
Sunday, Sep 28 - Feb 1
Monday, Oct 6 - Feb 9
Tuesday, Oct 21 - Feb 24
Sunday, Nov 9 - Mar 15
Friday, Dec 5 - Apr 3

Introduction to Counting & Probability Self-Paced

Introduction to Counting & Probability
Sunday, Jun 1 - Aug 24
Thursday, Jun 12 - Aug 28
Wednesday, Jul 2 - Sep 17
Sunday, Jul 27 - Oct 19
Monday, Aug 11 - Nov 3
Wednesday, Sep 3 - Nov 19
Sunday, Sep 21 - Dec 14 (1:00 - 2:30 pm ET/10:00 - 11:30 am PT)
Friday, Oct 3 - Jan 16
Tuesday, Nov 4 - Feb 10
Sunday, Dec 7 - Mar 8

Introduction to Number Theory
Monday, Jun 9 - Aug 25
Sunday, Jun 15 - Sep 14
Tuesday, Jul 15 - Sep 30
Wednesday, Aug 13 - Oct 29
Friday, Sep 12 - Dec 12
Sunday, Oct 26 - Feb 1
Monday, Dec 1 - Mar 2

Introduction to Algebra B Self-Paced

Introduction to Algebra B
Wednesday, Jun 4 - Sep 17
Sunday, Jun 22 - Oct 19
Friday, Jul 18 - Nov 14
Thursday, Aug 7 - Nov 20
Monday, Aug 18 - Dec 15
Sunday, Sep 7 - Jan 11
Thursday, Sep 11 - Jan 15
Wednesday, Sep 24 - Jan 28
Sunday, Oct 26 - Mar 1
Tuesday, Nov 4 - Mar 10
Monday, Dec 1 - Mar 30

Introduction to Geometry
Monday, Jun 16 - Dec 8
Friday, Jun 20 - Jan 9
Sunday, Jun 29 - Jan 11
Monday, Jul 14 - Jan 19
Wednesday, Aug 13 - Feb 11
Tuesday, Aug 26 - Feb 24
Sunday, Sep 7 - Mar 8
Thursday, Sep 11 - Mar 12
Wednesday, Sep 24 - Mar 25
Sunday, Oct 26 - Apr 26
Monday, Nov 3 - May 4
Friday, Dec 5 - May 29

Paradoxes and Infinity
Mon, Tue, Wed, & Thurs, Jul 14 - Jul 16 (meets every day of the week!)

Intermediate: Grades 8-12

Intermediate Algebra
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
Friday, Aug 8 - Feb 20
Tuesday, Aug 26 - Feb 24
Sunday, Sep 28 - Mar 29
Wednesday, Oct 8 - Mar 8
Sunday, Nov 16 - May 17
Thursday, Dec 11 - Jun 4

Intermediate Counting & Probability
Sunday, Jun 22 - Nov 2
Sunday, Sep 28 - Feb 15
Tuesday, Nov 4 - Mar 24

Intermediate Number Theory
Sunday, Jun 1 - Aug 24
Wednesday, Jun 18 - Sep 3
Wednesday, Sep 24 - Dec 17

Precalculus
Sunday, Jun 1 - Nov 9
Monday, Jun 30 - Dec 8
Wednesday, Aug 6 - Jan 21
Tuesday, Sep 9 - Feb 24
Sunday, Sep 21 - Mar 8
Monday, Oct 20 - Apr 6
Sunday, Dec 14 - May 31

Advanced: Grades 9-12

Olympiad Geometry
Tuesday, Jun 10 - Aug 26

Calculus
Wednesday, Jun 25 - Dec 17
Sunday, Sep 7 - Mar 15
Wednesday, Sep 24 - Apr 1
Friday, Nov 14 - May 22

Group Theory
Thursday, Jun 12 - Sep 11

Contest Preparation: Grades 6-12

MATHCOUNTS/AMC 8 Basics
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!)
Sunday, Aug 17 - Nov 9
Wednesday, Sep 3 - Nov 19
Tuesday, Sep 16 - Dec 9
Sunday, Sep 21 - Dec 14 (1:00 - 2:30 pm ET/10:00 - 11:30 am PT)
Monday, Oct 6 - Jan 12
Thursday, Oct 16 - Jan 22
Tues, Thurs & Sun, Dec 9 - Jan 18 (meets three times a week!)

MATHCOUNTS/AMC 8 Advanced
Wednesday, Jun 11 - Aug 27
Sunday, Jun 22 - Sep 21
Tues & Thurs, Jul 8 - Aug 14 (meets twice a week!)
Sunday, Aug 17 - Nov 9
Tuesday, Aug 26 - Nov 11
Thursday, Sep 4 - Nov 20
Friday, Sep 12 - Dec 12
Monday, Sep 15 - Dec 8
Sunday, Oct 5 - Jan 11
Tues, Thurs & Sun, Dec 2 - Jan 11 (meets three times a week!)
Mon, Wed & Fri, Dec 8 - Jan 16 (meets three times a week!)

AMC 10 Problem Series
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!)
Sunday, Aug 10 - Nov 2
Thursday, Aug 14 - Oct 30
Tuesday, Aug 19 - Nov 4
Mon & Wed, Sep 15 - Oct 22 (meets twice a week!)
Mon, Wed & Fri, Oct 6 - Nov 3 (meets three times a week!)
Tue, Thurs & Sun, Oct 7 - Nov 2 (meets three times a week!)

AMC 10 Final Fives
Monday, Jun 30 - Jul 21
Friday, Aug 15 - Sep 12
Sunday, Sep 7 - Sep 28
Tuesday, Sep 9 - Sep 30
Monday, Sep 22 - Oct 13
Sunday, Sep 28 - Oct 19 (1:00 - 2:30 pm ET/10:00 - 11:30 am PT)
Wednesday, Oct 8 - Oct 29
Thursday, Oct 9 - Oct 30

AMC 12 Problem Series
Thursday, Jun 12 - Aug 28
Sunday, Jun 22 - Sep 21
Wednesday, Aug 6 - Oct 22
Sunday, Aug 10 - Nov 2
Monday, Aug 18 - Nov 10
Mon & Wed, Sep 15 - Oct 22 (meets twice a week!)
Tues, Thurs & Sun, Oct 7 - Nov 2 (meets three times a week!)

AMC 12 Final Fives
Thursday, Sep 4 - Sep 25
Sunday, Sep 28 - Oct 19
Tuesday, Oct 7 - Oct 28

AIME Problem Series A
Thursday, Oct 23 - Jan 29

AIME Problem Series B
Sunday, Jun 22 - Sep 21
Tuesday, Sep 2 - Nov 18

F=ma Problem Series
Wednesday, Jun 11 - Aug 27
Tuesday, Sep 16 - Dec 9
Friday, Oct 17 - Jan 30

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
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
Thursday, Aug 14 - Oct 30
Sunday, Sep 7 - Nov 23
Tuesday, Dec 2 - Mar 3

Intermediate Programming with Python
Sunday, Jun 1 - Aug 24
Monday, Jun 30 - Sep 22
Friday, Oct 3 - Jan 16

USACO Bronze Problem Series
Sunday, Jun 22 - Sep 1
Wednesday, Sep 3 - Dec 3
Thursday, Oct 30 - Feb 5
Tuesday, Dec 2 - Mar 3

Physics

Introduction to Physics
Sunday, Jun 15 - Sep 14
Monday, Jun 23 - Sep 15
Tuesday, Sep 2 - Nov 18
Sunday, Oct 5 - Jan 11
Wednesday, Dec 10 - Mar 11

Physics 1: Mechanics
Monday, Jun 23 - Dec 15
Sunday, Sep 21 - Mar 22
Sunday, Oct 26 - Apr 26

Relativity
Mon, Tue, Wed & Thurs, Jun 23 - Jun 26 (meets every day of the week!)
0 replies
jlacosta
Jun 2, 2025
0 replies
Divisors of number
RagvaloD   6
N 18 minutes ago by Assassino9931
Source: All Russian Olympiad 2017,Day2,grade 11,P7
There is number $N$ on the board. Every minute Ivan makes next operation: takes any number $a$ written on the board,
erases it, then writes all divisors of $a$ except $a$( Can be same numbers on the board). After some time on the board there are $N^2$ numbers.
For which $N$ is it possible?
6 replies
RagvaloD
May 1, 2017
Assassino9931
18 minutes ago
Beware the degeneracies!
Rijul saini   6
N an hour ago by sansgankrsngupta
Source: India IMOTC 2025 Day 1 Problem 1
Let $a,b,c$ be real numbers satisfying $$\max \{a(b^2+c^2),b(c^2+a^2),c(a^2+b^2) \} \leqslant 2abc+1$$Prove that $$a(b^2+c^2)+b(c^2+a^2)+c(a^2+b^2) \leqslant 6abc+2$$and determine all cases of equality.

Proposed by Shantanu Nene
6 replies
Rijul saini
Yesterday at 6:30 PM
sansgankrsngupta
an hour ago
IMO 2009, Problem 1
orl   141
N an hour ago by ND_
Source: IMO 2009, Problem 1
Let $ n$ be a positive integer and let $ a_1,a_2,a_3,\ldots,a_k$ $ ( k\ge 2)$ be distinct integers in the set $ { 1,2,\ldots,n}$ such that $ n$ divides $ a_i(a_{i + 1} - 1)$ for $ i = 1,2,\ldots,k - 1$. Prove that $ n$ does not divide $ a_k(a_1 - 1).$

Proposed by Ross Atkins, Australia
141 replies
orl
Jul 15, 2009
ND_
an hour ago
Minimization without derivative
Butterfly   2
N 2 hours ago by Butterfly

Find the minimum value of $f(x)=\frac{(3x+2)^4}{x(x+3)}$ on $(0,+\infty)$ without derivative.
2 replies
Butterfly
2 hours ago
Butterfly
2 hours ago
No more topics!
Just Sum NT
dchenmathcounts   41
N Apr 26, 2025 by Ilikeminecraft
Source: USEMO 2019/4
Prove that for any prime $p,$ there exists a positive integer $n$ such that
\[1^n+2^{n-1}+3^{n-2}+\cdots+n^1\equiv 2020\pmod{p}.\]Robin Son
41 replies
dchenmathcounts
May 24, 2020
Ilikeminecraft
Apr 26, 2025
Just Sum NT
G H J
Source: USEMO 2019/4
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
dchenmathcounts
2443 posts
#1 • 4 Y
Y by mathmax12, Sprites, Mango247, Mango247
Prove that for any prime $p,$ there exists a positive integer $n$ such that
\[1^n+2^{n-1}+3^{n-2}+\cdots+n^1\equiv 2020\pmod{p}.\]Robin Son
This post has been edited 2 times. Last edited by v_Enhance, Oct 25, 2020, 6:01 AM
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
pad
1671 posts
#2 • 10 Y
Y by slithy_tove, srijonrick, thedoge, mathmax12, mijail, cheaterzeta, Mango247, Mango247, Mango247, endless_abyss
Let $f(n)=1^n+2^{n-1}+\cdots+n^1$.

Lemma: $f(x+(p-1)) \equiv f(x) + [(x+1)^{p-1} + (x+2)^{p-2}+\cdots+(x+p-1)^1] \pmod p$.
Proof: Obvious by expanding $f(x+(p-1))$ and using FLT. $\square$

Key Claim: $f(x+p(p-1)) \equiv f(x)-1 \pmod{p}$.

Proof: Applying the lemma $p$ times gives
\begin{align*}
f(x+p(p-1)) &\equiv f(x) + [(x+1)^{p-1} + \cdots + (x+p-1)^1] + [(x+p)^{p-1} +\cdots + (x+2(p-1))^1 ] \\
&\qquad \ \ \ \  \  + \cdots \\
&\qquad \ \ \ \  \  + [(x+1+(p-1)^2)^{p-1} + \cdots + (x+p(p-1))^1 ] \\
&\equiv f(x) + [(x+1)^{p-1} + (x+p)^{p-1} + \cdots + (x+1+(p-1)^2)^{p-1}] \\
&\qquad \ \ \ \  \ + \cdots \\
&\qquad \ \ \ \  \ + [(x+p-1)^1 + (x+2p-2)^1 + \cdots + (x+p(p-1))^1 ] \pmod p
\end{align*}where the last step follows by regrouping. Call $S$ the mess after $f(x)$ above in mod $p$. We aim to show that $S\equiv -1\pmod p$. Each of the $p-1$ bracketed terms above is of the form
\[ (x+k)^{p-k} + (x+k+(p-1))^{p-k} + \cdots + (x+k+(p-1)^2)^{p-k}\]for $k=1,\ldots,p-1$. But since $\{x+k, x+k+(p-1), x+k+2(p-1), \ldots, x+k+(p-1)^2\}$ has each term increasing by $p-1$, this forms an entire residue class mod $p$. Therefore, each bracketed term is actually just
\[ 0^{p-k} + 1^{p-k} + \cdots + (p-1)^{p-k}. \]The entire sum is therefore
\begin{align*}
S &= \sum_{k=1}^{p-1} [0^{p-k} + \cdots + (p-1)^{p-k}] \\
&\equiv \sum_{\ell=0}^{p-1} [\ell^1 + \ell^2 +\cdots + \ell^{p-1}] \\
&\equiv \left[ \sum_{\substack{\ell=0 \\ \ell \neq 1}}^{p-1} \left[ \frac{\ell^p - \ell}{\ell-1} \right] \right] + [1^1+1^2+\cdots + 1^{p-1}] \\
&\equiv 0 + (p-1) \equiv -1 \pmod{p}
\end{align*}as desired. Note that the second step above followed by regrouping, the third by geometric series, and the last by FLT. This proves the claim. $\square$

The claim above proves that every residue $\pmod p$ is in the range of $f$, as we can iterate the claim to get all residues. Therefore, $2020 \pmod p$ is also in the range of $f$, 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.
dchenmathcounts
2443 posts
#3 • 1 Y
Y by mathmax12
Oops this was the only problem I did today.

Anyway, $n=2020p^3-4040p^2+2020p-1$ works.
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
Charmander3333
461 posts
#4 • 1 Y
Y by mathmax12
dchenmathcounts wrote:
Oops this was the only problem I did today.

Anyway, $n=2020p^3-4040p^2+2020p-1$ works.

lol this was my exact construction (and anything else congruent mod $p^3-p^2$)
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
Snowyowl2005
57 posts
#5 • 1 Y
Y by mathmax12
First Hint
Construction
Finish
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
AopsUser101
1750 posts
#6 • 3 Y
Y by CALCMAN, v4913, mathmax12
dchenmathcounts wrote:
Oops this was the only problem I did today.

Anyway, $n=2020p^3-4040p^2+2020p-1$ works.

How did you come up with this construction?
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
qwerty137
3575 posts
#7 • 1 Y
Y by mathmax12
Fast solution: Congruences here are $\pmod{p}$. Consider $n=kp(p-1)$ for some $k\in\mathbb{Z}^+$, motivated by the fact that some things here are periodic with period $p$ (bases) and $p-1$ (exponents). Observe that
$$\sum_{m=1}^{n} m^{n+1-m} = \sum_{i=0}^{k-1}\sum_{j=1}^{p^2-p}(i(p^2-p)+j)^{(k-i-1)(p^2-p)+(p^2-p-j)+1} \equiv k\sum_{j=1}^{p^2-p} j^{p^2-p-j+1}. $$Now, notice that, as all exponents are positive, and $p^n\equiv 0\pmod{p}$ for any $n\geq 1$,
$$ \sum_{j=1}^{p^2-p} j^{p^2-p-j+1} = \sum_{j_1=0}^{p-2}\sum_{j_2=1}^{p} (pj_1+j_2)^{p^2-p-pj_1-j_2+1} \equiv \sum_{j_2=1}^{p-1}\sum_{j_1=0}^{p-2} j_2^{p^2-p-j_1-j_2-1} \equiv \sum_{j_2=1}^{p-1}\sum_{r=0}^{p-2}(j_2)^r$$as $p^2-p-j_1-j_2-1$ will range over all residues mod $p-1$ as $j_1$ ranges over all residues mod $p-1$. Now, for $j_2>1$ the sum will be $\dfrac{j_2^{p-1}-1}{j_2-1}\equiv 0$, but for $j_2=1$ this sum will be $p-1$, so the whole thing is congruent to $p-1\pmod{p},$ so our original sum is congruent to $-k\pmod{p}$. Now set $k\equiv -2020\pmod{p}$.
This post has been edited 2 times. Last edited by qwerty137, May 24, 2020, 11:12 PM
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
Stormersyle
2786 posts
#8 • 2 Y
Y by mathmax12, Executioner230607
Let $f(n)=1^n+2^{n-1}+...+n^1$. It is well known that $1^k+...+(p-1)^k\equiv 0\pmod{p}$ if $p-1\nmid k$, and $-1$ if $p-1|k$. Thus, we can compute $f(p(p-1))\equiv \sum_{k=1}^{p-1} (1^k+...+(p-1)^k)\equiv -1\pmod{p}$. But also note $f(k(p-1)p)\equiv kf((p-1)p)\equiv -k\pmod{p}$, so we're done.
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
ghu2024
951 posts
#9 • 1 Y
Y by mathmax12
How many points will writing a non very through sketch that included FLT and geometric series get?
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
jj_ca888
2725 posts
#10 • 1 Y
Y by mathmax12
basicall replacing n with n+p(p-1) decreases by 1 in mod p so keep decreasing until get 2020
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
blacksheep2003
1081 posts
#11 • 3 Y
Y by mathmax12, Mango247, Mango247
Construction
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
dchenmathcounts
2443 posts
#12 • 3 Y
Y by mathmax12, Mango247, Mango247
Stormersyle wrote:
Let $f(n)=1^n+2^{n-1}+...+n^1$. It is well known that $1^k+...+(p-1)^k\equiv 0\pmod{p}$ if $p-1\nmid k$, and $-1$ if $p-1|k$. Thus, we can compute $f(p(p-1))\equiv \sum_{k=1}^{p-1} (1^k+...+(p-1)^k)\equiv -1\pmod{p}$. But also note $f(k(p-1)p)\equiv kf((p-1)p)\equiv -k\pmod{p}$, so we're done.

thank god, i was worried about the $1^k+\cdots+(p-1)^k$ summation
blacksheep2003 wrote:
Construction

seems wrong? what i posted above isn't a multiple of $p$
This post has been edited 1 time. Last edited by dchenmathcounts, May 24, 2020, 11:15 PM
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
franchester
1487 posts
#13
Y by
The case when $p=2$ is trivial. I claim that $n=ap(p-1)-1$ works, where $p|a+2020$. Denote the sum on the LHS by $S$. Take $S$ mod $p$, noting $p|n+1$: \[S=1^n+2^{n-1}+\cdots +n^1=\sum_{k=1}^n (n+k-1)^k\equiv \sum_{k=1}^n (-k)^k \pmod p\]We can ignore all multiples of $p$ since they vanish. Using FLT, we get \[S\equiv \sum_{k=1}^n (-k)^k=\sum_{k=1}^{p-1}(-k)^k+(-k-p)^{k+p}+\cdots +\left(-k-p\left(\frac{n+1}{p}-1\right)\right)^{k+p\left(\frac{n+1}{p}-1\right)}\]\[\implies S\equiv \sum_{k=1}^{p-1} (-k)^k+(-k)^{k+1}+\cdots +(-k)^{k+\left(\frac{n+1}{p}-1\right)} \pmod p\]Note that $k, k+1, \dots, k+\frac{n+1}{p}-1$ is a set of $\frac{n+1}{p}=a(p-1)$ consecutive integers. Thus, under $\mod p-1$, the exponents reduce to $a$ copies of the complete residue system mod $p-1$: \[\implies S\equiv a\cdot \sum_{k=1}^{p-1} (-k)^1+(-k)^2+\cdots +(-k)^{p-1}\equiv a\cdot \sum_{k=1}^{p-1} k^{1}+k^2+\cdots +k^{p-1} \pmod p\]where we get the last equality from the fact that $-1, -2, \cdots -(p-1)$ is a complete residue system mod $p$ excluding $0$. Rearranging, we get \[S\equiv a\cdot \sum_{k=1}^{p-1} 1^k+2^k+\cdots +(p-1)^k\pmod p\]However, the summand is well known to be $0$ mod $p$ if $p-1$ does not divide $k$, and $-1$ mod $p$ if $p-1$ divides $k$. Thus, \[S\equiv -a\equiv 2020\pmod p\]as desired.

I've seen the construction $ap(p-1)$ but without the minus one, so if anyone could proofread and let me know if I went wrong somewhere, it would be much appreciated :)
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
blacksheep2003
1081 posts
#14
Y by
dchenmathcounts wrote:
blacksheep2003 wrote:
Construction

seems wrong? what i posted above isn't a multiple of $p$

No, I'm pretty sure this works.

EDIT: Actually just checked, our constructions are two ways of saying the same thing :P
This post has been edited 2 times. Last edited by blacksheep2003, May 25, 2020, 12:16 AM
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
fukano_2
492 posts
#15
Y by
redacted
This post has been edited 2 times. Last edited by fukano_2, Oct 27, 2021, 10:39 AM
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
dchenmathcounts
2443 posts
#16
Y by
yeah but i think you have to take mod $p^3-p^2$

haven't actually checked your construction to see if it works though
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
blacksheep2003
1081 posts
#17
Y by
dchenmathcounts wrote:
yeah but i think you have to take mod $p^3-p^2$

haven't actually checked your construction to see if it works though

Wait, yeah, I just checked and our constructions are actually just two ways of saying the same thing lol :P
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
rocketscience
466 posts
#18 • 1 Y
Y by pad
pad wrote:
sol

OOH that's a pretty green
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
srijonrick
168 posts
#19 • 1 Y
Y by abhradeep12
pad wrote:
Key Claim: $f(x+p(p-1)) \equiv f(x)-1 \pmod{p}$.

Proof: Applying the lemma $p$ times gives
\begin{align*}
f(x+p(p-1)) &\equiv f(x) + [(x+1)^{p-1} + \cdots + (x+p-1)^1] + [(x+p)^{p-1} +\cdots + (x+2(p-1))^1 ] \\
&\qquad \ \ \ \  \  + \cdots \\
&\qquad \ \ \ \  \  + [(x+1+(p-1)^2)^{p-1} + \cdots + (x+p(p-1))^1 ] \\
&\equiv f(x) + [(x+1)^{p-1} + (x+p)^{p-1} + \cdots + (x+1+(p-1)^2)^{p-1}] \\
&\qquad \ \ \ \  \ + \cdots \\
&\qquad \ \ \ \  \ + [(x+p-1)^1 + (x+2p-2)^1 + \cdots + (x+p(p-1))^1 ] \pmod p
\end{align*}

Got it! :) Actually it's kind of a backward procedure (as I think) means
First we write $f(x+p(p-1))$ as $\underbrace{f(\underbrace{x+(p-1)^2}_{x'}+(p-1))}_{\text{this is of the form} f(x+(p-1))}$ then by applying the lemma we write it as

$f(x+p(p-1)) \equiv f(x+(p-1)^2)+[(x+1+(p-1)^2)^{p-1}+(x+2+(p-1)^2)^{p-2} + \dots + \underbrace{(x+(p-1)+(p-1)^2)^{1}}_{(x+p(p-1))^{1}}] \pmod p$

Then again we write $f(x+(p-1)^2)$ as $\underbrace{f(\underbrace{x+(p-1)(p-2)}_{x'}+(p-1))}_{\text{which is again of the form f(x+(p-1))}}$ and thus we can again apply the lemma and we continue with the process... :D
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
dchenmathcounts
2443 posts
#20 • 1 Y
Y by abhradeep12
Full solution from me.

We claim $n=2020p^3-4040p^2+2020p-1$ works. The main motivation is just playing around with the sum and some wishful thinking.

Say $n=(p-1)q+r$ for $0\leq r<p-1.$ Then note that the sum is equivalent to

$\begin{cases}
1^n+2^{n-1}+\cdots+(p-1)^{n-(p-2)}+ \\
p^{n-(p-1)}+(p+1)^{n-p}+\cdots+(2p-2)^{n-(2p-3)}+ \\
\cdots
\end{cases}$

and if we regroup by rows and apply Fermat's Little Theorem, is

$\leq r \pmod{p-1}
\begin{cases}
0^{n+1}+(p-1)^{n+1}+\cdots+((q-1)(p-1))^{n+1}+(q(p-1))^{n+1}+ \\
1^n+p^n+\cdots+((q-1)(p-1)+1)^n+(q(p-1)+1)^n+ \\
\cdots \\
r^{n+1-r}+(p-1+r)^{n+1-r}+\cdots+(q(p-1)+r)^{n+1-r}.
\end{cases}$

$>r \pmod{p-1}
\begin{cases}
(r+1)^{n-r}+(p-1+(r+1))^{n-r}+\cdots+((q-1(p-1)+(r+1))^{n-r}+\\
\cdots \\
(p-2)^{n+1-(p-2)}+\cdots+((q-1)(p-1)+(p-2))^{n+1-(p-2)}.
\end{cases}$

Now we take $\pmod{p}$ to get

$\leq r \pmod{p-1}
\begin{cases}
0^{n+1}+(-1)^{n+1}+\cdots+(-q)^{n+1}+ \\
1^n+0^n+(-1)^n+\cdots+(-q+1)^n+ \\
\cdots \\
r^{n+1-r}+(r-1)^{n+1-r}+(r-2)^{n+1-r}+\cdots+(-q+r)^{n+1-r}
\end{cases}$

$>r \pmod{p-1}
\begin{cases}
(r+1)^{n-r}+(r)^{n-r}+\cdots+(-q+1+(r+1))^{n-r}+ \\
\cdots \\
(p-2)^{n+1-(p-2)}+\cdots+(-q+1+(p-2))^{n+1-(p-2)}.
\end{cases}$

Now for some wishful thinking - what if we didn't have to worry about the difference between $\leq r\pmod{p-1}$ and $>r\pmod{p-1}?$ This motivates setting $r=p-2,$ so that there are no numbers between $0$ to $p-2$ inclusive that lie in the second category.

Note that

$0^k+1^k+\cdots+(p-1)^k\equiv
\begin{cases}
0 \text{ if }p-1\nmid k \\
-1 \text{ if }p-1| k
\end{cases}\pmod{p}.$

More wishful thinking - how can we apply this? By letting $q\equiv p-1\pmod{p}.$ Since all of the terms divisible by $p$ disappear, we're left with

$\frac{q+1}{p}\cdot
\begin{cases}
0^{n+1}+1^{n+1}+\cdots+(p-1)^{n+1}+\\
0^n+1^n+\cdots+(p-1)^n+\\
\cdots\\
0^{n+1-(p-2)}+1^{n+1-(p-2)}+\cdots+(p-1)^{n+1-(p-2)}.
\end{cases}$

Because $\{n,n-(p-1)-1,n-(p-1)-2,\ldots,n-(p-1)-(p-2)\}$ is a permutation of
$\{0,1,\ldots,p-1\}\pmod{p-1},$
this sum evaluates to $-\frac{q+1}{p}\pmod {p},$ since exactly one of the sums inside is congruent to $-1\pmod{p}.$

So we just need $-\left(\frac{q+1}{p}\right)\equiv 2020\pmod{p},$ or
\begin{align*}
-(q+1)&\equiv -2020p\pmod{p^2} \\
q&\equiv -2020p-1\pmod{p^2}.
\end{align*}Thus $q=2020p^2-2020p-1$ works, so
\begin{align*}
n &= (p-1)(2020p^2-2020p-1)+(p-2) \\
&= 2020p^3-2020p^2-p-2020p62+2020p+1+p-2
&= 2020p^3-4040p^2+2020p-1
\end{align*}suffices, as desired.
This post has been edited 1 time. Last edited by dchenmathcounts, Jun 9, 2020, 8:00 PM
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
math_pi_rate
1218 posts
#21 • 1 Y
Y by amar_04
Solution
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
TheUltimate123
1740 posts
#22
Y by
First recall this lemma:

Lemma: For primes \(p\) and integers \(k\), \[1^k+2^k+\cdots+(p-1)^k\equiv\begin{cases}-1&\text{if }p-1\mid k\\0&\text{otherwise.}\end{cases}\]
Proof. If \(p-1\mid k\), end by Fermat's little theorem. Else let \(g\) be a primitive root, and write \[1^k+\cdots+(p-1)^k\equiv1+g^k+\cdots+g^{(p-2)k}\equiv\frac{g^{(p-1)k}-1}{g^k-1}\equiv0\pmod p.\]\(\blacksquare\)

For convenience, set \[f(n):=1^n+2^{n-1}+\cdots+n^1.\]The main claim for this problem is this:

Claim: \(f(n+p(p-1))\equiv f(n)-1\pmod p\).

Proof. Direct computation: \begin{align*}         f(n+p(p-1))&=\left[1^{p(p-1)+n}+\cdots+n^{p(p-1)+1}\right]+\left[(n+1)^{p(p-1)}+\cdots+(n+p(p-1))^1\right]\\         &\equiv\left(1^n+\cdots+n^1\right)\\         &\qquad+\left[(n+1)^{p(p-1)}+n^{(p-1)^2}+(n-1)^{(p-2)(p-1)}+\cdots\right]\\         &\qquad+\left[(n+2)^{p(p-1)-1}+(n+1)^{(p-1)^2-1}+n^{(p-2)(p-1)-1}+\cdots\right]\\         &\qquad\;\vdots\\         &\equiv f(n)+\sum_{k=0}^{p-2}\left(1^k+\cdots+p^k\right)\\         &\equiv f(n)-1\pmod p.     \end{align*}\(\blacksquare\)

Thus \(f(n)\) is surjective modulo \(p\).
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
anonman
698 posts
#23
Y by
Solution
This post has been edited 1 time. Last edited by anonman, Aug 21, 2020, 7:07 PM
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
alexiaslexia
110 posts
#24
Y by
May seem just like a bunch of computations, but I like this problem because it reminds me of the old 2005 N6 idea that when you are given a $"\text{random}"$ exponent equation with a lot of fixed parameters and one $n$ which appears on the exponents and bases, then $\textbf{you have to utilize that n to its full potential.}$
$\color{green} \rule{25cm}{2pt}$
$\textcolor{blue}{\textbf{\text{Local computation up to a period of p(p-1).}}}$ We first count the value of the expression $\textit{when n is equal to p(p-1)}$, that
\[ \sum_{i=1}^{p(p-1)}i^{[p(p-1) + 1]-i} \equiv -1 \pmod p \]$\textcolor{blue}{\textbf{\text{Proof 1.}}}$ We categorize the $p(p-1)$ exponents according to their bases $\pmod p$. For $i \not\equiv 1 \pmod p$, we have
\begin{align*}
i^{p(p-1)+1-i} + {(i+p)}^{p(p-2)+1-i} + \ldots + {(i+p(p-2))}^{p+1-i} &\equiv i^{p(p-1)+1-i} + {i}^{p(p-2)+1-i} + \ldots + i^{p+1-i} \pmod p \\
&\equiv i^{1-i}+i^{-i}+i^{-1-i}+\ldots + i^{2-i} \pmod p \\
&\equiv i^{p-1}+i^{p-2}+\ldots+i^1 \pmod p\\
&\equiv \dfrac{i(i^{p-1}-1)}{i-1} \pmod p \\
&\equiv 0 \pmod p \\
\end{align*}with the third congruence to be true as the set $\{1-i,-i,\ldots,2-i\} = \{1,2,\ldots,p-1\}$ $\pmod p$ and the fifth because $p \mid i(i^{p-1}-1)$ and $p \nmid i-1$.
When $i \equiv 1 \pmod p$, it's easy to see that the expression
\[ i^{p(p-1)+1-i} + {(i+p)}^{p(p-2)+1-i} + \ldots + {(i+p(p-2)}^{p+1-i} \]is equal to $-1 \pmod p$. Summing them all yields the desired congruence. $\blacksquare$
$\color{red} \rule{25cm}{2pt}$
$\textcolor{red}{\textbf{\text{Finishing: global computation.}}}$ Now let $p - 2020 \equiv q \pmod p$, with $1 \leq q \leq p$. We will prove $n = q \cdot p(p-1)$ works.
However, note that we can divide the whole expression of $q\cdot p(p-1)$ terms into $q$ chunks of $p(p-1)$ perfect powers --- all of which are equivalent to the expression in $\textcolor{blue}{\textbf{\text{Local computation}}}$ above. In more detail, the term $i^{p(p-1)+1-i}$ will appear $q$ times, in the form of
\[ {(i)}^{q \cdot p(p-1)+1-i}, {\textcolor{red}{(}i+p(p-1)\textcolor{red}{)}}^{\textcolor{magenta}{(}(q-1) \cdot p(p-1)+1-i\textcolor{magenta}{)}}, \dots, {\textcolor{red}{(}i+(q-1)\cdot p(p-1)\textcolor{red}{)}}^{\textcolor{magenta}{(}p(p-1)+1-i\textcolor{magenta}{)}}
\]Then we are done, because the whole thing is congruent to $-q \equiv 2020 \pmod p.$ $\blacksquare$ $\blacksquare$ $\blacksquare$
Motivation: What period leads 2020 to appear in the RHS of the congruence?
This post has been edited 1 time. Last edited by alexiaslexia, Dec 9, 2020, 7:01 AM
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
lilavati_2005
357 posts
#25
Y by
Let $n = kp(p-1)$.
Take all the bases $\pmod p$. The original sum becomes :
\[1^{kp(p-1)} + 1^{kp(p-1) - p} + \cdots + 1^{kp(p-1) - p(p-2)} \quad + \]\[2^{kp(p-1) - 1} + 2^{kp(p-1) - (p+1)} + \cdots + 2^{kp(p-1)- (p(p-2) + 1)} \quad + \]\[.\]\[.\]\[.\]\[+ p-1^{kp(p-1) - (p-2)} + (p-1)^{kp(p-1) - (2p - 2)} + \cdots + (p-1)^{kp(p-1) - (p(p-2) - 2)}\]Note that there are exactly $k(p-1)$ terms of each base and they form a geometric progression with common ratio $p$ (from right to left).
The sum of each progression is $\frac{x(y^{kp(p-1)} -1)}{y^{p-1}}$ where $y \in \{2,\cdots, p-1\}$
and $x = y^{kp(p-1) - (p(p-2) - (y-1))}$. Since $\gcd{(y^{p-1},p)} = 1$, Fermat's Theorem gives :
\[\frac{x(y^{kp(p-1)} -1)}{y^{p-1}} \equiv 0 \pmod p\]If $y=1$, the sum of the geometric progression is just $k(p-1)$ and if $y=7$, the sum is $0$.
Hence the total sum if $k(p-1) \equiv -k \pmod p$.
We choose $k \equiv -2020 \pmod p$ which gives the desired result.
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
IAmTheHazard
5005 posts
#26 • 1 Y
Y by centslordm
Define $f(n)=1^n+2^{n-1}+\cdots + n^1$. We start with the lemma:

Lemma: For integer $k$, we have $f(kp(p-1)) \equiv kf(p(p-1)) \pmod{p}$.
Proof: First note that we trivially have $(a+mp)^b \equiv a^b \pmod{p}$ where $m$ is an integer. By FLT we also have $a^{b+n(p-1)} \equiv a^b \pmod{p}$ where $n$ is an integer. Then we have:
$$(a+mp)^{b+n(p-1)} \equiv a^{b+n(p-1)} \equiv a^b \pmod{p}$$so $f(kp(p-1))$ consists of $k$ copies of $f(p(p-1))$ in $\pmod{p}$, implying the desired result. $\blacksquare$

We now compute the value of $f(p(p-1)) \pmod{p}$. We have:
\begin{align*}
f(p(p-1))&=\sum_{i=1}^{p(p-1)} i^{p(p-1)+1-i}\\
&\equiv \sum_{i=1}^p \sum_{j=1}^{p-1} i^j\\
&=p-1+\sum_{i=2}^p \frac{i(i^{p-1}-1)}{i-1}\\
&\equiv -1+\sum_{i=2}^{p-1}\frac{i(i^{p-1}-1)}{i-1}\\
&\equiv -1
\end{align*}where we get the second equivalence by double counting, the third by geometric series formula, and the fifth by FLT.
To finish, we can take an integer $k$ such that $k \equiv -2020 \pmod{p}$. Then we have:
$$f(kp(p-1)) \equiv kf(p(p-1)) \equiv (-2020)(-1) \equiv 2020 \pmod{p}$$which is the desired congruence. $\blacksquare$
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
isaacmeng
113 posts
#27
Y by
USEMO 2019 P4. Prove that for any prime $p$ there exists a positive integer $n$ such that $1^n+2^{n-1}+\dots+n^1\equiv 2020\pmod {2020}$.

Solution. Take $n=p(p-1)(p-2020)$, then the sum is
\begin{align*}
\sum_{k=1}^n k^{n+1-k}&=\sum_{k=1}^{p(p-1)(p-2020)} k^{p(p-1)(p-2020)+1-k}\\&\equiv \sum_{k=1}^{p(p-1)(p-2020)} (k-\left\lfloor\frac{k}{p}\right\rfloor p)^{p(p-1)(p-2020)+1-\left\lfloor\frac{k}{p}\right\rfloor p-(k-\left\lfloor\frac{k}{p}\right\rfloor p)}\\&\equiv \sum_{k=1}^{(p-1)(p-2020)} \sum_{k-\left\lfloor\frac{k}{p}\right\rfloor p=1}^p (k-\left\lfloor\frac{k}{p}\right\rfloor p)^{p((p-1)(p-2020)-\left\lfloor\frac{k}{p}\right\rfloor)-(k-\left\lfloor\frac{k}{p}\right\rfloor p)}\\&\equiv \sum_{k-\left\lfloor\frac{k}{p}\right\rfloor p=1}^p \sum_{k=1}^{(p-1)(p-2020)} (k-\left\lfloor\frac{k}{p}\right\rfloor p)^{p((p-1)(p-2020)-\left\lfloor\frac{k}{p}\right\rfloor)-(k-\left\lfloor\frac{k}{p}\right\rfloor p)}\\&\equiv (p-2020)(p-1)+\sum_{k-\left\lfloor\frac{k}{p}\right\rfloor p=2}^{p-1} \sum_{k=1}^{(p-1)(p-2020)} (k-\left\lfloor\frac{k}{p}\right\rfloor p)^{p((p-1)(p-2020)-\left\lfloor\frac{k}{p}\right\rfloor)-(k-\left\lfloor\frac{k}{p}\right\rfloor p)}\\&\equiv 2020+\sum_{k-\left\lfloor\frac{k}{p}\right\rfloor p=2}^{p-1}\frac{(k-\left\lfloor\frac{k}{p}\right\rfloor p)^{p(p-1)(p-2020)-((k-\left\lfloor\frac{k}{p}\right\rfloor p)-1)}-(k-\left\lfloor\frac{k}{p}\right\rfloor p)^{p-((k-\left\lfloor\frac{k}{p}\right\rfloor p)-1)}}{(k-\left\lfloor\frac{k}{p}\right\rfloor p)^p-1}\\&\equiv 2020+\sum_{k-\left\lfloor\frac{k}{p}\right\rfloor p=2}^{p-1}\frac{(k-\left\lfloor\frac{k}{p}\right\rfloor p)^{1-((k-\left\lfloor\frac{k}{p}\right\rfloor p)-1)}-(k-\left\lfloor\frac{k}{p}\right\rfloor p)^{1-((k-\left\lfloor\frac{k}{p}\right\rfloor p)-1)}}{(k-\left\lfloor\frac{k}{p}\right\rfloor p)-1}\\&\equiv 2020\pmod p.
\end{align*}
This post has been edited 5 times. Last edited by isaacmeng, Apr 3, 2022, 7:30 AM
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
Sprites
478 posts
#28 • 1 Y
Y by srramanujan
Solution
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
HamstPan38825
8877 posts
#29 • 3 Y
Y by Mango247, Mango247, Mango247
First, observe that we can take all exponents mod $p-1$, because the order of any integer mod $p$ divides $p-1$. Then, we can also take all bases mod $p$. Hence, the desired sequence cycles every $p(p-1)$.

Consider any one of these length $p(p-1)$ groups. Every base is matched to every exponent exactly once -- in particular, if we let $S$ be the group, then $$S = 1^0+1^1+1^2+\cdots+1^{p-2}+2^0+2^1+\cdots+2^{p-2}+\cdots+(p-1)^0+(p-1)^1+\cdots$$$$+(p-1)^{p-2}+p^1+\cdots+p^{p-2}+p^{p-1}.$$This equals $$p-1 + \frac{2^{p-1}-2}{2-1} + \frac{3^{p-1}-3}{3-1} +\cdots + \frac{(p-1)^{p-1} - (p-1)}{p-2} \equiv 0 \pmod p,$$because $n^{p-1} \equiv 1$ for all $n$ relatively prime to $p$ by Fermat. Hence constructing $(p-2020) \pmod p$ such complete cycles gives us the desired result.
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
megarnie
5609 posts
#30
Y by
Let $f(n)=1^n+2^{n-1}+3^{n-2}+\cdots+n^1$.

Lemma 1: $f(p(p-1))\equiv-1\pmod p$.
Proof: Let $a_0=p^{(p-1)(p-1)}+2p^{p(p-1)-2p+1}+\ldots+p(p-1)^1, a_1= 1^{p(p-1)}+(p+1)^{p(p-1)-p}+(2p+1)^{p(p-1)-2p}+\ldots +((p-1)(p-1))^{p}, a_2=2^{p(p-1)-1}+(p+2)^{p(p-1)-p-1}+(2p+2)^{p(p-1)-2p-1}+\ldots+((p-1)(p-1)+1)^{p-1}, \ldots a_{p-1}=(p-1)^{p(p-1)-p+2}+(2p-1)^{p(p-1)-2p+2}+\ldots+(p(p-1)-1)^2$.

So $f(p(p-1))=a_0+a_1+\ldots+a_{p-1}$. Since we are adding $p-1$ terms in $a_1$ that are all $1\pmod p$, we have $a_1\equiv-1\pmod p$. Thus, it suffices to show that for all $i$ such that $i\ne 1$ and $0\le i \le p-1$, $a_i\equiv0\pmod p$. This is obviously true for $i=0$, so henceforth assume $1<i\le p-1$.

Note that, in $\pmod p$, we can rewrite $kp+i$ as $i$. We see that the exponents in $a_i$ cover each distinct residue $\pmod {p-1}$. Since (by FLT) $i^{p-1}\equiv1\pmod p$, the residue of $i^k$ is equal to the residue of $i^{k\pmod{p-1}}$.

Now, since we cover each residue $\pmod{p-1}$, $a_i\equiv i^0+i^1+i^2+\ldots+ i^{p-2}=\frac{i^{p-1}-1}{i-1} \pmod p$. Since $i-1$ is relatively prime to $p$ and $i^{p-1}-1\equiv0\pmod p$, $a_i\equiv0\pmod p$, as desired.


Lemma 2: $f(kp(p-1))\equiv -k\pmod p$.
Proof: Define $b_i$ similarly to $a_i$ in Lemma 1, but going all the way up to $kp(p-2)+i$ if $i>0$ or $kp(p-1)$ if $i=0$ so that $f(kp(p-1))=b_0+b_1+\ldots+b_{p-1}$.

In $b_1$, the terms we are adding are all $1\pmod p$, and there are $k(p-1)$ of them. This implies $b_1\equiv -k\pmod p$. Since it is trivial that $b_0\equiv0\pmod p$, it suffices to show that $b_i\equiv0\pmod p$, where $1<i\le p-1$.

We see that the exponents in $b_i$ cover each residue $\pmod{p-1}$ exactly $k$ times. By proceeding similarly to how we did in Lemma 1, we arrive at $b_i\equiv k\cdot 0=0\pmod p$.


Set $k$ such that $k>0$ and $k\equiv-2020\pmod p$, which implies $f(kp(p-1))\equiv2020\pmod p$.
This post has been edited 4 times. Last edited by megarnie, Mar 11, 2022, 11:41 PM
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
mijail
121 posts
#31
Y by
Good problem!

Suppose that $p>2$.
Define $f(n)=1^n+2^{n-1}+\cdots + n^1$. We can see this: $$f(pk)= \sum_{i=1}^p \sum_{r=0}^{k-1} i^{(p+1-i) + pr}$$By FLT we have that: $f(pk) \equiv \sum_{i=1}^p \sum_{r=0}^{k-1} i^{(p+1-i) + r} \pmod p$

Claim: We have that: $\sum_{r=0}^{l(p-1)-1} i^r \equiv 0 \pmod p$ if $i 	\not\equiv 1,0 \pmod  p$ .
Proof: By FLT we have: $$i^{l(p-1)} - 1 \equiv 0 \pmod p \implies (i-1)(1+i+ \dots + i^{l(p-1)-1}) \equiv 0 \pmod p \implies \sum_{r=0}^{l(p-1)-1} i^r \equiv 0 \pmod p $$This implies the claim. $\square$

Then suppose that $k \equiv 0 \pmod {p-1}$ so $f(pk) \equiv \sum_{i=1}^p \sum_{r=0}^{k-1} i^{(p+1-i) + r} \equiv \sum_{i=1}^p i^{p+1-i}\sum_{r=0}^{k-1} i^{ r}  \equiv k \pmod p$ by the Claim.

So if we take $k \equiv 2020 \pmod p$ and $k \equiv 0 \pmod {p-1}$ then $pk$ works. $\blacksquare$
This post has been edited 1 time. Last edited by mijail, Feb 16, 2022, 4:30 PM
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
#32
Y by
Let $f(n) = 1^n+2^{n-1}+\cdots + n^1$. Notice that modulo $p$, the bases of the integers in the sum $f(n)$ must cycle every $p$, though the exponents must cycle every $p - 1$ since $\text{ord}_{p}(d) \mid (p - 1)$ for any integer $d$ relatively prime to $p$. Therefore, we have $p(p - 1)$ as a "repeating block" for $f(n)$; that is, $f(ap(p - 1) \equiv a f(p(p - 1)) \pmod p$ for any positive integer $a$. Now, we look at $f(p(p - 1))$ modulo $p$ with the following claim:

Claim: $f(p(p - 1)) \equiv -1 \pmod p$.

Proof: Note that since the exponents within $f(p(p - 1))$ repeat every $p - 1$ for each base (where bases are taken modulo $p$), we can manipulate $f(p(p - 1))$ as follows: $$\begin{aligned} f(p(p - 1)) &\equiv (1^1 + 1^{2} + \cdots + 1^{p - 1 }) \\ & + (2^{1} + 2^{2} + \cdots + 2^{p - 1}) \\ &~\vdots \\ &+ ((p - 1)^1 + (p - 1)^{2} + \cdots + (p - 1)^{p - 1}) \\ &\equiv \sum_{i = 1}^{p - 1} \sum_{j = 1}^{p - 1} i^{j} \\ &\equiv (p - 1) +  \sum_{i = 2}^{p - 1} \frac{i (i^{p - 1} - 1)}{i - 1} \\ &\equiv p - 1\pmod p, \end{aligned}$$where $i^{p - 1} - 1 \equiv 0 \pmod p$ by Fermat's little theorem. Since $p - 1 \equiv -1 \pmod p$, this proves the claim. $\square$

Now, let $r$ be a positive integer such that $r \equiv -2020 \pmod p$. Combining the claim with our initial observations, we must have $s(rp(p - 1)) \equiv -2020 \cdot -1 \equiv 2020 \pmod p$, so we are done. $\blacksquare$

This post has been edited 2 times. Last edited by eibc, Apr 10, 2023, 8:37 PM
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
john0512
4191 posts
#33
Y by
The main idea of this problem is to consider the effect when $n$ is increased by $p-1.$

By FLT, none of the existing terms will change. However, we will gain $p-1$ new terms: $$(n+1)^{p-1}+(n+2)^{p-2}\cdots +(n+p-1)^1.$$This is what the residue $\pmod p$ will change by if $n$ is increased by $p-1$.

The trick is: perform this increase $p$ times. Then, since $p-1$ is relatively prime to $p$, each possible residue of $n\pmod p$ is the subject of the above expression $$(n+1)^{p-1}+(n+2)^{p-2}\cdots +(n+p-1)^1$$exactly once, since it's what $n$ is being increased from. Thus, to find the total change $\pmod{p}$, we sum this over all residues $n$. We will use the fact that the sum of the $m$th powers of the integers mod $p$ is 0 unless $m$ is divisible by $p-1$, in which case it is $-1$. This means that the sum of $$(n+1)^{p-1}+(n+2)^{p-2}\cdots +(n+p-1)^1$$when taking mod $p$ is just $-1$, since everything else vanishes.

Thus, increasing $n$ by $p(p-1)$ will decrease the residue by 1. Thus, by doing so some number of times, we can always reach any residue mod $p$, 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.
huashiliao2020
1292 posts
#34
Y by
This took me 4 hours even though I realized I simplified wrong and had to redo all of my double sums to make it easier :ewpu:
Attachments:
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
joshualiu315
2534 posts
#35
Y by
Denote the left hand side of the equation as $f(n)$.


Claim 1: $f(p(p-1)) \equiv -1 \pmod{p}$

Proof: Since the exponents in $f(p(p-1))$ cycle with the base in modulo $p$, we can manipulate it to get

\begin{align*}
  f(p(p-1)) &= 1^0 + 2^0 + \dots + (p-1)^0 \\
  &+ 1^1 + 2^1 + \dots + (p-1)^1 \\
  &+ 1^2 + 2^2 + \dots + (p-1)^2 \\
  &+ \dots \\
  &+ 1^{p-2} + 2^{p-2} + \dots + (p-1)^{p-2}.
\end{align*}
Then, use the well-known fact that

\[ \sum_{b=1}^{p-1} b^a \equiv
  \begin{cases} -1 & p-1 \mid a \\ 0 & p-1 \nmid a \end{cases}
  \pmod p \]
from which the claim follows. $\square$


Claim 2: $f(cp(p-1)) \equiv  c \cdot f(p(p-1)) \pmod{p}$

Proof: Notice that

\[(a+mp)^b \equiv a^b \pmod{p}, \ m \in \mathbb{Z} \ \textbf{ and } \ a^{b+n(p-1)} \equiv a^b \pmod{p}, \ n \in \mathbb{Z} \]\[\implies (a+mp)^{b+n(p-1)} \equiv a^b \pmod{p}, \ m,n \in \mathbb{Z}.\]
Hence, $f(cp(p-1))$ is equivalent to $c$ copies of $f(p(p-1))$ modulo $p$. $\square$


To finish, note that Claim 2 yields

\[f(cp(p-1)) \equiv -c \pmod{p},\]
implying that setting $c \equiv -2020 \pmod{p}$ would work. $\square$
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
dolphinday
1329 posts
#36
Y by
Since the period of the base$\pmod{p}$ is $p$, and the period of the exponent$\pmod{p}$ is $p-1$, the period of the LHS is $p(p - 1)$.

Let the LHS be $f(n)$.

Lemma:
It is well-known that $1^m + 2^m \dots {p-1}^m \equiv 0\pmod{p}$ if ${p-1} \nmid m$, and is $\equiv -1\pmod{p}$ if ${p-1} \mid m$.


Then $f(p(p-1)) \equiv $
\[1^0 + 2^0 \dots {p-1}^0\]\[1^1 + 2^1 \dots {p-1}^{1}\]\[1^2 + 2^2 \dots {p-1}^{2}\]\[\dots\]\[1^{p-1} + 2^{p-1} \dots {p-1}^{p-1}\].

By the Lemma, all rows except for the last one with exponents of $p-1$ vanish$\pmod{p}$, and the last row is $\equiv -1\pmod{p}$, so $f(p(p-1)) \equiv -1\pmod{p}$.

Since each cycle of $p(p-1)$ it is obvious that there is some $x$ so that $f(xp(p-1)) \equiv 2020\pmod{p}$.
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
Shreyasharma
685 posts
#37
Y by
Note that every $p$ terms, the bases cycle, whereas every $p - 1$ terms the exponent cycles. Then one ``complete cycle" of the terms modulo $p$ occurs every $p(p-1)$ terms. This motivates us to look at one such cycle, and evaluate it modulo $p$.

Claim: Each ``complete cycle" is congruent to $-1$ modulo $p$.
Proof. Note that we wish to evaluate,
\begin{align*}
1^{p(p-1)} + 2^{p(p-1) - 1} + \dots + (p(p-1) - 1)^2 + p(p-1) \pmod{p}
\end{align*}Thus consider the partition,
\begin{align*}
 1^{p(p-1)} + (p+1)^{p(p-2)} + &\dots + ((p-1)(p-1))^p\\
+ 2^{p(p-1) - 1} + (p+2)^{p(p-2) - 1} + & \dots + ((p-1)(p-1) +1)^{p-1}\\
&\vdots\\
+ (p-1)^{p(p-1) - p +2} + (2p - 1)^{p(p-2) - p + 2} + & \dots + (p(p-1) - 1)^2\\ 
+p^{p(p-1) - p + 1} + (2p)^{p(p-2) - p + 1} + &\dots + (p(p-1))^1
\end{align*}Now modulo $p$ this reduces to,
\begin{align*}
1^{p-1} + 1^{p-2} + &\dots + 1^2 + 1^1\\
2^{p-2} + 2^{p-3} + &\dots + 2^{1} + 2^{p-1}\\
&\vdots \\
(p-1)^{1} + (p-1)^{p-1} + &\dots + (p-1)^{3} + (p-1)^2\\
p^{p-1} + p^{p-2} + &\dots +p^2 + p^1
\end{align*}Now note that the last row simply vanishes. The first row simply evaluates as $p-1$ modulo $p$. For all other terms, say with base $a$, we may use the geometric series formula to evaluate the row as $\frac{a\left(a^{p-1} - 1\right)}{a-1}$. This is well defined modulo $p$ as the denominator is nonzero ie: $a \neq 1$. Now modulo $p$ the numerator is simply \[ a\left(a^{p-1} - 1\right) \equiv a\left(1 - 1 \right) \equiv 0 \pmod{p} \]Hence the expression as a whole is simple congruent to $p - 1 \equiv -1 \pmod{p}$ as claimed. $\square$

Now it is easy to see that we may find a value of $n$ such that our sequence is congruent to $-r \pmod{p}$ simply by choosing $n = pr(p-1)$. Thus we cover the whole residue class, and as a result may always find some $n$ such that the sum is congruent to $2020$ modulo $p$.

Remarks: The key idea is really that $2020$ is rather arbitrary and as such we should be able to cover the whole residue class. Now to look for some way to control the sequence we look for some $n$ such that we can easily evaluate the sequence. Then the easiest such value of $n$ is merely when the sequence repeats, or one ``complete cycle".
This post has been edited 1 time. Last edited by Shreyasharma, Jan 14, 2024, 8:02 PM
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
AlanLG
241 posts
#38
Y by
:coolspeak:
Note the bases $\pmod p$ cycles every $p$ terms, while the exponent every $p-1$ terms, so if the LHS is $f(n)$ then $f(cp(p-1))=cf(p(p-1))$, so it follows to evaluate $f(p(p-1))$
$\textcolor{blue}{\text{Claim }}$
\begin{align*}
f(p(p-1)) &\equiv  1^0 + 2^0 + \dots + (p-1)^0+p^0 \\
&+ 1^1 + 2^1 + \dots + (p-1)^1+p^1 \\
&+ 1^2 + 2^2 + \dots + (p-1)^2 +p^2\\
&+ \dots \\
&+ 1^{p-2} + 2^{p-2} + \dots + (p-1)^{p-2}+p^{p-2}.
\end{align*}
proof
$\textcolor{blue}{\text{Claim}}$
$$1^k+2^k+\cdots+ (p-1)^k\equiv \begin{cases}
-1  \hspace{0.3cm}p-1\mid k\\
0 \hspace{0.55cm}p-1\nmid k &
\end{cases} \pmod p$$proof
So every row expect for the first one is $0\pmod p$ so $f(p(p-1)\equiv -1\pmod p$, now take $c=-2020$ 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.
shendrew7
806 posts
#39
Y by
Note that the sequence $\{(x-k)^{y+k} \pmod p\}$ has period $p \cdot \phi(p) = p(p-1)$, so if we let $n=mp(p-1)$, our sum is congruent to
\[m \cdot \sum_{i=1}^{p(p-1)} i^{p(p-1)+1-i} \equiv m \cdot \sum_{i=0}^{p-1} \sum_{j=1}^{p-1} i^j \equiv m(p-1) \pmod p.\]
Since $\gcd(p,p-1)=1$, we always have a solution for $m$ to make the sum congruent to 2020. $\blacksquare$
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
peppapig_
280 posts
#40
Y by
Define $f(n)$ to be $1^n+\dots+n^1$. Since $2020$ is kind of close to the year, we assume it's an arbitrary number chosen by the writers just for funzies. Therefore, instead of only proving that $\exists n$ such that $f(n)\equiv 2020 \mod p$, we claim that this holds true for any integer $\mod p$. We will do this by showing the following claim holds true.

I claim that for any integer $c$, $f(cp(p-1))\equiv -c\mod p$. I will show this in two parts.

1. $f(cp(p-1)\equiv cf(p(p-1)) \mod p$.
Note that by Euler's Totient Theorem, we have that for any integer, it holds true that
\[a^k\equiv a^{k+p-1}\mod p.\]Therefore, note that
\[f(cp(p-1))=1^{cp(p-1)}+\dots+(p(p-1)+1)^{(c-1)p(p-1)}+\dots+(2p(p-1)+1)^{(c-2)p(p-1)}+\dots,\]\[\equiv (1^{p(p-1)}+\dots+((p(p-1))-1)^1)+(1^{p(p-1)}+\dots+((p(p-1))-1)^1)+\dots,\]\[\equiv c(1^{p(p-1)}+\dots+((p(p-1))-1)^1), \]\[\equiv cf(p(p-1))\mod p,\]which proves the first half of our claim.

2. $f(p(p-1))\equiv -1\mod p$.
Note that we have that
\[f(p(p-1))=1^{p(p-1)}+\dots+((p(p-1))-1)^1,\]which we can split into sums
\[1^{p(p-1)}+(p+1)^{p(p-2)}+\dots+(p(p-2)+1)^{p},\]\[\equiv 1+1+\dots \equiv p-1 \equiv -1 \mod p,\]and for all $2\leq k\leq p-1$,
\[k^{p(p-1)-k+1}+(p+k)^{p(p-2)-k+1}+\dots+(p(p-2)+k)^{p-k+1},\]\[\equiv (k^{p-k+1})(k^{p(p-2)}+k^{p(p-3)}+\dots+p^0),\]\[=(k^{p-k+1})\left(\frac{k^{p(p-1)}-1}{k^p-1}\right),\]\[\equiv (k^{p-k+1})(0) \equiv 0\mod p,\]and for all the multiples of $p$, a mod $0$. Summing these all together, we get a total of
\[f(p(p-1))\equiv p-1+0+0+\dots+0\equiv p-1\mod p,\]meaning that $f(p(p-1))\equiv -1\mod p$.

Finally, combining these two half claims together, we get that $f(cp(p-1))\equiv -c\mod p$, finishing the problem.

*Note: In fact, if you wanted an exact $n$ that works, using the fact that $f(cp(p-1))\equiv -c\mod p$, we find that the number $n=p(kp-2020)(p-1)=kp^3-kp^2-2020p^2+2020p$ yields a sum with $2020\mod p$ for any integer positive $k$ sufficiently large enough so that $kp\geq 2020$.
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
P2nisic
406 posts
#41
Y by
dchenmathcounts wrote:
Prove that for any prime $p,$ there exists a positive integer $n$ such that
\[1^n+2^{n-1}+3^{n-2}+\cdots+n^1\equiv 2020\pmod{p}.\]Robin Son

Consider $f(n)=1^n+2^{n-1}+3^{n-2}+\cdots+n^1$ and $g(a)_p=1+a^{-1}+...+a^{-(p-2)}(modp)$ then:
$f(n+p(p-1))=f(n)+\sum_{i=0}^{p-1}g(i)(modp)$

Consider now the invertion $a(modp)$ to be $b$ then we have:
$g(a)_p=1+a^{-1}+...+a^{-(p-2)}\equiv 1+b+b^2+...+b^{p-2}\equiv \frac{b^{p-1}-1}{b-1}\equiv 0,1(modp)$ with $1$ only if $p|b-1$ so $b=1$ so we get that:

$f(n+p(p-1))=f(n)+\sum_{i=0}^{p-1}g(i)=f(n)+\sum_{0}^{p-1}(1+i+...+i^{p-2})\equiv f(n)+p-1+\sum_{2}^{p-1}(1+i+...+i^{p-2})\equiv f(n)-1(modp)$
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.
Ilikeminecraft
684 posts
#42
Y by
I claim that $n = 2020p(p - 1)$ is a valid construction.

Define
\begin{align*}
	f(n) & = \sum_{i = 1}^n i^{n - i + 1} \\
	& = 1^n + 2^{n - 1} + \cdots + n^1
\end{align*}I claim that $f(p(p - 1)) \equiv -1 \pmod p$ where $p$ is a prime.

Let $g$ be a generator of the group $\mathbb Z/p\mathbb  Z.$ Also define $a_n$ such that $n = g^{a_n}.$ We can rearrange our sum based on the remainder modulo $p$:
\begin{align*}
	f(p(p - 1)) & \equiv \sum_{i = 1}^{p(p - 1)} i^{p(p - 1) - i + 1} \\
	& \equiv \sum_{i = 1}^{p - 1} \sum_{j = 1}^{p - 1} i^{1 - j} \\
	& \equiv p - 1 + \sum_{i = 2}^{p - 1} \sum_{j = 1}^{p - 1} g^{(1 - j)a_i} \\
	& \equiv p - 1 + \sum_{i = 2}^{p - 1} \sum_{j = 1}^{p - 1} g^{j} \\
	& \equiv -1
\end{align*}Finally, I claim that $f(cp(p - 1)) = cf(p(p - 1))$ where $c$ is an integer. This is obviously true because every $p(p - 1),$ the base and the exponent cycle. Thus, for a prime $p,$ $n = 2020p(p - 1)$ is a valid construction.
Z K Y
N Quick Reply
G
H
=
a