Contests & Programs AMC and other contests, summer programs, etc.
AMC and other contests, summer programs, etc.
3 M G
BBookmark  VNew Topic kLocked
Contests & Programs AMC and other contests, summer programs, etc.
AMC and other contests, summer programs, etc.
3 M G
BBookmark  VNew Topic kLocked
G
Topic
First Poster
Last Poster
k a My Retirement & New Leadership at AoPS
rrusczyk   1571
N Mar 26, 2025 by SmartGroot
I write today to announce my retirement as CEO from Art of Problem Solving. When I founded AoPS 22 years ago, I never imagined that we would reach so many students and families, or that we would find so many channels through which we discover, inspire, and train the great problem solvers of the next generation. I am very proud of all we have accomplished and I’m thankful for the many supporters who provided inspiration and encouragement along the way. I'm particularly grateful to all of the wonderful members of the AoPS Community!

I’m delighted to introduce our new leaders - Ben Kornell and Andrew Sutherland. Ben has extensive experience in education and edtech prior to joining AoPS as my successor as CEO, including starting like I did as a classroom teacher. He has a deep understanding of the value of our work because he’s an AoPS parent! Meanwhile, Andrew and I have common roots as founders of education companies; he launched Quizlet at age 15! His journey from founder to MIT to technology and product leader as our Chief Product Officer traces a pathway many of our students will follow in the years to come.

Thank you again for your support for Art of Problem Solving and we look forward to working with millions more wonderful problem solvers in the years to come.

And special thanks to all of the amazing AoPS team members who have helped build AoPS. We’ve come a long way from here:IMAGE
1571 replies
+1 w
rrusczyk
Mar 24, 2025
SmartGroot
Mar 26, 2025
k a March Highlights and 2025 AoPS Online Class Information
jlacosta   0
Mar 2, 2025
March is the month for State MATHCOUNTS competitions! Kudos to everyone who participated in their local chapter competitions and best of luck to all going to State! Join us on March 11th for a Math Jam devoted to our favorite Chapter competition problems! Are you interested in training for MATHCOUNTS? Be sure to check out our AMC 8/MATHCOUNTS Basics and Advanced courses.

Are you ready to level up with Olympiad training? Registration is open with early bird pricing available for our WOOT programs: MathWOOT (Levels 1 and 2), CodeWOOT, PhysicsWOOT, and ChemWOOT. What is WOOT? WOOT stands for Worldwide Online Olympiad Training and is a 7-month high school math Olympiad preparation and testing program that brings together many of the best students from around the world to learn Olympiad problem solving skills. Classes begin in September!

Do you have plans this summer? There are so many options to fit your schedule and goals whether attending a summer camp or taking online classes, it can be a great break from the routine of the school year. Check out our summer courses at AoPS Online, or if you want a math or language arts class that doesn’t have homework, but is an enriching summer experience, our AoPS Virtual Campus summer camps may be just the ticket! We are expanding our locations for our AoPS Academies across the country with 15 locations so far and new campuses opening in Saratoga CA, Johns Creek GA, and the Upper West Side NY. Check out this page for summer camp information.

Be sure to mark your calendars for the following events:
[list][*]March 5th (Wednesday), 4:30pm PT/7:30pm ET, HCSSiM Math Jam 2025. Amber Verser, Assistant Director of the Hampshire College Summer Studies in Mathematics, will host an information session about HCSSiM, a summer program for high school students.
[*]March 6th (Thursday), 4:00pm PT/7:00pm ET, Free Webinar on Math Competitions from elementary through high school. Join us for an enlightening session that demystifies the world of math competitions and helps you make informed decisions about your contest journey.
[*]March 11th (Tuesday), 4:30pm PT/7:30pm ET, 2025 MATHCOUNTS Chapter Discussion MATH JAM. AoPS instructors will discuss some of their favorite problems from the MATHCOUNTS Chapter Competition. All are welcome!
[*]March 13th (Thursday), 4:00pm PT/7:00pm ET, Free Webinar about Summer Camps at the Virtual Campus. Transform your summer into an unforgettable learning adventure! From elementary through high school, we offer dynamic summer camps featuring topics in mathematics, language arts, and competition preparation - all designed to fit your schedule and ignite your passion for learning.[/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, Mar 2 - Jun 22
Friday, Mar 28 - Jul 18
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
Tuesday, Mar 25 - Jul 8
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
Sunday, Mar 23 - Jul 20
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
Sunday, Mar 16 - Jun 8
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
Monday, Mar 17 - Jun 9
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
Sunday, Mar 2 - Jun 22
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
Tuesday, Mar 4 - Aug 12
Sunday, Mar 23 - Sep 21
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
Sunday, Mar 16 - Sep 14
Tuesday, Mar 25 - Sep 2
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
Sunday, Mar 23 - Aug 3
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
Sunday, Mar 16 - Aug 24
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
Wednesday, Mar 5 - May 21
Tuesday, Jun 10 - Aug 26

Calculus
Sunday, Mar 30 - Oct 5
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
Sunday, Mar 23 - Jun 15
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
Tuesday, Mar 4 - May 20
Monday, Mar 31 - Jun 23
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
Monday, Mar 24 - Jun 16
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
Sunday, Mar 30 - Jun 22
Wednesday, May 21 - Aug 6
Sunday, Jun 15 - Sep 14
Monday, Jun 23 - Sep 15

Physics 1: Mechanics
Tuesday, Mar 25 - Sep 2
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
Mar 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
2012 AIME II Problem 12
xHypotenuse   2
N 32 minutes ago by mathprodigy2011
Hello guys, I want to know what was wrong with my PIE approach.

First here's the problem:

For a positive integer $p$, define the positive integer $n$ to be $p$-safe if $n$ differs in absolute value by more than $2$ from all multiples of $p$. For example, the set of $10$-safe numbers is $\{ 3, 4, 5, 6, 7, 13, 14, 15, 16, 17, 23, \ldots\}$. Find the number of positive integers less than or equal to $10,000$ which are simultaneously $7$-safe, $11$-safe, and $13$-safe.


My approach was finding the number of 7-unsafe numbers, 11-unsafe, and 13-unsafe, then finding 77-unsafe, 91-unsafe, 143-unsafe, and finally 1001-unsafe numbers and using PIE for a complementary counting approach. But somehow I got a number over than 10,000 for the total number of unsafe numbers. Is my approach valid and have I made arithmetic errors or does the PIE approach just not work?
2 replies
xHypotenuse
an hour ago
mathprodigy2011
32 minutes ago
mdk2013
Sunday at 7:10 PM
mdk2013
38 minutes ago
Mop Qual stuff
HopefullyMcNats2025   57
N an hour ago by DottedCaculator
How good of an award/ achievement is making MOP, I adore comp math but am scared if I dedicate all my time to it I won’t get in a good college such as MIT or Harvard
57 replies
+1 w
HopefullyMcNats2025
Sunday at 11:23 PM
DottedCaculator
an hour ago
Impossible to search, classic graph problem
AshAuktober   1
N an hour ago by Filipjack
Source: Classic
Prove that any graph $G=(V,E)$ with $|V|=|E|-1$ has at least two cycles in it.
1 reply
AshAuktober
Sunday at 5:19 PM
Filipjack
an hour ago
2025 Math and AI 4 Girls Competition: Win Up To $1,000!!!
audio-on   15
N an hour ago by stuffedmath
Join the 2025 Math and AI 4 Girls Competition for a chance to win up to $1,000!

Hey Everyone, I'm pleased to announce the dates for the 2025 MA4G Competition are set!
Applications will open on March 22nd, 2025, and they will close on April 26th, 2025 (@ 11:59pm PST).

Applicants will have one month to fill out an application with prizes for the top 50 contestants & cash prizes for the top 20 contestants (including $1,000 for the winner!). More details below!

Eligibility:
The competition is free to enter, and open to middle school female students living in the US (5th-8th grade).
Award recipients are selected based on their aptitude, activities and aspirations in STEM.

Event dates:
Applications will open on March 22nd, 2025, and they will close on April 26th, 2025 (by 11:59pm PST)
Winners will be announced on June 28, 2025 during an online award ceremony.

Application requirements:
Complete a 12 question problem set on math and computer science/AI related topics
Write 2 short essays

Prizes:
1st place: $1,000 Cash prize
2nd place: $500 Cash prize
3rd place: $300 Cash prize
4th-10th: $100 Cash prize each
11th-20th: $50 Cash prize each
Top 50 contestants: Over $50 worth of gadgets and stationary


Many thanks to our current and past sponsors and partners: Hudson River Trading, MATHCOUNTS, Hewlett Packard Enterprise, Automation Anywhere, JP Morgan Chase, D.E. Shaw, and AI4ALL.

Math and AI 4 Girls is a nonprofit organization aiming to encourage young girls to develop an interest in math and AI by taking part in STEM competitions and activities at an early age. The organization will be hosting an inaugural Math and AI 4 Girls competition to identify talent and encourage long-term planning of academic and career goals in STEM.

Contact:
mathandAI4girls@yahoo.com

For more information on the competition:
https://www.mathandai4girls.org/math-and-ai-4-girls-competition

More information on how to register will be posted on the website. If you have any questions, please ask here!


15 replies
audio-on
Jan 26, 2025
stuffedmath
an hour ago
The Tetrahedral Space Partition
jannatiar   4
N 2 hours ago by sami1618
Source: 2025 AlborzMO Day 2 P3
Is it possible to partition three-dimensional space into tetrahedra (not necessarily regular) such that there exists a plane that intersects the edges of each tetrahedron at exactly 4 or 0 points?

Proposed by Arvin Taheri
4 replies
jannatiar
Mar 9, 2025
sami1618
2 hours ago
digit sum of squares
miiirz30   2
N 2 hours ago by megarnie
Source: 2025 Euler Olympiad, Round 1
Let $s(n)$ be the final value obtained after repeatedly summing the digits of $n$ until a single-digit number is reached. (For example: $s(187) = 7$, because the digit sum of $187$ is $16$ and the digit sum of $16$ is $7$). Evaluate the sum:
$$ s(1^2) + s(2^2) + s(3^2) + \ldots + s(2025^2)$$
Proposed by Lia Chitishvili, Georgia
2 replies
miiirz30
6 hours ago
megarnie
2 hours ago
My problem
hacbachvothuong   5
N 2 hours ago by ektorasmiliotis
Let $a, b, c$ be positive real numbers such that $ab+bc+ca=3$. Prove that:
$\frac{a^2}{a^2+b+c}+\frac{b^2}{b^2+c+a}+\frac{c^2}{c^2+a+b}\ge1$
5 replies
hacbachvothuong
Mar 29, 2025
ektorasmiliotis
2 hours ago
Infinite primes dividing polynomial sequence
L567   5
N 3 hours ago by ihategeo_1969
Source: STEMS Mathematics 2023 Category B P1
Suppose $f$ is a nonconstant polynomial with integer coefficients with the following property:
[list]
[*]$f(0)$ and $f(1)$ are both odd.
[*]Define a sequence of integers with $a_k = f(1)f(2) \cdots f(k)+1$
[/list]
Prove that there are infinitely many prime numbers dividing at least one element of the sequence.

Proposed by Sayandeep Shee
5 replies
L567
Jan 8, 2023
ihategeo_1969
3 hours ago
ratio close to pi
miiirz30   1
N 3 hours ago by RagvaloD
Source: 2025 Euler Olympiad, Round 1
Let $S$ be the set of non-negative integer powers of $3$ and $5$, $S = \{1, 3, 5, 3^2, 5^2, \ldots \}$. For every $a$ and $b$ in $S$ satisfying $$ \left| \pi - \frac{a}{b} \right| < 0.1 $$Find the minimum value of $ab$.

Proposed by Irakli Shalibashvili, Georgia
1 reply
miiirz30
6 hours ago
RagvaloD
3 hours ago
Lines intersecting on the circumcircle (BxMO 2023, Problem 3)
Lepuslapis   15
N 3 hours ago by GeorgeMetrical123
Source: BxMO 2023, Problem 3
Let $ABC$ be a triangle with incentre $I$ and circumcircle $\omega$. Let $N$ denote the second point of intersection of line $AI$ and $\omega$. The line through $I$ perpendicular to $AI$ intersects line $BC$, segment $[AB]$, and segment $[AC]$ at the points $D$, $E$, and $F$, respectively. The circumcircle of triangle $AEF$ meets $\omega$ again at $P$, and lines $PN$ and $BC$ intersect at $Q$. Prove that lines $IQ$ and $DN$ intersect on $\omega$.
15 replies
Lepuslapis
May 6, 2023
GeorgeMetrical123
3 hours ago
weird functional equation
a2048   4
N 4 hours ago by jasperE3
Source: SaCrEd MoCk P24
Determine all functions $f : \mathbb{R}^+ \rightarrow \mathbb{R}^+$ such that $f(a)f(b)=f(a + bf(a))$
4 replies
a2048
Jun 10, 2020
jasperE3
4 hours ago
kissing circles
miiirz30   1
N 4 hours ago by Edward_Tur
Source: 2025 Euler Olympiad, Round 1
Three circles with radii $1$, $2$, and $3$ are pairwise tangent to each other. Find the radius of the circle that is externally tangent to all three of these circles.

Proposed by Tamar Turashvili, Georgia
1 reply
miiirz30
6 hours ago
Edward_Tur
4 hours ago
5-digit perfect square palindromes
miiirz30   2
N 5 hours ago by GreekIdiot
Source: 2025 Euler Olympiad, Round 1
Find all five-digit numbers that satisfy the following conditions:

1. The number is a palindrome.
2. The middle digit is twice the value of the first digit.
3. The number is a perfect square.


Proposed by Tamar Turashvili, Georgia
2 replies
miiirz30
Yesterday at 5:47 PM
GreekIdiot
5 hours ago
Double dose of cyanide on day 2
brianzjk   29
N Mar 28, 2025 by gladIasked
Source: USAMO 2023/5
Let $n\geq3$ be an integer. We say that an arrangement of the numbers $1$, $2$, $\dots$, $n^2$ in a $n \times n$ table is row-valid if the numbers in each row can be permuted to form an arithmetic progression, and column-valid if the numbers in each column can be permuted to form an arithmetic progression. For what values of $n$ is it possible to transform any row-valid arrangement into a column-valid arrangement by permuting the numbers in each row?
29 replies
brianzjk
Mar 23, 2023
gladIasked
Mar 28, 2025
Double dose of cyanide on day 2
G H J
Source: USAMO 2023/5
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
brianzjk
1201 posts
#1 • 2 Y
Y by kred9, v4913
Let $n\geq3$ be an integer. We say that an arrangement of the numbers $1$, $2$, $\dots$, $n^2$ in a $n \times n$ table is row-valid if the numbers in each row can be permuted to form an arithmetic progression, and column-valid if the numbers in each column can be permuted to form an arithmetic progression. For what values of $n$ is it possible to transform any row-valid arrangement into a column-valid arrangement by permuting the numbers in each row?
This post has been edited 1 time. Last edited by brianzjk, Mar 23, 2023, 11:35 PM
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
brianzjk
1201 posts
#2 • 1 Y
Y by centslordm
The answer is Click to reveal hidden text

I'll edit in a solution later oops
This post has been edited 1 time. Last edited by brianzjk, Mar 23, 2023, 10:24 PM
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
BobsonJoe
811 posts
#3 • 1 Y
Y by rayfish
I claim that the answer is $\boxed{\text{all prime n}}$.

If $n$ is prime, note that all arithmetic progressions of length $n$ either are all the same $\pmod n$ or contain every residue $\pmod n$. Note that if one row has all the same residues, then no row can contain all the residues, since there are only $n$ numbers with the same residue less than $n^2$. Hence, if one row has all the same residues, then all the rows do. In this case, we can permute the rows such that the columns are (in some order)
\[\{k, k + n, k + 2n \cdots k + n^2 - n\}\]for all $0 < k \le n$. Otherwise, all rows have all different residues. In this case, sort all the rows, and the columns are (in some order)
\[\{1 + kn, 2 + kn, 3 + kn, \cdots, n + kn\}\]for all $0 \le k < n$. Hence, the statement is true for all prime $n$.

If $n$ is composite, write $n = ab$ and consider the construction
\[\begin{bmatrix}
1 & a + 1 & 2a + 1 & \cdots & a^2b - a + 1\\
2 & a + 2 & 2a + 2 & \cdots & a^2b - a + 2\\
3 & a + 3 & 2a + 3 & \cdots & a^2b - a + 3\\
\vdots & \vdots & \vdots & \ddots & \vdots\\
a & 2a & 3a & \cdots & a^2b\\
a^2b + 1 & a^2b + 2 & a^2b + 3 & \cdots & a^2b + ab\\
a^2b + ab + 1 & a^2b + ab + 2 & a^2b + ab + 3 & \cdots & a^2b + 2ab\\
\vdots & \vdots & \vdots & \ddots & \vdots\\
a^2b^2 - ab + 1 & a^2b^2 - ab + 2 & a^2b^2 - ab + 3 & \cdots & a^2b^2
\end{bmatrix}\]Suppose for the sake of contradiction that you can rearrange this table to be column-valid. Consider the arithmetic progression in the column containing $a + 1$. Let it's common difference be $d$. Note that for the $(a + 1)$th term to not be in the first row, we require
\[(a + 1) + a\cdot d > a^2b \implies d > ab - 1 - \frac 1a \implies d \geq ab - 1\]Since the $n$th term is at most $n^2$, we have
\[(a + 1) + (ab - 1) \cdot d \le a^2b^2 \implies d \le ab + 1 - \frac{1}{ab-1} \implies d \le ab\]Note that $d \neq ab$ because otherwise the second term would be in the first row. Hence, $d = ab-1$. However, we now have that the $n$th term is
\[(a + 1) + (ab-1)(ab-1) = a^2b^2 - 2ab + a + 2 = a^2b^2 - ab + 1 - (a(b-1) - 1) < a^2b^2 - ab + 1\]but then no terms can be from the last row. Hence, no column-valid rearrangement exists.
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
vsamc
3787 posts
#4 • 1 Y
Y by centslordm
I believe the statement should say "permuting the numbers in each row", since that makes much more sense than "permitting the numbers in each row". This was not on the USAJMO though, so I am not aware of the official wording.
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
brianzjk
1201 posts
#5 • 1 Y
Y by vsamc
I believe the statement should say "permuting the numbers in each row", since that makes much more sense than "permitting the numbers in each row". This was not on the USAJMO though, so I am not aware of the official wording.

You're right, I made a typo lol
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
IAmTheHazard
5000 posts
#6 • 1 Y
Y by centslordm
BobsonJoe wrote:
Note that for the $(a + 1)$th term to not be in the first row...

I strongly believe that a (short) justification of why this term exists is necessary for a solution to be considered complete. In particular, this is because if $n$ is prime then such a term will not actually exist because $b=1$, which turns out to be the only point in most solutions (?) where $b>1$ is actually used.

Another issue with the solution: what if some term, like $2$, comes before $a+1$ in its column after rearrangement? If you work with $2$ or $a$ instead, I believe this issue becomes side-steppable if you just take the term $a$ after $2$ or $a$, rather than the $a+1$-th term in general. I would not be surprised to see a similar fix be possible for $a+1$, but currently the step where you obtain $d \leq ab$ is flawed, since the assumption that $a+1$ is the first term in its sequence makes the bound stronger.

Edit: to be clear (not saying anyone misinterpreted) the construction itself does work but the proof of why it does is a bit off.
This post has been edited 5 times. Last edited by IAmTheHazard, Mar 24, 2023, 2:18 PM
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
jj_ca888
2726 posts
#7 • 1 Y
Y by sargamsujit
Proof for all $n = p$ prime work (constructions provided above, and I am lazy):

Weight cell with $k$ by $x^k$, with $x$ to be varied. Say that row $i$ consists of the arithmetic sequence (without any particular order) $a_i + xd_i$ as $x$ ranges from $0$ to $p-1$.

Then, summing across all squares,\[x(1 + x + \ldots + x^{n^2 - 1}) = \sum_{i = 1}^p x^{a_i}(1 + (x^{d_i}) + \ldots + (x^{d_i})^{p-1}).\]Vary $x$ across the $p$th roots of unity that aren't $1$. Then, we have\[0 = \sum x^{a_i}\]across all $i$ for which $p \mid d_i$. Let $b_i$ be $a_i$ mod $p$, and are thus restricted to $< p$, so $0 = \sum x^{b_i}$. This polynomial has roots which are $p$th roots of unity not equal to $1$, hence $1 + x + \ldots + x^{p-1}$ divides this polynomial, which has degree at most $p-1$ since $b_i$ are defined to be modulo values of $a_i$. So, this polynomial is either identically $0$, where each row is complete modulo residue class, or this polynomial is equal to $1 + x + \ldots + x^{p-1}$, where $p$ divides all $d_i$ and hence each row consists of the $p$ unique elements from $1$ to $p^2$ which are $b_i$ mod $p$.

So the configurations are actually pretty rigid. In the previous case, we can always rearrange the grid so that column $i$ consists of all numbers $i$ mod $p$ (clearly every column is then an arithmetic sequence with difference $p$), and in the latter case, we can just make column $i$ the consecutive numbers from $1 + (i-1)p$ to $ip$.

Construction is not too hard, something along the lines of what post $3$ did should work.
BobsonJoe wrote:
I claim that the answer is $\boxed{\text{all prime n}}$.

If $n$ is prime, note that all arithmetic progressions of length $n$ either are all the same $\pmod n$ or contain every residue $\pmod n$. Note that if one row has all the same residues, then no row can contain all the residues, since there are only $n$ numbers with the same residue less than $n^2$. Hence, if one row has all the same residues, then all the rows do. In this case, we can permute the rows such that the columns are (in some order)
\[\{k, k + n, k + 2n \cdots k + n^2 - n\}\]for all $0 < k \le n$. Otherwise, all rows have all different residues. In this case, sort all the rows, and the columns are (in some order)
\[\{1 + kn, 2 + kn, 3 + kn, \cdots, n + kn\}\]for all $0 \le k < n$. Hence, the statement is true for all prime $n$.

If $n$ is composite, write $n = ab$ and consider the construction
\[\begin{bmatrix}
1 & a + 1 & 2a + 1 & \cdots & a^2b - a + 1\\
2 & a + 2 & 2a + 2 & \cdots & a^2b - a + 2\\
3 & a + 3 & 2a + 3 & \cdots & a^2b - a + 3\\
\vdots & \vdots & \vdots & \ddots & \vdots\\
a & 2a & 3a & \cdots & a^2b\\
a^2b + 1 & a^2b + 2 & a^2b + 3 & \cdots & a^2b + ab\\
a^2b + ab + 1 & a^2b + ab + 2 & a^2b + ab + 3 & \cdots & a^2b + 2ab\\
\vdots & \vdots & \vdots & \ddots & \vdots\\
a^2b^2 - ab + 1 & a^2b^2 - ab + 2 & a^2b^2 - ab + 3 & \cdots & a^2b^2
\end{bmatrix}\]Suppose for the sake of contradiction that you can rearrange this table to be column-valid. Consider the arithmetic progression in the column containing $a + 1$. Let it's common difference be $d$. Note that for the $(a + 1)$th term to not be in the first row, we require
\[(a + 1) + a\cdot d > a^2b \implies d > ab - 1 - \frac 1a \implies d \geq ab - 1\]Since the $n$th term is at most $n^2$, we have
\[(a + 1) + (ab - 1) \cdot d \le a^2b^2 \implies d \le ab + 1 - \frac{1}{ab-1} \implies d \le ab\]Note that $d \neq ab$ because otherwise the second term would be in the first row. Hence, $d = ab-1$. However, we now have that the $n$th term is
\[(a + 1) + (ab-1)(ab-1) = a^2b^2 - 2ab + a + 2 = a^2b^2 - ab + 1 - (a(b-1) - 1) < a^2b^2 - ab + 1\]but then no terms can be from the last row. Hence, no column-valid rearrangement exists.

A different, working, argument for why your construction works:

Focus on the number $a^2b + ab$. If the column it's in has difference $d < ab = n$, then another number in its row, $a^2 + ab - d$, would need to be in its column, which is not possible. If the column has difference $d > ab = n$, then no element in the next row can be in its column. If $d = ab = n$, then $a^2b + ab - 2d = a^2b - ab$ and $a^2 + ab - d = a^2b$, which are both in the row above it, must both be in its column, also impossible

Hence this construction works
This post has been edited 2 times. Last edited by jj_ca888, Mar 24, 2023, 2:14 PM
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
AwesomeYRY
579 posts
#8
Y by
hi (will edit sol in later :) )
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
BobsonJoe
811 posts
#9
Y by
IAmTheHazard wrote:
Another issue with the solution: what if some term, like $2$, comes before $a+1$ in its column after rearrangement? If you work with $2$ or $a$ instead, I believe this issue becomes side-steppable if you just take the term $a$ after $2$ or $a$, rather than the $a+1$-th term in general. I would not be surprised to see a similar fix be possible for $a+1$, but currently the step where you obtain $d \leq ab$ is flawed, since the assumption that $a+1$ is the first term in its sequence makes the bound stronger.

OK I guess both bounds need some extra justification (which I don't remember if I wrote on the test oops), but it's pretty easy to fix, since if $a + 1$ is not the first term, then $d < ab$ anyways right? Hopefully just a 1 point dock? :o
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
oVlad
1721 posts
#10 • 1 Y
Y by gvole
Quite nice! The answer is the prime numbers. Firstly, let us show that composite $n{}$ do not work.

Suppose that $n{}$ is composite. Let $p{}$ be a prime factor of $n{}$. On the first $p-1$ rows of the table, arrange the numbers $1,2,\ldots, n(p-1)$ in increasing order, from left to right, hence on the first line we have the numbers $1,2,\ldots,n$. On the last row, place the numbers $n^2-n+1,\ldots n^2$. The remaining $n(n-p)$ numbers are placed on the remaining $n-p$ lines according to their residue class modulo $n-p$.

Suppose moreover that we may permute the numbers in each row to get a column-valid configuration. Let $n^2-n+i$ be the number on the same column as $2{}$ and let $r{}$ be the common difference of the progression on that column. Evidently, $2{}$ and $n^2-n+i$ are the smallest and largest numbers on that column, so $n^2-n+i=(n-1)r$ so $i=2$ and $r=n$.

Thus, on that column we must have the numbers $2,2+n\ldots, 2+(n-1)n$ but as $2+n$ and $2+n\cdot n/p$ are congruent modulo $n-p$, we get a contradiction, since they must be on the same row, according to our construction. Consequently, all composite $n{}$ fail.

Now, let's show that the prime numbers $p{}$ work. Consider a row; its elements are $a,a+b,\ldots, a+(p-1)b$. These are either all congruent modulo $p{}$ or form a complete residue set modulo $p{}$. Hence, we have two cases.

The first case is that row $k$ contains all the numbers congruent to $\pi_k$ modulo $p{}$ for some permutation $\pi$ of $1,2,\ldots, p$. In this case, we may permute the numbers on each row so that each column is of the form $pi+1,pi+2,\ldots,p(i+1)$ in some order.

The second case is that on each row, the numbers form a complete residue set modulo $p{}$. That is, for each $k{}$ the numbers congruent to $k{}$ modulo $p$ lie on distinct rows. It is easy to observe that we can permute the numbers in each row so that for each index $i{}$ on the $i^{\text{th}}$ column we only have the numbers congruent to $i{}$ modulo $p{}$, done.

@below Good point. Anyway, I edited that part out since it wasn’t even necessary.
This post has been edited 3 times. Last edited by oVlad, Mar 27, 2023, 5:06 AM
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
v_Enhance
6870 posts
#11 • 4 Y
Y by oVlad, HamstPan38825, gvole, mathmax12
In the terminology of IZHO 2021/3 (which haunts me to this day), call a set of $p{}$ cells, no two of which are on the same row or column a rook.
Hehe, I'd really prefer rook set like in the original IZHO problem, a rook would usually refer to just a single one of the cells :P
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
VulcanForge
626 posts
#12
Y by
Answer is $n$ prime. To show $n=p$ works, note each row must be all the same or all different$\pmod{p}$. If all the rows are homogeneous$\pmod{p}$, just arrange each in increasing order to get a column-valid grid. On the other hand, if all the rows are completely heterogeneous$\pmod{p}$ then we can arrange them so that the columns are homogenous$\pmod{p}$, which makes a column-valid grid.

If $n=ab$ is not prime with $a,b>1$, then consider the row-valid grid (for convenience shift all the numbers down by $1$)
\begin{tabular}{|ccccc|}
\hline
$0$&$a$&$2a$&$\cdots$&$(ab-1)a$\\
$1$&$a+1$&$2a+1$&$\cdots$&$(ab-1)a+1$\\
$\vdots$&&&&$\vdots$\\
$a-1$&$2a-1$&$3a-1$&$\cdots$&$a^2b-1$\\
\hline
$a^2b$&$a^2b+1$&$a^2b+2$&$\cdots$&$a^2b+ab-1$\\
$a^2b+ab$&$a^2b+ab+1$&$a^2b+ab+2$&$\cdots$&$a^2b+2ab-1$\\
$\vdots$&&&&$\vdots$\\
$a^2b^2-ab$&$a^2b^2-ab+1$&$a^2b^2-ab+2$&$\cdots$&$a^2b^2-1$\\
\hline
\end{tabular}The claim is that $a^2b+ab-1$ cannot be part of an arithmetic progression with one person from every row. Indeed, if the common difference was less than $ab$ then there would be someone else in the same row, and if it were greater than $ab$ then we would skip the row below. And if the difference is exactly $ab$, then everything will be $-1\pmod{a}$, so we'll miss the top row.
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
Thapakazi
53 posts
#13 • 1 Y
Y by surpidism.
The answer is $n = p,$ where $p$ is a prime. We first show that it works.

Note that the sum of numbers in row-valid arrangement must be divisible by $p.$ Consider a row valid arrangement. The numbers in the row must have same remainder $($mod $ p)$, or $p$ distinct remainders $($mod $ p)$. If one row has same all same residues, then all row must have same residues too. If there is a row where there is at least two and at most $p-1$ values repeated, it is clear that the arrangement is not row- valid as the sum is not divisible by $p$. Hence, one can permute the numbers in each row so that each column has same residue $($mod $ p)$ or $p$ distinct remainders $($mod $ p)$.

If $n$ is composite, then let $p$ be a prime dividing $n$. First we prove following lemma:

Lemma : Let $a \geq 2$ be a positive integer. Then the arithmetic sequence $\{a, a+d, a+2d,\dots, a+(n-1)d\}$ is row/column valid if $d \leq n.$

Proof: Assume otherwise. Then, $d \geq n+1$, but notice

$$a + (n-1)d \geq 2 + (n-1)(n+1) = n^2 + 1 > n^2$$
a contradiction. Hence, the lemma. Now, consider the construction

\[\begin{bmatrix}
1 & p + 1 & 2p + 1 & \cdots & np - p + 1\\
2 & p + 2 & 2p + 2 & \cdots & np - p + 2\\
3 & p + 3 & 2p + 3 & \cdots & np - p + 3\\
\vdots & \vdots & \vdots & \ddots & \vdots\\
p & 2p & 3p & \cdots & np\\
np + 1 & np + p + 1 & np + 2p + 1 & \cdots & 2np - p + 1\\
np+2 & np + p + 2 & np + 2p + 2 & \cdots & 2np - p + 2\\
\vdots & \vdots & \vdots & \ddots & \vdots\\
n^2 - np + p & n^2 - np + 2p & n^2 - np + 3p & \cdots & n^2
\end{bmatrix}\]
Note that each row is row-valid. Assume for contradiction that there is some arrangement where we can transform it into column-valid. Consider the element, $2np - p +1$. Let $d$ be the common difference in the column-valid arrangement of $2np - p +1$. So by the lemma if smallest term of this column is greater than $1$ then $d \leq n$. But,

$$2np - p + 1 - d \geq 2np - p + 1 - n = np + (n-1)(p-1) > np.$$
Which is a contradiction, because it would mean $2np - p + 1 - d$ is in the same row as $2np - p  + 1.$

If first term is $1$ but $d \leq n$, the above inequality still holds.

If first term is $1$ and $d = n+1$, then

$$2np - p \equiv 0 \implies 3p \equiv 0 (mod\ n+1) \implies n+1|3p \implies n+1 \in \{1,3,p,3p\}.$$
But note that, as $p|n$ and $n \geq 3$, each of these cases dont work.

Thus, the construction works. And we are done.
This post has been edited 5 times. Last edited by Thapakazi, Mar 29, 2023, 7:31 PM
Reason: Error
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
wangadrian
8 posts
#14
Y by
Full solutions of USAMO 2023:
https://www.youtube.com/watch?v=Eqy0345YhoY

Full solutions of USAJMO 2023:
https://www.youtube.com/watch?v=TyVbbMxe7II
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
gghx
1069 posts
#15 • 1 Y
Y by sabkx
All the constructions for composite above seem roughly similar, I would like to check this much simpler one:

Suppose $n=xy$.
In the first $y$ rows, we only use numbers which are $\equiv 0 \pmod{x}$. This is possible for example $\{x,\cdots,nx\},\{(n+1)x,\cdots,2nx\},\cdots,\{((y-1)n+1)x,\cdots,ynx\}$.
In the next $y$ rows, we only use numbers which are $\equiv 1 \pmod{x}$. We keep going, until the last $y$ rows only use numbers which are $\equiv (x-1)\pmod{x}$.

This cannot be permutated to be column valid because any column would be $0,\cdots,0,1,\cdots,1,\cdots,x-1,\cdots,x-1\pmod{x}$, which is not an AP$\pmod{x}$, so it cannot be an AP.

Unrelated note: I love the title of this thread.
This post has been edited 1 time. Last edited by gghx, Apr 2, 2023, 5:49 AM
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
IAmTheHazard
5000 posts
#16 • 1 Y
Y by centslordm
gghx wrote:
All the constructions for composite above seem roughly similar, I would like to check this much simpler one:

Suppose $n=xy$.
In the first $y$ rows, we only use numbers which are $\equiv 0 \pmod{x}$. This is possible for example $\{x,\cdots,nx\},\{(n+1)x,\cdots,2nx\},\cdots,\{((y-1)n+1)x,\cdots,ynx\}$.
In the next $y$ rows, we only use numbers which are $\equiv 1 \pmod{x}$. We keep going, until the last $y$ rows only use numbers which are $\equiv (x-1)\pmod{x}$.

This cannot be permutated to be column valid because any column would be $0,\cdots,0,1,\cdots,1,\cdots,x-1,\cdots,x-1\pmod{x}$, which is not an AP$\pmod{x}$, so it cannot be an AP.

Unrelated note: I love the title of this thread.

It is an AP though? Congruent to 0,1,2,3,…,xy mod x after rearranging
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
#17
Y by
The answer is all prime $n$.

Proof that prime $n$ work: Suppose $n=p$ is prime. Then, let the arithmetic progressions in the $i$th row have least term $a_i$ and common difference $d_i$. For each cell with integer $k$, assign a monomial $x^k$. The sum of the monomials is \[ x(1+x+\ldots+x^{n^2-1}) = \sum_{i=1}^n x^{a_i}(1+x^{d_i}+\ldots+x^{(n-1)d_i}), \]where the LHS is obtained by summing over all cells and the RHS is obtained by summing over all rows. Let $S$ be the set of $p$th roots of unity that are not $1$; then, the LHS of the above equivalence vanishes over $S$ and the RHS is \[ \sum_{p \mid d_i} x^{a_i}. \]Reducing the exponents (mod $p$) in the above expression yields \[ f(x) := \sum_{p \mid d_i} x^{a_i \pmod{p}} = 0 \]when $x \in S$. Note that $\prod_{s \in S} (x-s)=1+x+\ldots+x^{p-1}$ is a factor of $f(x)$, and as $f$ has degree less than $p$, $f$ is either identically 0 or $f(x)=1+x+\ldots+x^{p-1}$.
  • If $f$ is identically 0, then $p$ never divides $d_i$. Thus, no two elements in each row are congruent $\pmod{p}$, so all residues are represented in each row. Now we can rearrange the grid so that column $i$ consists of all numbers $i \pmod{p}$, which works.
  • If $f(x)=1+x+\ldots+x^{p-1}$, then $p$ always divides $d_i$. It is clear that each $d_i$ must be $p$, so each row represents a single residue $\pmod{p}$. Thus, we can rearrange the grid so that column $i$ contains all consecutive numbers from $1 + (i-1)p$ to $ip$, which works.
All in all, any prime $n$ satisfies the hypotheses of the problem.

Proof that composite $n$ do not work: We present a general counterexample that shows that composite $n$ do not work. For composite $n$, let $n=ab$ for $a, b>1$. Construct the row-valid grid where
  • For $1 \le i \le a$, row $i$ consists of an increasing arithmetic progression with starting term $i$ and common difference $a$.
  • For $a+1 \le i \le ab$, row $i$ consists of an increasing arithmetic progression with starting term $(i-1)ab+1$ and common difference $1$.
Look at the term $a^2b+ab$; we claim it cannot be part of a column that has cells forming an arithmetic sequence after any appropriate rearranging. After such a rearrangment, if the column it is in has common difference $d<ab=n$, then $a^2+ab-d$ must also be in its column, which is impossible. If the column has difference $d > ab = n$, then no element in the next row can be in its column. If the common difference is $d = ab = n$, then $a^2b + ab - 2d = a^2b - ab$ and $a^2 + ab - d = a^2b$, which are both in the row above it, must both be in its column, which is impossible. Therefore, the grid is not column-valid after any rearrangement, which completes the proof.
This post has been edited 2 times. Last edited by Leo.Euler, Apr 19, 2023, 1:01 AM
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
pi_is_3.14
1437 posts
#18
Y by
Answer is primes.

Proof composite fail:

Take a prime $p \mid n$.

Note that a row-valid grid exists with first row $2, 2 + p, \dots, 2 + (n - 1)p$.

A construction is to have the following rows be
$$1, 1 + p, \dots, 1 + (n - 1)p$$$\vdots$
$$p, 2p, \dots, np$$
Now, for all numbers from $np + 1$ to $n^2$ simply place them in order in a row from left to right before moving to the next row. Note that this arrangement is not column valid as for this to happen, another arithmetic sequence must exist with 2 that shares none of the terms of
$2, 2 + p, \dots, 2 + (n - 1)p$.

Note that if such a sequence has common difference $d < n$, note that $2 + pd$ is found in both sequences. (If $d = 1$ it is still found since $p + 2 \le n$) $d = n$, note that $1 + n$ is in both sequences. $d > n$ is impossible by bounding. Therefore, this is impossible.

Proof primes work:

Consider a row-valid grid.

Case 1: Every row arithmetic sequence has common difference not equal to $n$
Note that since $n$ is prime, each sequence will cover all residues mod $n$. We can rearrange to form a column with all $0 \pmod n$ residues, $1 \pmod n$ residues, etc.

Case 2: 1 or more sequences have common difference $n$
I claim in this case, every sequence must have common difference $n$, which clearly works (1 through $n$ in column 1, $n + 1$ through $2n$ in column 2, etc.)
To prove the claim, consider 1 of these sequences with common difference $d \neq n$: $a, a + d, \dots$. Note that this covers every residue mod $n$ including a term of the row arithmetic sequence with common difference. Therefore, it's not possible to have a sequence with common difference $d \neq n$.
This post has been edited 3 times. Last edited by pi_is_3.14, Apr 29, 2023, 1:33 AM
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
Spectator
657 posts
#19 • 1 Y
Y by KevinYang2.71
Solved with hint from lrjr24

I think this works. If it doesn't please correct me.

We claim that the answer is all $n$ that are primes. First, we prove that all primes work.

Note that every single progression in a row, must have the same rate of change (this works for all $n$). For primes, we are forced to choose between two progressions because it's prime. We have either
\[\{\{1,2,3,\cdots, p\},\{p+1,p+2,\cdots, 2p\},\cdots, \{p^2-p+1,p^2-p+2,\cdots, p^2\}\}\]or
\[\{\{1,1+p,1+2p,\cdots, p^2-p+1\},\{2,2+p,2+2p,\cdots,p^2-p+2\}, \cdots, \{p,2p,\cdots p^2\}\}\]These obviously must both form row-valid and column-valid. Now, FTSOC, all composite $n$ have the given condition. Let $1, n \neq d | n $. Consider the row-valid arrangement.
\[\{\{1,1+d,1+2d,\cdots, 1+(n-1)(d))\}, \cdots, \{ (nd)(\frac{n}{d}-1)+d, (nd)(\frac{n}{d}-1)+2d, \cdots, n^2\}\}\}\]where the least value of each row are $\{1,2, \cdots, d, (nd)+1, (nd)+2, \cdots, (nd)+d, (nd)(2)+1, \cdots (nd)(2)+d, \cdots, (nd)(\frac{n}{d}-1)+1, \cdots (nd)(\frac{n}{d}-1)+d \}$.
Arrange the rows from least to greatest. Note that $k$-th term of row must form an arithmetic sequence with the $k$-th term of the next sequence. This is because otherwise it wouldn't satisfy the same rate of change rule. But, when we transition from $d \rightarrow e+1$, it must still have the same rate of change but $d \neq e$, so we have a contradiction.

remarks
This post has been edited 2 times. Last edited by Spectator, May 6, 2023, 5:06 PM
Reason: wrong construction
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
bryanguo
1032 posts
#20 • 2 Y
Y by ike.chen, crazyeyemoody907
took an embarassingly long amount of time...can't be doing this on the actual usamo
The answer is prime $n.$

We first show composite $n$ fail. Pick $p \mid n$ and consider the following construction: \[\begin{bmatrix}1 & 1+p & 1+2p &\dots &1+(n-1)p \\ 2 & 2+p & 2+2p &\dots &2+(n-1)p \\ &\vdots \\ p & 2p & 3p &\dots &np \\ np+1 & np+2 & np+3 &\dots &np+n \\ &\vdots \\ n^2-np+p & n^2-np+2p & n^2-np+3p &\dots &n^2\end{bmatrix}\]Consider an arithmetic sequence with $2.$ Let $d$ be the common difference. Then \[n^2 \leq 2+(n-1)d \implies d \leq \tfrac{n^2-2}{n-1}<n+1,\]so $d \leq n.$ But observe that if there were to be a column-valid arrangement, the term $2+pd$ would have to be contained in both the same row and same column as $2,$ which is absurd. It remains to show prime $n$ work.

There are two cases: if there do not exist rows with common difference $d=n,$ and if there do exist rows with common difference $d=n.$

Consider the former case. Since $n$ is prime, each row covers all residues modulo $n.$ Then, rearrange the rows so that each column comprises of numbers that are same modulo $n.$

Consider the latter case. In fact, this case implies that every row must have common difference $n.$ Observe that there are only $n$ numbers less than $n^2$ which have same residues modulo $n.$ Thus, if there is one row with common difference $d=n$ (that is, with all residues identical modulo $n$), than all other rows are also forced to have identical residues modulo $n,$ because it is impossible to generate a row with all different residues.
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
Jndd
1417 posts
#21
Y by
We claim that only primes work, so let's prove it.

First, if $n$ is some prime $p$, then we can take each number mod $p$ and the numbers in each row must be some permutation of $0, 1, \ldots, p-1$, so we can simply rearrange the rows so each column is the same mod $p$, which will make the grid column-valid.

Now we show a counterexample for $n$ not prime. Let the first row be $1, 2,\ldots, n$. Choose a proper divisor $d$ of $n$, and let the next $d$ rows have the starting number be $n+1, n+2, \ldots, n+d$ respectively, with common difference $d$, such that each number in each of the $d$ rows are the same mod $d$.

Consider the arithmetic sequence with $1$. The common difference must be $\geq n$ and $\leq n+1$ because $1+(n-1)=n$ is in the same row as $1$ and $1+(n+2)(n-1) = n^2 + (n-1) > n^2$ for all $n\geq 3$. Now we will show that the common difference can be neither $n$ nor $n+1$.

If the common difference is $n$, then we have $1+2n$ is in the sequence, but $1+n+d(\frac{n}{d})$, which is in the second row since $\frac{n}{d}\leq n-1$, but we can't have both $1+n$ and $1+2n$ in the same row.

If the common difference is $n+1$, then the sequence with $1$ works out. So now, we consider the sequence with $2$, where the common difference is either $n$ or $n-1$. The common difference can't be $n$ because the column with $1$ and the column with $2$ would both use $n+2$. Instead, if we choose $n-1$, then $2+(n-1)(d+1) = n+1 + d(n-1)$, which can't happen because $n+1$ and $2+(n-1)(d+1)$ would be in the same row.

Since we've checked all the cases, and found none of them possible, 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.
peace09
5417 posts
#22
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.
shendrew7
792 posts
#23
Y by
Our answer is $\boxed{\text{all primes}}$. When $n$ is prime, an arithmetic sequence with $n$ terms must will either contain all distinct or equal residues modulo $n$. Then it becomes clear that, once we select the first row to have either one of these properties, all other rows will share that property. If every row has all distinct residues, we can permute them so that each column has cells of equal residues and vice versa, thus producing a column-valid configuration.

We move on to proving $n=pk$ for a prime $p$ and $k>1$ won't hold. Consider a construction where we place the first $p^2k$ numbers in (rightwards) increasing order on rows based on residue modulo $p$, and place the remaining $p^2k^2-pk$ numbers underneath in (downwards) increasing order on columns based on residue modulo $p$. Through contradiction, use a bounding argument on the common difference of a sequence containing $p+1$ to show this arrangement cannot be made column-valid. $\blacksquare$
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
ATGY
2502 posts
#24
Y by
Great problem!

Claim 1: If $n$ is prime, it's satisfied. Firstly, take $k$ where $1 \leq k < n$. Now take the numbers:
$$k, k + d, k + 2d, \dots, k + (n - 1)d$$where $d$ denotes the common difference. Observe that $d \leq n$, which we can see by taking extreme ends of a row as $1$ and $n^2$, which yields:
$$1 + (n - 1)d = n^2 \implies (n - 1)(n + 1) = (n - 1)d \implies d = n + 1$$For any other arrangement, $d \leq n$. However, say 2 of these, $k + ad$, $k + a_1d$ (where $a_1 > a$, and $a_1 - a < n$) lie in the same row and $d < n$, it would take more than $n$ terms for $d$ to "get to" $a_1$ in time, which means $d \geq n \implies d = n$.

So, either $k, k + n, \dots, k + n(n - 1)$ lie in the same row or they all lie in different rows. If they lie in the same row, notice that they all have the same residue $\mod n$ ($k$), and there are $n$ numbers having this residue between $1$ and $n^2$, which means the row is taking up all these numbers, which implies each row will have numbers with the same residue $\mod n$. Rearranging them into columns with each column having the same residue, we are done.

If they lie in different rows, each row produces all distinct residues $\mod n$, so we simply rearrange them so that each column once again possesses the same residue $\mod n$. So we are done.

Claim 2: It doesn't work for composites. Take a composite number $n$, where $n = ab$, $1 < a \leq b < n$. Take the following construction:
\begin{tabular}{|ccccc|}
\hline
$1$ & $a+1$ & $2a+1$ & $\cdots$ & $(ab-1)a+1$ \\
$2$ & $a+2$ & $2a+2$ & $\cdots$ & $(ab-1)a+2$ \\
$\vdots$ & & & & $\vdots$ \\
$a$ & $2a$ & $3a$ & $\cdots$ & $a^2b$ \\
\hline
\end{tabular}We will have $b$ such tables continuing until we reach $a^2b^2$ in the bottom right. Notice that the common difference, $d \leq n$ (as mentioned earlier), and $d \leq n - 1$ as it would cause us to take too many terms in the first table, which means $d = n$. We know the terms are $a \mod{ab} \implies a \mid \text{terms of the A.P}$, however, all the terms in the first row are $1 \mod {a}$, which causes a contradiction. So we are done.
This post has been edited 1 time. Last edited by ATGY, Feb 11, 2024, 1:44 PM
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
Mogmog8
1080 posts
#25 • 1 Y
Y by centslordm
We claim that only primes work. For composites, consider the smallest prime factor of $n$, say $p$. Consider if the first row is $A=\{p,2p,3p,\dots,np\}$. If $a$ is the common difference in the column that $p$ is in after the transformation, then $p+ap>np$ or else $p+ap\in A$ which cannot occur. Hence, $a>n-1$ but note $a=n$ is also bad as $p+n\in A$. Hence, $a\ge n+1$ so the final element of the column is at least $p+(n-1)(n+1)=n^2+p-1>n^2$, absurd.

For primes, notice if $a$ and $a+p$ are in a row then the common difference $d$ of this row must divide $p$ so $d=1$ or $d=p$. In the former case the row is $a,a+1,\dots,a+p$ which has too many elements. In the latter case, the row is all numbers congruent to $a$ modulo $p$. Call such rows bland. On the other hand, if all elements of a row are distinct from each other modulo $p$, the row is a complete residue class modulo $p$. Call such rows tasty. Notice if we have a bland row, we cannot have any tasty rows and vice versa. Hence, we either have all bland rows or all tasty rows. Note from a bland configurations we can sort the columns to all be tasty and from a tasty configuration we can sort all columns to be bland. Thus, primes work. $\square$
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
HamstPan38825
8857 posts
#26
Y by
The answer is $n$ prime only.

Construction: Let $n=p$ be prime. We let $S_1, S_2, \dots$ denote the arithmetic progressions formed when row entries are ordered, and let $d_1, d_2, \dots$ be their common differences.

Claim. If $d_i = p$ for some $i$, then $d_i=p$ for all $j$.

Proof. Suppose $d_j \neq p$ for some $j$. Then there exists some element in $S_j$ that is $i$ mod $p$ as it has $p$ elements. This means $S_i$ and $S_j$ have nonempty intersection, contradiction. $\blacksquare$

In the case where $d_i = p$ for every $i$, we can permute the columns to read $(1, 2, \dots, p)$, $(p+1, p+2, \dots, 2p)$, and so on in some order.

If $d_i \neq p$ for all $i$, then we can permute the columns to read $(1, p+1, \dots)$, $(2, p+2, \dots)$ and so on in some order as no two elements in each row will ever differ by a multiple of $p$.

Restriction: Suppose that $n$ is composite, and fix some $p \mid n$. Let the rows read \[r_{qp+r} = (qpn+i, qpn+i+p, \dots, qpn+i+(n-1)p)\]for $1 \leq r \leq n$ and $0 \leq p \leq n-1$.

Then consider picking the arithmetic sequence that starts with $2$, which is in say row $R$. For any $d \leq n$ relatively prime to $p$, the number $dp + 2$ appears in $R$, implying that $d$ cannot be a common difference for this arithmetic sequence. For any $n \geq d = kp$ for some $k < n/p$, again the number $2+kp$ must show up in $R$, so this $d$ cannot be a valid common difference either.

Note that obviously $d < n+1$ by size. So such an arithmetic sequence cannot exist, contradiction.
This post has been edited 1 time. Last edited by HamstPan38825, Mar 17, 2024, 1:27 AM
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
dolphinday
1318 posts
#27
Y by
The answer is $n = p$ for all primes $p$.
For our construction, WLOG the common difference for none of the rows is $p$. Then each row has $p$ numbers that are all distinct modulo $p$, from which it is easy to permute the rows so that column $i$ only contains numbers that are $i \pmod p$, done.
If the common difference of a row is $p$, then that row contains all numbers from $1$ through $p^2$ that are $k \pmod p$ for some $k$. However, if another row has common difference that is not $p$, then it will contain a number that is $k \pmod p$, which is impossible. So then all rows have common difference $p$, from which it is easy to permute the rows so that the columns are $1 + pm$, $2 + pm$, $\dots$ for some $m < p$.

To prove impossibility for $n \neq p$, we consider the following counter-construction. Let $d \mid n$, so that $d \neq 1, n$. Then let the first $d$ columns be $(d - i, 2d - i, \dots, nd - i)$, varying $i$ with $i = 0, 1, \dots, d-1$. Then let the remaining $n - d$ columns be $(n(d+i) + 1, n(d+i) + 2, \dots)$, varying $i$ once again with $i = 0, 1, \dots, n - d - 1$. We show that cell $nd + 1$ cannot belong to a valid column. If $nd + n$ belongs to a column with common difference less than $n$, then it is a clear contradiction. If the common difference is more than $n$ we clearly will not have enough space as $\frac{nd + n - 1}{n+1} < 1$. If the difference is $n$ exactly then clearly this doesn't work as $nd + n - kn$ is $0$ modulo $n$ and some rows obviously do not contain any $0$ modulo $n$ numbers, for example $i = 1$ so 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.
cursed_tangent1434
562 posts
#28
Y by
Let $n$ be \textit{good} if and only if it is possible to transform any row-valid arrangement into a column-valid arrangement by permuting the numbers in each row of an $n \times n$ table. Now, we claim the following.

Claim : All composite integers $n \geq 3$ are not good by the following construction.

Proof : Let $p$ be the smallest prime factor of $n$. Then, since $n>p$, consider the below construction. Let $d$ be the common difference of the arithmetic progression of a certain row or column.
\begin{tabular}{c c c c c| c}
         1 & 2 & 3 & $\cdots$ & $n$ & $d = 1$  \\
         $n+1$ & $2n-p+1$ & $3n-2p+1$ & $\cdots$ & $n^2 + p-pn + 1$ & $d=n-p$\\
         $n+2$ & $2n-p+2$ & $3n-2p+2$ & $\cdots$ & $n^2 + p -pn + 2$ & $d=n-p$\\
         $\vdots$ & $\vdots$& $\vdots$& $\vdots$ & $\vdots$ & $d=n-p$\\
         $2n-p$ & $3n-2p$ & $4n-3p$ &$\cdots$ & $n^2 + n -pn$ & $d=n-p$ \\
         $n^2+n-pn+1$ & $n^2 +n -pn +2$ & $n^2 +n -pn +3$ & $\cdots$ & $n^2 + 2n - pn$ &  $d=1$\\
         $\vdots$ &$\vdots$ &$\vdots$& $\vdots$ & $\vdots$ & $d=1$\\
         $n^2 -2n + 1$ & $n^2 -2n + 2$ & $n^2 -2n +3 $ & $\cdots$s & $n^2 -n$ & $d=1$\\
         $n^2 -n +1 $ & $n^2 -n +2$ & $n^2 -n +3$ & $\cdots$ & $n^2$ & $d=1$
 \end{tabular}
Here, the first row is $1,2,\cdots n$ and the next $n-p$ rows start with $n+1 , n+2 , \cdots 2n-p$ respectively and have common difference $n-p$. Then, the remaining columns fill in the integers from $n^2+n-pn+1$ to $n^2$ with common difference 1 in each row. Now, it is obviously clear that this arrangement is row-valid. If it is column valid then the first column must be an arithmetic progression. Since it is clearly in increasing order in the table from top to bottom, the common difference must be $n+1-1=n$, which is impossible if $n+2$ lies on this column as well. Thus, clearly this arrangement is not column-valid and we are done.
Now, we shall show that all primes $p\geq 3$ are indeed good. Consider the following key claim.

Claim : We will always have $c,p+c,\cdots, p^2 - p + c$ for all $1\leq c \leq p$ all in the same row or all in $p$ different rows.

Proof : Simply notice that if $k_1p+c$ and $k_2p+c$ lie on the same row, they must be members of an arithmetic progression with common difference $d \mid (k_2-k_1)p$ but it is easy to see that each arithmetic progression cannot have a common difference greater than $p+1$ since,
$$1 + (p-1)d \geq 1 + (p-1)(p+1) = p^2$$Thus, the common difference must indeed be $p$ which means indeed this row contains $c,p+c,\cdots, p^2-p+1$ as claimed.

Now, we proceed by induction say we have that there exists $k<p$ rows which are $1,p+1,\cdots$ , $2,p+2,\cdots,$ and so on up to $k, p+k, \cdots$. Then, consider the row containing $k+1$ (which is the smallest unplaced number). Notice that if this row has common difference $d$, then if $d<k$
$$k+1 + d(p-1)= dp - d + k + 1  \leq  dp \leq dp + (d-1)$$also
$$k+1+d(p-1)=dp-d+k+1 > dp + d - p -2= (d-1)p + (d-2)$$Thus, we have the sequence $k+1, k+1 + d , \cdots$. We notice that it is impossible to have any two terms which are the same modulo $p$ since
$$k+1 +c_1d \equiv k+1 +c_2d \implies (c_2-c_1)d \equiv 0 \pmod{p}  $$Thus, since we have exactly $p$ terms in this arithmetic sequence each must be different mod $p$. ($c_2\neq c_1$) unless $d=p$. Thus, there must exist some term which is $1 \pmod{p}$. But since the first row already has all terms which are $1 \pmod{p}$ this is impossible.
The case when $d\geq k$ is similar since here too, we have atleast $d$ terms in Row 1 less than the largest term in the row containing $k+1$. This means that no other arithmetic sequence is possible forcing this row also to be $k+1,k+1+p, \cdots$.
Thus, indeed the only possible row-valid configuration is the one with rows with minimum elements $1,2,\cdots,p$ with common difference $p$. But then it is easy to see that we have the column-wise arithmetic progressions,
$1,2,\cdots,p$ ; $p+1,p+2,p+3,\cdots,2p$ ; $\cdots$ ; $p^-p+1,p^2-p+2,\cdots,p^2$ since we have the modulo classes $\pmod{p}$ is in different rows as shown before. Thus, indeed for $n\geq 3$, every row-valid arrangement is also column-valid if and only if $n$ is a prime.
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
cj13609517288
1878 posts
#29 • 1 Y
Y by peace09
I'm lazy so you get a direct copy-paste from my DMs.

BLUE LIN FISH
is it n prime
if n is composite then take smallest p|n
then consider the rows
1,p+1,...,p(n-1)+1
2,p+2,...,p(n-1)+2
...
p,2p,...,pn
pn+1,pn+2,...,(p+1)n
(p+1)n+1,(p+1)n+2,...,(p+2)n
...
consider the column containing 1
if its common difference is less than n
then within 1...pn it gets more than p numbers
contradiction since there's only p colors in that range
so the common difference is n
but then it also gets 1+n which is the first color
contradiction
if n is prime
then i claim that coloring mod p works most of the time
indeed the only time it won't work is if one group has two things the same mod p, which can only happen if that group is just a residue mod p
in which case, any other group to not overlap with this group must be a different residue mod p
so then my colors will just be ceil(x/p)
\blacksquare



Edit:
cluelinfish — Today at 11:17 AM
correct
jatloe12345 — Today at 12:07 PM
XOOOOOOOO
XOOOOOOOOOOOOO
XOOOOOOOOOOOOOOOOO
XOOOOOOOOOOOOOOOOOOOOOOOO
XOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO
This post has been edited 1 time. Last edited by cj13609517288, Feb 25, 2025, 5:08 PM
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
gladIasked
632 posts
#30
Y by
The answer is $n=p$ prime only.

Let two numbers in the same row of a row-valid arrangement be $a$ and $b$, with $a<b$. Note that the common difference $d$ of the arithmetic progression must divide $b-a$.

If $n\mid b-a$, and let $b-a=nk$. Note that either $d=n$ or $d\mid k$. However, if $d\mid k$, then we must have exactly $\frac{nk}{d}-1\ge n-1$ numbers between $a$ and $b$. This implies that there are at least $n+1$ numbers in the row, a contradiction. Thus, henceforth assume $d=n$.

We can now show that the common difference in all of the rows must also be $n$. First, let the starting term be $c\not\equiv a\pmod n$. AFTSOC that the difference $d$ is less than $n$. Then, there must exist some nonnegative $k\le n-1$ such that $c+dk\equiv a\pmod n$, which implies that $c+dk$ was in the (earlier) sequence with $a$ and $b$, a contradiction. Therefore, each of arithmetic progressions in the rows have common difference $n$.

From here, it's easy to see that we can permute the numbers in each row such that $1, 2\dots, n$ are all in a column, $n+1, n+2, \dots, 2n$ are all in a column, and so on. This new rearrangement is clearly column-valid. $\square$

Next, we will deal with the case with $n\nmid b-a$. Note that $n$ cannot be the common difference in any of the rows (as shown above). However, this implies that two numbers $a\equiv b\pmod n$ cannot be in the same row. Therefore, we can permute the numbers in each row such that $1, n+1, 2n+1, \dots, (n-1)n+1$ are all in a column, $2, n+2, 2n+2, \dots, (n-1)n+2$ are all in a column, and so on (numbers that are the same modulo $n$ are all in the same column). This new rearrangement is clearly column-valid. $\square$

If $n$ is composite, then let $p$ be the smallest prime divisor of $n$. Fill the first row with $1, 2, \dots, n$. Fill the second row with $n+1, n+1+p, n+1+2p,\dots, n+1+(n-1)p$. Fill the third row with $n+2, n+2+p, \dots, n+2+(n-1)p$. In general, for $1<i\le p+1$, fill the $i$-th row with $n+i-1, n+i-1+p, n+i-1+2p, \dots, n+i-1+(n-1)p$. Fill the remaining rows with the rest of the integers in increasing order (left to right, top to bottom).

AFTSOC that this grid can be rearranged into a column-valid arrangement; clearly, $1$ must be the smallest element in its column (in the new column-valid arrangement). However, all of the integers from $2$ to $n$ are all in the same row as $1$, so the second-largest element in $1$'s column must be $n+1$ (otherwise, the sequence's largest term will be too big). Thus, the arithmetic progression in $1$'s column must have a common difference $n$. However, note that there exists number not equal to $n+1$ in the second column that is also congruent to $1\pmod n$ (namely, $2n+1=n+1+\frac{n}{p}\cdot p$). This is a contradiction, so row-valid arrangements cannot be rearranged into column-valid arrangements when $n$ is composite. $\blacksquare$
This post has been edited 1 time. Last edited by gladIasked, Mar 28, 2025, 3:49 PM
Z K Y
N Quick Reply
G
H
=
a