Stay ahead of learning milestones! Enroll in a class over the summer!

G
Topic
First Poster
Last Poster
k a April Highlights and 2025 AoPS Online Class Information
jlacosta   0
Apr 2, 2025
Spring is in full swing and summer is right around the corner, what are your plans? At AoPS Online our schedule has new classes starting now through July, so be sure to keep your skills sharp and be prepared for the Fall school year! Check out the schedule of upcoming classes below.

WOOT early bird pricing is in effect, don’t miss out! If you took MathWOOT Level 2 last year, no worries, it is all new problems this year! Our Worldwide Online Olympiad Training program is for high school level competitors. AoPS designed these courses to help our top students get the deep focus they need to succeed in their specific competition goals. Check out the details at this link for all our WOOT programs in math, computer science, chemistry, and physics.

Looking for summer camps in math and language arts? Be sure to check out the video-based summer camps offered at the Virtual Campus that are 2- to 4-weeks in duration. There are middle and high school competition math camps as well as Math Beasts camps that review key topics coupled with fun explorations covering areas such as graph theory (Math Beasts Camp 6), cryptography (Math Beasts Camp 7-8), and topology (Math Beasts Camp 8-9)!

Be sure to mark your calendars for the following events:
[list][*]April 3rd (Webinar), 4pm PT/7:00pm ET, Learning with AoPS: Perspectives from a Parent, Math Camp Instructor, and University Professor
[*]April 8th (Math Jam), 4:30pm PT/7:30pm ET, 2025 MATHCOUNTS State Discussion
April 9th (Webinar), 4:00pm PT/7:00pm ET, Learn about Video-based Summer Camps at the Virtual Campus
[*]April 10th (Math Jam), 4:30pm PT/7:30pm ET, 2025 MathILy and MathILy-Er Math Jam: Multibackwards Numbers
[*]April 22nd (Webinar), 4:00pm PT/7:00pm ET, Competitive Programming at AoPS (USACO).[/list]
Our full course list for upcoming classes is below:
All classes run 7:30pm-8:45pm ET/4:30pm - 5:45pm PT unless otherwise noted.

Introductory: Grades 5-10

Prealgebra 1 Self-Paced

Prealgebra 1
Sunday, Apr 13 - Aug 10
Tuesday, May 13 - Aug 26
Thursday, May 29 - Sep 11
Sunday, Jun 15 - Oct 12
Monday, Jun 30 - Oct 20
Wednesday, Jul 16 - Oct 29

Prealgebra 2 Self-Paced

Prealgebra 2
Sunday, Apr 13 - Aug 10
Wednesday, May 7 - Aug 20
Monday, Jun 2 - Sep 22
Sunday, Jun 29 - Oct 26
Friday, Jul 25 - Nov 21

Introduction to Algebra A Self-Paced

Introduction to Algebra A
Monday, Apr 7 - Jul 28
Sunday, May 11 - Sep 14 (1:00 - 2:30 pm ET/10:00 - 11:30 am PT)
Wednesday, May 14 - Aug 27
Friday, May 30 - Sep 26
Monday, Jun 2 - Sep 22
Sunday, Jun 15 - Oct 12
Thursday, Jun 26 - Oct 9
Tuesday, Jul 15 - Oct 28

Introduction to Counting & Probability Self-Paced

Introduction to Counting & Probability
Wednesday, Apr 16 - Jul 2
Thursday, May 15 - Jul 31
Sunday, Jun 1 - Aug 24
Thursday, Jun 12 - Aug 28
Wednesday, Jul 9 - Sep 24
Sunday, Jul 27 - Oct 19

Introduction to Number Theory
Thursday, Apr 17 - Jul 3
Friday, May 9 - Aug 1
Wednesday, May 21 - Aug 6
Monday, Jun 9 - Aug 25
Sunday, Jun 15 - Sep 14
Tuesday, Jul 15 - Sep 30

Introduction to Algebra B Self-Paced

Introduction to Algebra B
Wednesday, Apr 16 - Jul 30
Tuesday, May 6 - Aug 19
Wednesday, Jun 4 - Sep 17
Sunday, Jun 22 - Oct 19
Friday, Jul 18 - Nov 14

Introduction to Geometry
Wednesday, Apr 23 - Oct 1
Sunday, May 11 - Nov 9
Tuesday, May 20 - Oct 28
Monday, Jun 16 - Dec 8
Friday, Jun 20 - Jan 9
Sunday, Jun 29 - Jan 11
Monday, Jul 14 - Jan 19

Intermediate: Grades 8-12

Intermediate Algebra
Monday, Apr 21 - Oct 13
Sunday, Jun 1 - Nov 23
Tuesday, Jun 10 - Nov 18
Wednesday, Jun 25 - Dec 10
Sunday, Jul 13 - Jan 18
Thursday, Jul 24 - Jan 22

Intermediate Counting & Probability
Wednesday, May 21 - Sep 17
Sunday, Jun 22 - Nov 2

Intermediate Number Theory
Friday, Apr 11 - Jun 27
Sunday, Jun 1 - Aug 24
Wednesday, Jun 18 - Sep 3

Precalculus
Wednesday, Apr 9 - Sep 3
Friday, May 16 - Oct 24
Sunday, Jun 1 - Nov 9
Monday, Jun 30 - Dec 8

Advanced: Grades 9-12

Olympiad Geometry
Tuesday, Jun 10 - Aug 26

Calculus
Tuesday, May 27 - Nov 11
Wednesday, Jun 25 - Dec 17

Group Theory
Thursday, Jun 12 - Sep 11

Contest Preparation: Grades 6-12

MATHCOUNTS/AMC 8 Basics
Wednesday, Apr 16 - Jul 2
Friday, May 23 - Aug 15
Monday, Jun 2 - Aug 18
Thursday, Jun 12 - Aug 28
Sunday, Jun 22 - Sep 21
Tues & Thurs, Jul 8 - Aug 14 (meets twice a week!)

MATHCOUNTS/AMC 8 Advanced
Friday, Apr 11 - Jun 27
Sunday, May 11 - Aug 10
Tuesday, May 27 - Aug 12
Wednesday, Jun 11 - Aug 27
Sunday, Jun 22 - Sep 21
Tues & Thurs, Jul 8 - Aug 14 (meets twice a week!)

AMC 10 Problem Series
Friday, May 9 - Aug 1
Sunday, Jun 1 - Aug 24
Thursday, Jun 12 - Aug 28
Tuesday, Jun 17 - Sep 2
Sunday, Jun 22 - Sep 21 (1:00 - 2:30 pm ET/10:00 - 11:30 am PT)
Monday, Jun 23 - Sep 15
Tues & Thurs, Jul 8 - Aug 14 (meets twice a week!)

AMC 10 Final Fives
Sunday, May 11 - Jun 8
Tuesday, May 27 - Jun 17
Monday, Jun 30 - Jul 21

AMC 12 Problem Series
Tuesday, May 27 - Aug 12
Thursday, Jun 12 - Aug 28
Sunday, Jun 22 - Sep 21
Wednesday, Aug 6 - Oct 22

AMC 12 Final Fives
Sunday, May 18 - Jun 15

F=ma Problem Series
Wednesday, Jun 11 - Aug 27

WOOT Programs
Visit the pages linked for full schedule details for each of these programs!


MathWOOT Level 1
MathWOOT Level 2
ChemWOOT
CodeWOOT
PhysicsWOOT

Programming

Introduction to Programming with Python
Thursday, May 22 - Aug 7
Sunday, Jun 15 - Sep 14 (1:00 - 2:30 pm ET/10:00 - 11:30 am PT)
Tuesday, Jun 17 - Sep 2
Monday, Jun 30 - Sep 22

Intermediate Programming with Python
Sunday, Jun 1 - Aug 24
Monday, Jun 30 - Sep 22

USACO Bronze Problem Series
Tuesday, May 13 - Jul 29
Sunday, Jun 22 - Sep 1

Physics

Introduction to Physics
Wednesday, May 21 - Aug 6
Sunday, Jun 15 - Sep 14
Monday, Jun 23 - Sep 15

Physics 1: Mechanics
Thursday, May 22 - Oct 30
Monday, Jun 23 - Dec 15

Relativity
Sat & Sun, Apr 26 - Apr 27 (4:00 - 7:00 pm ET/1:00 - 4:00pm PT)
Mon, Tue, Wed & Thurs, Jun 23 - Jun 26 (meets every day of the week!)
0 replies
jlacosta
Apr 2, 2025
0 replies
k i Adding contests to the Contest Collections
dcouchman   1
N Apr 5, 2023 by v_Enhance
Want to help AoPS remain a valuable Olympiad resource? Help us add contests to AoPS's Contest Collections.

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


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


More specifically:

For new threads:


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

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


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

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


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


For answers to already existing threads:


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

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



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


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

The above rules will be applied from next monday (5. march of 2007).
Feel free to discuss on this here.
49 replies
ZetaX
Feb 27, 2007
NoDealsHere
May 4, 2019
n-gon function
ehsan2004   10
N 4 minutes ago by Zany9998
Source: Romanian IMO Team Selection Test TST 1996, problem 1
Let $ f: \mathbb{R}^2 \rightarrow \mathbb{R} $ be a function such that for every regular $ n $-gon $ A_1A_2 \ldots A_n $ we have $ f(A_1)+f(A_2)+\cdots +f(A_n)=0 $. Prove that $ f(x)=0 $ for all reals $ x $.
10 replies
ehsan2004
Sep 13, 2005
Zany9998
4 minutes ago
Functional equations
hanzo.ei   13
N 6 minutes ago by GreekIdiot
Source: Greekldiot
Find all $f: \mathbb R_+ \rightarrow \mathbb R_+$ such that $f(xf(y)+f(x))=yf(x+yf(x)) \: \forall \: x,y \in \mathbb R_+$
13 replies
hanzo.ei
Mar 29, 2025
GreekIdiot
6 minutes ago
Congruency in sum of digits base q
buzzychaoz   3
N 8 minutes ago by sttsmet
Source: China Team Selection Test 2016 Test 3 Day 2 Q4
Let $a,b,b',c,m,q$ be positive integers, where $m>1,q>1,|b-b'|\ge a$. It is given that there exist a positive integer $M$ such that
$$S_q(an+b)\equiv S_q(an+b')+c\pmod{m}$$
holds for all integers $n\ge M$. Prove that the above equation is true for all positive integers $n$. (Here $S_q(x)$ is the sum of digits of $x$ taken in base $q$).
3 replies
buzzychaoz
Mar 26, 2016
sttsmet
8 minutes ago
Unsolved NT, 3rd time posting
GreekIdiot   11
N 15 minutes ago by GreekIdiot
Source: own
Solve $5^x-2^y=z^3$ where $x,y,z \in \mathbb Z$
Hint
11 replies
GreekIdiot
Mar 26, 2025
GreekIdiot
15 minutes ago
Bashing??
John_Mgr   2
N 19 minutes ago by GreekIdiot
I have learned little about what bashing mean as i am planning to start geo, feels like its less effort required and doesnt need much knowledge about the synthetic solutions?
what do you guys recommend ? also state the major difference of them... especially of bashing pros and cons..
2 replies
John_Mgr
2 hours ago
GreekIdiot
19 minutes ago
Regarding Maaths olympiad prepration
omega2007   0
22 minutes ago
<Hey Everyone'>
I'm 10 grader student and Im starting prepration for maths olympiad..>>> From scratch (not 2+2=4 )

Do you haves compilled resources of Handouts,
PDF,
Links,
List of books topic wise

which are shared on AOPS (and from your prespective) for maths olympiad and any useful thing, which will help me in boosting Maths olympiad prepration.
0 replies
omega2007
22 minutes ago
0 replies
Inspired by JK1603JK
sqing   13
N 29 minutes ago by sqing
Source: Own
Let $ a,b,c\geq 0 $ and $ab+bc+ca=1.$ Prove that$$\frac{abc-2}{abc-1}\ge \frac{4(a^2b+b^2c+c^2a)}{a^3b+b^3c+c^3a+1} $$
13 replies
1 viewing
sqing
Today at 3:31 AM
sqing
29 minutes ago
Problem 1
SlovEcience   0
35 minutes ago
Prove that
\[
C(p-1, k-1) \equiv (-1)^{k-1} \pmod{p}
\]for \( 1 \leq k \leq p-1 \), where \( C(n, m) \) is the binomial coefficient \( n \) choose \( m \).
0 replies
SlovEcience
35 minutes ago
0 replies
A simple power
Rushil   19
N 36 minutes ago by Raj_singh1432
Source: Indian RMO 1993 Problem 2
Prove that the ten's digit of any power of 3 is even.
19 replies
Rushil
Oct 16, 2005
Raj_singh1432
36 minutes ago
Problem 1
blug   3
N 41 minutes ago by blug
Source: Polish Math Olympiad 2025 Finals P1
Find all $(a, b, c, d)\in \mathbb{R}$ satisfying
\[\begin{aligned}
\begin{cases}
    a+b+c+d=0,\\
    a^2+b^2+c^2+d^2=12,\\
    abcd=-3.\\
\end{cases}
\end{aligned}\]
3 replies
blug
4 hours ago
blug
41 minutes ago
An easy 3 variable equation
BarisKoyuncu   6
N an hour ago by Burak0609
Source: Turkey National Mathematical Olympiad 2022 P4
For which real numbers $a$, there exist pairwise different real numbers $x, y, z$ satisfying
$$\frac{x^3+a}{y+z}=\frac{y^3+a}{x+z}=\frac{z^3+a}{x+y}= -3.$$
6 replies
BarisKoyuncu
Dec 23, 2022
Burak0609
an hour ago
You'll be sure of the answer
egxa   8
N an hour ago by Burak0609
Source: Turkey National MO 2024 P4
Let $n$ be a positive integer, and let $1=d_1<d_2<\dots < d_k=n$ denote all positive divisors of $n$, If the following conditions are satisfied:
$$ 2d_2+d_4+d_5=d_7$$$$ d_3 d_6 d_7=n$$$$ (d_6+d_7)^2=n+1$$
find all possible values of $n$.

8 replies
egxa
Dec 17, 2024
Burak0609
an hour ago
Solve a^7(a-1)=19b(19b+2) over Z
BarisKoyuncu   3
N an hour ago by Burak0609
Source: Turkey EGMO TST 2022 P3
Find all pairs of integers $(a,b)$ satisfying the equation $a^7(a-1)=19b(19b+2)$.
3 replies
BarisKoyuncu
Mar 16, 2022
Burak0609
an hour ago
Burak0609
Burak0609   0
an hour ago
$a^7(a-1)=19b(19b+2) \implies a^7(a-1)+1=(19b+1)^2$.
So we can see $(19b+1)^2=a^8-a^7+1=(a^2-a+1)(a^6-a^4-a^3+a+1$ and $gcd(a^2-a+1,a^6-a^4-a^3+a+1)=1,19$ but $gcd(a^2-a+1,a^6-a^4-a^3+a+1)=1$ because $(19b+1)^2 \equiv 0(mod 19)$. I mean $a^2-a+1$ and $a^6-a^4-a^3+a+1$ are perfect squares. $a^2 \le a^2-a+1 \le (a+1)^2$. a should be 0 or 1 because of $a^2 \le a^2-a+1 \le (a+1)^2$. We have two solution. These are $(a,b)=(0,0),(1,0)
0 replies
Burak0609
an hour ago
0 replies
Find all sequences satisfying two conditions
orl   33
N Apr 2, 2025 by AshAuktober
Source: IMO Shortlist 2007, C1, AIMO 2008, TST 1, P1
Let $ n > 1$ be an integer. Find all sequences $ a_1, a_2, \ldots a_{n^2 + n}$ satisfying the following conditions:
\[ \text{ (a) } a_i \in \left\{0,1\right\} \text{ for all } 1 \leq i \leq n^2 + n;
\]

\[ \text{ (b) } a_{i + 1} + a_{i + 2} + \ldots + a_{i + n} < a_{i + n + 1} + a_{i + n + 2} + \ldots + a_{i + 2n} \text{ for all } 0 \leq i \leq n^2 - n.
\]
Author: Dusan Dukic, Serbia
33 replies
orl
Jul 13, 2008
AshAuktober
Apr 2, 2025
Find all sequences satisfying two conditions
G H J
Source: IMO Shortlist 2007, C1, AIMO 2008, TST 1, P1
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
orl
3647 posts
#1 • 3 Y
Y by Adventure10, ImSh95, Mango247
Let $ n > 1$ be an integer. Find all sequences $ a_1, a_2, \ldots a_{n^2 + n}$ satisfying the following conditions:
\[ \text{ (a) } a_i \in \left\{0,1\right\} \text{ for all } 1 \leq i \leq n^2 + n;
\]

\[ \text{ (b) } a_{i + 1} + a_{i + 2} + \ldots + a_{i + n} < a_{i + n + 1} + a_{i + n + 2} + \ldots + a_{i + 2n} \text{ for all } 0 \leq i \leq n^2 - n.
\]
Author: Dusan Dukic, Serbia
This post has been edited 2 times. Last edited by orl, Jan 4, 2009, 8:47 PM
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
KuMing
13 posts
#2 • 5 Y
Y by DRTFROG, ImSh95, Adventure10, Mango247, and 1 other user
$ a_{kn + i} = 0$ if $ 0 \leq i \leq n - k$
and
$ a_{kn + i} = 1$ if $ n - k < i \leq n$

Let $ b_i = a_{i\cdot n + 1} + a_{i \cdot n + 2} + \cdots + a_{(i + 1)n}$
then $ 0 \leq b_0 < b_1 < \cdots b_n \leq n \Rightarrow b_i = i$

suppose $ a_{s n + t}$ is greatest element satisfy $ a_{s n + t}$ such that $ a_{sn + t} = 0$ and $ n - s < t \leq n$

Let $ c_i = a_{i \cdot n + 1} + a_{i \cdot n + 2} + \cdots + a_{i \cdot n + t - 1}$
and $ d_i = a_{i \cdot n + t} + a_{i \cdot n + t + 1} + \cdots + a_{(i + 1)n}$

$ 0 = d_0 + c_1 < d_1 + c_2 < \cdots d_s + c_{s + 1} = s - 1 \Rightarrow d_i + c_{i + 1} = i (i \leq s)$

$ b_i - (d_i + c_{i + 1}) = c_i + d_i - d_i - c_{i + 1} = 0 \Rightarrow c_i = c_{i + 1} (i \leq s)$

because $ c_0 \leq b_0 \Rightarrow c_0 = 0 \Rightarrow c_s = 0$
But $ d_s \leq s - 1$ because $ a_{sn + t} = 0$ then $ b_s = c_s + d_s \leq s - 1$ Contradiction!!
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
nayel
1394 posts
#3 • 4 Y
Y by Adventure10, ImSh95, Mango247, and 1 other user
My solution is in the attached file.
Attachments:
C1_isl.pdf (41kb)
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
mathophile593
50 posts
#4 • 3 Y
Y by Adventure10, ImSh95, Mango247
I have the exact same solution as nayel :). It's nice.
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
math154
4302 posts
#5 • 3 Y
Y by ImSh95, Adventure10, Mango247
We induct on $n\ge1$ to show that $a_{kn+i}=1$ ($0\le k\le n$ and $1\le i\le n$) iff $k\ge i$, where the base case is clear.

Let $s_i=a_i+\cdots+a_{i+n-1}$. Note that $0\le s_i\le n$ for all $0\le i\le n^2+1$. Since
\[s_1 < s_{n+1} < \cdots < s_{n^2+1},\]we have $s_{kn+1}=k$ for $0\le k\le n$. In particular,
\[a_1=\cdots=a_n=0\wedge a_{n^2+1}+\cdots+a_{n^2+n}=1.\]Thus
\begin{align*}
A = s_2+s_{n+2}+\cdots+s_{(n-1)n+2} &= s_{n+1}+s_{2n+1}+\cdots+s_{(n-1)n+1}+1 \\
&= 1+2+\cdots+(n-1)+1 = B.
\end{align*}However, $s_2<s_{n+2}<\cdots<s_{(n-1)n+2}$ gives us $s_{kn+2}\in[k,k+1]$ for $0\le k\le n-1$. If $s_{(n-1)n+2}=n-1$, though, we must have
\[A = s_2+s_{n+2}+\cdots+s_{(n-1)n+2} \le 1+2+\cdots+(n-1) < B,\]a contradiction. So $s_{(n-1)n+2}=n$, whence
\[B-n = 1+2+\cdots+(n-2) \ge s_2+s_{n+2}+\cdots+s_{(n-2)n+2} = A-s_{(n-1)n+2} = A-n\]and so $s_{kn+2}=k=s_{kn+1}$ for $0\le k\le n-2$. Letting $k$ range from $0$ to $n-2$, we find that
\[0=a_1=a_{n+1}=\cdots=a_{(n-1)n+1}.\]But $s_{(n-1)n+1}=n-1$, so
\[a_{(n-1)n+2}=\cdots=a_{(n-1)n+n}=1.\]
It's now easy to see that $a_{kn+i}$, for $0\le k\le n-1$ and $2\le i\le n$ satisfy the inductive hypothesis, so we're done. (Visualizing the numbers in a $(n+1)\times n$ matrix also helps.)
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
Tommy2000
715 posts
#6 • 3 Y
Y by ImSh95, Adventure10, Mango247
Can someone read my solution and give feedback on how to structure/word it better? Thanks :)
Solution
EDIT: Sorry about the weird formatting, I don't know of a good way to split formulas in half other than doing it manually
This post has been edited 1 time. Last edited by Tommy2000, Mar 31, 2016, 1:59 PM
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
Kezer
986 posts
#7 • 3 Y
Y by vsathiam, ImSh95, Adventure10
Felt more like an Algebra problem to me. Annoying indexing, wow. There must be an easier solution than mine, though, lol.

We claim that the only possible sequence is \begin{align*} a_1=a_2=\dots=a_n &=0
\\ a_{n+1}=a_{n+2}=\dots=a_{2n-1}=0, \ a_{2n}&=1
\\ a_{2n+1}=a_{2n+2}=\dots=a_{3n-2}=0, \ a_{3n-1}=a_{3n} &=1
\\ &\dots
\\ a_{n^2}=a_{n^2+1}=\dots=a_{n^2+n} &=1
\end{align*}Note the chain of inequalities \[ 0 \leq a_1+\dots+a_n < a_{n+1}+\dots+a_{2n} < \dots < a_{n^2+1}+\dots+a_{n^2+n} \leq n. \]As those sums are all integers and there are exactly $n$ strict 'less than'-signs, we can conclude $\sum_{i=1}^{n} a_{kn+i} = k$ for $0 \leq k \leq n$. Furthermore, note \[ 0 \leq \sum_{i=j}^{n+j-1} a_i < \sum_{i=j}^{n+j-1} a_{n+i} < \dots < \sum_{i=j}^{n+j-1} a_{n^2+i} \leq n \]for $2 \leq j \leq n$. Now those are exactly $n-1$ strict inequality signs. Thus $k \leq \sum_{i=j}^{n+j-1} a_{kn+i} \leq k+1$. Now we'll induct.
Base Case: Notice $a_1=a_2=\dots=a_n=0$, as $\sum_{i=1}^{n} a_i=0$.
Induction Hypothesis: Let $(a_{kn+1},a_{kn+2},\dots,a_{(k+1)n}) = (0,0,\dots,0,1,1,\dots,1)$ where we have $k$-times the $1$.
Induction Step: We'll prove $(a_{(k+1)n+1},a_{(k+1)n+2},\dots,a_{(k+2)n})=(0,0,\dots,0,1,\dots,1)$ with $k+1$-times the $1$. As for that, we'll induct again to show \[ a_{(k+1)n+1}=a_{(k+1)n+2}=\dots+a_{(k+1)n+n-k-1}=0. \]By $\sum_{i=1}^n a_{(k+1)n+i}=k+1$ we'd be done. Assume $a_{(k+1)n+1}=1$. Then \[ k+1=a_{kn+2}+a_{kn+3}+\dots+a_{(k+1)n+1} < a_{(k+1)n+2}+a_{(k+1)n+3}+\dots+a_{(k+2)n}+a_{(k+2)n+1} \leq k+1 \]by the Induction Hypothesis. Contradiction. Thus $a_{(k+1)n+1}=0$. So now assume \[ a_{(k+1)n+1}=a_{(k+1)n+2}=\dots=a_{(k+1)n+i} = 0 \quad \text{for all} \quad i \leq N \leq n-k-2. \]Again assume $a_{(k+1)n+i+1}=1$. Then \begin{align*} k+1 = a_{kn+i+2}+\dots+a_{(k+1)n+i+1} <k+2 &\leq a_{(k+1)n+i+2}+\dots+a_{(k+2)n+i+1}
\\ < k+3 &\leq a_{(k+2)n+i+2}+\dots+a_{(k+3)n+i+1} 
\\ \dots
\\ < k+i+2 &\leq a_{(k+i+1)n+i+2}+\dots+a_{(k+i+2)n+i+1}. \end{align*}Here we've used that $a_{(k+1)n+i+2}+\dots+a_{(k+2)n}=k$ Thus $a_{(k+2)n+1}+\dots+a_{(k+2)n+i+1}=2$. With that $a_{(k+2)n+i+2}+\dots+a_{(k+3)n}=k$ and thus $a_{(k+3)n+1}+\dots+a_{(k+3)n+i+1}=3$ and so on. But the last line suggest \[ a_{(k+i+2)n+1}+a_{(k+i+2)n+2}+\dots+a_{(k+i+2)n+i+1} = i+2. \]But those are just $i+1$ terms. Contradiction. It's easy the verify that those indizes are well-defined for what we need. That ends the induction and thus also the other induction. It's easy to check that the claimed sequence indeed is a solution.
This post has been edited 1 time. Last edited by Kezer, Aug 23, 2016, 9:11 AM
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
jdeaks1000
44 posts
#8 • 4 Y
Y by skyscraper, ImSh95, Adventure10, Mango247
For $1\leq k\leq n^2-n+1$, let $b_k = a_k + a_{k+1} + \cdots + a_{k+n-1}$. It follows from the conditions given that $b_1<b_{n+1}<\cdots <b_{n^2+1}$, but each of these numbers is an integer from $0$ to $n$ inclusive, hence all these integers appear exactly once, and $b_1=0, b_{n^2+1} = n$. So the first $n$ terms of the sequence are $0$ and the last $n$ terms are $1$.

Let $S_i = \{ b_i, b_{i+n}, \cdots b_{i+n^2-n}\}$ for $2\leq i \leq n$. This is a strictly increasing sequence of $n$ integers from $0$ to $n$ inclusive. Let their sum be $T$. Also,
$a_1+a_2+\cdots +a_{n^2+n} = 0+1+\cdots +n= T + (n-i+1)$. Here we used the fact that the first $n$ terms are $0$ and the last $n$ terms are $1$. Thus the missing element in $S_i$ is precisely $n-i+1$. Now we have shown that each sum of $n$ consecutive terms is uniquely determined, so there's at most one such sequence.

It is obvious that $B_1B_2\cdots B_{n+1}$ works, where these are blocks of $n$ terms, and in $B_i$ everything is $0$ except for the last $i$ terms.
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
Shaddoll
688 posts
#9 • 3 Y
Y by ImSh95, Adventure10, Mango247
Solution
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
Kayak
1298 posts
#10 • 3 Y
Y by ImSh95, Adventure10, Mango247
Wrong solution :(
This post has been edited 4 times. Last edited by Kayak, Jul 18, 2019, 11:18 AM
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
mathadventurer
54 posts
#11 • 4 Y
Y by vsathiam, ImSh95, Adventure10, Mango247
The only possible config is have for each $i$th block of $n$ terms from left consisting of $n-i$ zeros and then $i$ ones.

First, consider all blocks of $n$ $a_i$'s such that the first term $a_j$ of each block has $j \equiv 1 \pmod{n}$. There are $n+1$ such blocks and since they are disjoint, the blocks must have sums $0, 1, \cdots n$ respectively from left to right.

Then consider all blocks of $n$ such that first term $a_j$ of each block has $j \equiv 2 \pmod{n}$. There are $n$ such blocks and by the previous observation the sums of all terms in these blocks is $\frac{n(n+1)}{2}-(n-1)$. The sums on these blocks are distinct and so it must be that their sums are $0, 1, \cdots n-2, n$ respectively from left to right.

Then we can fill out $0$'s and $1$'s from right to left and we see that we are forced to have the said configuration.
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
62861
3564 posts
#13 • 8 Y
Y by Phie11, Wizard_32, Mathematicsislovely, guptaamitu1, aopsuser305, ImSh95, Adventure10, Mango247
There is a unique valid sequence, which is described below:
[asy]
	int n = 6;
	for (int i = 0; i < n; i += 1) {
		draw((n-1, -i)--(0, -i-1), gray(0.6));
	}
	for (int i = 0; i <= n; i += 1) {
		draw((0, -i)--(n-1, -i), gray(0.6));
	}
	for (int i = 0; i < n; i += 1) {
	for (int j = 0; j <= n; j += 1) {
		label(string(i + j >= n ? 1 : 0), (i, -j));
	}
	}
[/asy]
It is clear that this works.

Now we show it is the only one. Write the sequence as an $(n+1) \times n$ matrix as above; then by condition the row sums are $0, \dots, n$ in order. In particular the top row is all-zero while the bottom row is all-one.

Define the partial sums $s_k = a_1 + \dots + a_k$, and let $i \in \{1, \dots, n-1\}$ be an integer. Then the $n$ nonnegative integers
\[s_{i+n} - s_i, s_{i+2n} - s_{i+n}, \dots, s_{i+n^2} - s_{i+n^2-n}\]form a strictly increasing sequence and sum to
\[s_{i+n^2} - s_i = (0 + 1 + \dots + n) - (n - i)\]and so must be exactly $\{0, 1, \dots, n\} \setminus \{n-i\}$ in order.

In particular each $s_{k+n} - s_k$ is forced, so in light of $a_1 = \dots = a_n = 0$ the entire sequence is forced.
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
Wizard_32
1566 posts
#14 • 2 Y
Y by ImSh95, Adventure10
It seriously felt like an algebra problem.
orl wrote:
Let $ n > 1$ be an integer. Find all sequences $ a_1, a_2, \ldots a_{n^2 + n}$ satisfying the following conditions:
\[ \text{ (a) } a_i \in \left\{0,1\right\} \text{ for all } 1 \leq i \leq n^2 + n;
\]\[ \text{ (b) } a_{i + 1} + a_{i + 2} + \ldots + a_{i + n} < a_{i + n + 1} + a_{i + n + 2} + \ldots + a_{i + 2n} \text{ for all } 0 \leq i \leq n^2 - n.
\]Author: Dusan Dukic, Serbia
We claim that the only sequence possible is the following:
$$\underbrace{0,0,\cdots 0}_{n}\underbrace{0,0, \cdots,0,1 }_{n}\underbrace{0,0, \cdots,0,1,1 }_{n} \cdots \underbrace{1,1, \cdots,1,1 }_{n}$$It is not hard to see that this works. Now we show that this is the only possibility.

Let $\mathcal{T}(k)$ denote the number of $1$s in the block $[a_{k}, a_{k+n+1}].$ Then the condition translates to $\mathcal{T}(k)<\mathcal{T}(k+n)$ for all $0 \le k \le n^2-n.$ For simplitcity, define $f$ by $f_i(k)=\mathcal{T}(ni+k).$ For instance, when $n=3;$
$$0, \underbrace{0,0,0}_{f_2(0)=0}\underbrace{0,1,0}_{f_2(1)=1}\underbrace{1,1,1}_{f_2(2)=3},1,1$$
We will now show that each $\mathcal{T}(k)$ has a unique value. Since the solution given before works, hence it would be the only solution.

Clearly $\mathcal{T}(ni+1)=i$ for all $1 \le i \le n.$ In particular the first $n$ elements are zeros while the last $n$ elements are $1$s. Thus by comparing terms we see
\begin{align*}
f_2(0)+f_2(1)+\cdots +f_2(n-1) &=f_1(0)+f_1(1)+\cdots f_1(n)-0- \underbrace{\left(1+1+\cdots+1\right)}_{n-1}  \\
f_2(0)+f_2(1)+\cdots +f_2(n-1) &=0+1+\cdots+(n-1)+1
\end{align*}Noting that $f_2(i)<f_2(j)$ for all $i<j$ gives a unique value designation to each of $f_2(i).$ In fact, this is $f_2(i)=i$ for all $0 \le i \le n-2$ and $f_2(n-1)=n.$

We can further repeat this procedure to assign values to each of $f_3(i), f_4(i), \cdots.$ and hence conclude the result. $\square$

EDIT: I realized that this is just a detailed form of the above solution.
This post has been edited 5 times. Last edited by Wizard_32, Dec 19, 2020, 7:48 AM
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
amuthup
779 posts
#15 • 2 Y
Y by ImSh95, Mango247
First, note that by the given inequality, we have $$a_1+a_2+\dots+a_{n}<a_{n+1}+a_{n+2}+\dots+a_{2n}<\dots<a_{n^2+1}+a_{n^2+2}+\dots+a_{n^2+n}.$$Since there are only $n+1$ possible values of the sum of any $n$ consecutive terms of the sequence, this implies that $$a_1+a_2+\dots+a_{n}=0,$$$$a_{n+1}+a_{n+2}+\dots+a_{2n}=1,$$$$\vdots$$$$a_{n^2+1}+a_{n^2+2}+\dots+a_{n^2+n}=n.$$In particular, the first $n$ terms must be $0$ and the last $n$ terms must be $1.$

We claim that for $i\in\{1,2,\dots,n\},$ we have $$a_{i}=a_{n+i}=\dots=a_{(n-i)n+i}=0,$$$$a_{(n-i+1)n+i}=a_{(n-i+2)n+i}=\dots=a_{n^2+i}=1.$$To show this, we induct backwards on $i.$

For the base case $i=n,$ let $x_k=a_{kn+1}+a_{kn+2}+\dots+a_{kn+n-1}$ for $k\in\{1,2,\dots,n-1\}.$ Using our work before and the given inequality, we have $$x_1<1-x_1+x_2<2-x_2+x_3<\dots<n-x_{n-1}+n.$$Since $x_k\in\{k-1,k\}$ for all $k,$ the only solution to this inequality is $x_k=k-1$ for all $k,$ implying the claim.

Now suppose the claim is true for $i=n,n-1,\dots,m,$ and let $x_k=a_{kn+1}+a_{kn+2}+\dots+a_{kn+m-2}$ for $k\in\{1,2,\dots,n-1\}.$ By the given inequality, $$x_1<2-x_1+x_2<2-x_2+x_3<\dots<n-x_{n-1}+n.$$But by the inductive hypothesis, we know $x_k=0$ if $k\le n-m+1$ and $x_k\in\{k-n+m-2,k-n+m-1\}$ if $k>n-m+1.$

Therefore, the only solution is $x_1=x_2=\dots=x_{n-m+1}=0$ and $x_{k}=k-n+m-2$ for $k>n+m-1,$ implying the claim.

We are done by induction.
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
Spacesam
597 posts
#16 • 2 Y
Y by ImSh95, Mango247
It will be helpful to define the following notation: Let the 1-block be the $n$ numbers from $a_1$ to $a_n$, define 2-blocks, etc analogously. Additionally, let $S(m, x)$ be the sum of the numbers from indices $m$ to $x$. Notice that \begin{align*}
    S(1, n) < S(n + 1, 2n) < \cdots < S(n(n - 1) + 1, n^2) < S(n^2 + 1, n^2 + n).
\end{align*}There are $n + 1$ blocks total, and the only possible sums are $0$ to $n$. Thus, 1-block has sum 0, 2-block has sum 1, and so forth.

Now, we claim that the only possible sequence is when the ones in each block are pushed as far to the right as possible; for example, the two $1$s in the 3-block would be pushed to $3n$ and $3n - 1$.

For our base case, assume that the $1$ in the $2$-block appears at index $n + j$, where $j < n$ for contradiction. Then, draw new boxes from $j + 1$ to $n + j$, and so forth. Evidently, \begin{align*}
    1 = S(j + 1, n + j) < S(n + j + 1, 2n + j) < \cdots < S(n(n - 1) + j + 1, n^2 + j),
\end{align*}which forces there to be $1, 2, \cdots, n$ ones in each of the new boxes. Observe now that $S(n(n - 1) + j + 1, n^2)$ is all ones for a total of $n - j$ ones (this is because the n+1-block is all ones). By similar logic, we need $S(n(n - 1) + 1, n(n - 1) + j) = j - 1$, but then this forces $S(n(n - 2) + j + 1, n(n - 1)) = n - j$ and so forth which is a contradiction.

The inductive step is near identical to the base case. The only difference is that we note that the $k + 1$th block has its earliest $1$ at $n - k$, and as a result the boxes we draw in the inductive step will contain all the pushed-forward ones in the $k$th block.

That was all a little dense, so here's an illustrative example. Let's take a look at the sequence $0000, 00 | 01, 01| |--, --| |--, 11|11$. The dashes represent the new boxes we draw in the inductive step, call them Crates 1, 2, and 3. Crate 1 has a sum of $2$, and because there are three crates total, we know from the givens that Crate 2 must have a sum of 3, and Crate 3 has a sum of 4.

As a result, our new sequence is $0000, 00 | 01, 01| |--, (--)| |11, 11|11$. However, because we know that box 4 must contain $3$ ones total, we know that the parenthesed area can only contain one $1$ at maximum. As a result, we are forced to draw the following: $0000, 00 | 01, 01| |11, --| |11, 11|11$, which is a contradiction since Box 3 here has a sum of $3$ which is too much.
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
GeronimoStilton
1521 posts
#17 • 1 Y
Y by ImSh95
It is clear that $a_1+a_2+\cdots+a_n<a_{n+1}+\cdots+a_{2n}<\cdots<a_{n^2+1}+\cdots+a_{n^2+n}$. There are $n+1$ sums, so the first is $0$, the next is $1$, etc. In particular, $a_1=a_2=\cdots=a_n=0$ and $a_{n^2+1}=a_{n^2+2}=\cdots = a_{n^2+n}=1$.

We claim that $a_{n+n}$ is the sole nonzero $a_{n+i}$ among $1\le i\le n$. This is because otherwise considering the sums $a_{kn+i+1}+\cdots+a_{kn+n+i}$ for $0\le k\le n-1$ implies that each successive sum contains all nonzero elements of $a_{kn+n+1},a_{kn+n+2},\dots,a_{kn+2n}$. A similar argument implies that only $a_{3n}$ and $a_{3n-1}$ of $a_{2n+1},\dots,a_{3n}$ are nonzero. Continuing on this way, we can uniquely characterize the sequence as the one for which each $a_{kn+i}$ with $1\le i\le n$ is nonzero iff $n+1-k\le i$. It is not hard to check this sequence works, so done.
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
#18 • 2 Y
Y by ImSh95, Mango247
I claim that there is one unique solution.

We proceed with induction on $n$,the base case is trivial and we obviously have one unique solution ($a_1<a_2$).

Now the inductive step:

Write $s_i = a_{i+1}+\ldots a_{i+n}$. Then, note that we have
\[0\leq s_0 < s_n < \cdots s_{(n-1)\cdot n} < s_{n^2} \leq n\]Thus, since these values are integers, and we have $n+1$ choices and $n+1$ values, we have $s_{nk} = k$ for all $k$.

Now, let $i$ be the smallest $i$ such that $a_i=1$. Note that we are guaranteed that $n+1\leq i \leq 2n$. Thus,
\[1\leq s_{i-n}< s_i < s_{i+n}\ldots s_{i+(n-2)n}\leq n\]There are $n$ choices, and $n$ values, so we have $s_{i+nr} = r+2$. Importantly,
\[\sum_{k=0}^{n} s_{nk} = \sum_{r=-1}^{n-2} s_{i+nr}\]Thus, since the LHS represents all 1s, all 1s must also be in the $i+nr$ ranges, so there cannot be any 1s in between $i+(n-2)n$ and $n^2+n$, but this is absurd because $s_{n^2}=n$ guarantees that for all $n^2+1\leq x\leq n^2+n$, $a_x=1$. Thus, we must have that \[i+(n-2)n=n^2 \Longrightarrow i=2n\]By considering $s_{nk-1}$
\[2\leq s_{2n-1} < s_{3n-1} < \ldots < s_{n^2-1} \leq n\]we get that $s_{nk-1}=k$. Thus, we must have that $a_{3n}=1$ and so on so that $a_{nk}=1$ for all $k\geq 2$. Thus, we can now remove $(1,2,\ldots n)$ and $(2n,3n,\ldots n^2+n)$, at which point we have reduced to the $n-1$ case because we've removed exactly 1 from each series of $n$. Thus, by the inductive hypothesis there is exactly one solution.


We can construct such a construction by taking a pattern of the form $a_{kn-r}=1$ for $0\leq r<n$ if and only if $r\leq k-2$.
This post has been edited 2 times. Last edited by AwesomeYRY, Apr 4, 2021, 1:15 AM
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
cj13609517288
1879 posts
#19 • 1 Y
Y by ImSh95
My Solution
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
bluelinfish
1446 posts
#21 • 1 Y
Y by ImSh95
Break the sequence into $n+1$ groups of $n$ numbers each. Using the second condition for multiples of $n$, we get that the amount of $1$s in a group increases with the position of the group. As there are only $n+1$ possible values for the number of $1$s in a group, the $i$th group will have $i-1$ ones.

We claim that the answer consists of the $i$th group consisting of $i-1$ ones at the end of the group, and zeros at the beginning where needed. This can be shown to work. We will prove this using induction. It is easy to show this for $n=2$.

Suppose that the claim is true for $n=k-1$. We will prove the statement for $n=k$.

Claim: For any $n$, the last number of every group other than the first must be a $1$.
Proof. Suppose that the last number in the $x$th group is $0$, where $x>1$. Plugging in $(n-1)x-1$ into the second condition gives us that the sum of the last number of the $x-1$th group and the first $n-1$ numbers of the $x$th group is less than the sum of the last number of the $x$th group and the first $n-1$ numbers of the $x+1$st group. However, the former is at least $x-1$ and the latter is at most $x$, so equality must hold, meaning all the ones in the $x+1$st group are in the first $n-1$ numbers. This means that the last number in the $x+1$th group is $0$.

Continuing this reasoning, we will eventually get that the last number of the last group, or $a_{n^2+n}$, is $0$, which is impossible. $\blacksquare$

Consider the sequence consisting of the $k^2-k$ numbers $a_{ln+m}$ for $1\le l\le k, 1\le m\le k-1$ in order. We claim that this sequence satisfies both conditions for $n=k-1$. Indeed, the first condition is obviously satisfied. The second condition is equivalent to the second condition for the $n=k$ sequence because we simply take out the last number out of a group (for the $n=k$ sequence) for each side, which is $1$ by the claim.

Therefore, by the induction hypothesis, there is only one possibility for $a_{ln+m}$ for $1\le l\le k, 1\le m\le k-1$. All other values are already determined, and combining these with the fixed values for $a_{ln+m}$ for $1\le l\le k, 1\le m\le k-1$, we get the answer stated above. The induction is complete, 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.
asdf334
7586 posts
#22 • 1 Y
Y by ImSh95
Let $b_i=a_i+a_{i+1}+\dots+a_{i+n}$. Trivially, we obtain $b_{kn+1}=k$, due to the second condition. It follows that $b_{n^2+1}=n$ or that $a_i=1$ for all $n^2+1\le i\le n^2+n$. Now, we have that
\[\sum_{k=0}^nb_{kn+1}=\sum_{k=1}^{n^2+n}a_k=\frac{n(n+1)}{2}=s_1\]\[\sum_{k=0}^{n-1}b_{kn+2}=\sum_{k=2}^{n^2+1}a_k=s_1-(n-1)=s_2\]\[\vdots\]\[\sum_{k=0}^{n-1}b_{kn+n}=\sum_{k=n}^{n^2+n-1}a_k=s_1-1=s_n.\]Now, consider the sequence $b_i, b_{n+i}, \dots, b_{n^2-n+i}$ for some $1<i\le n$. It's easy to see that this sequence contains every number from $0$ to $n$, inclusive, except for one. From our sums earlier, we obtain that this number is actually $n+1-i$.

Now, I claim that the sequence $b_{kn+1}$ to $b_{kn+n}$ contains $k$ copies of $k+1$ and $n-k$ copies of $k$, in sorted order. We show this by induction. The base case ($k=0$) is trivial. Now, suppose that $k-1$ satisfies the given. Then clearly we have $b_{kn+i}=b_{kn+i-n}+1$ for all $1\le i\le n$ except for $i=n-k+1$, in which case we obtain $b_{kn+n-k+1}=b_{kn-k+1}+2$. This implies the result.

Finally, I claim that $\boxed{\text{the sequence }a_{kn+1}\text{ to }a_{kn+n}\text{ contains }n-k\text{ copies of }0\text{ and }k\text{ copies of }1\text{ in sorted order}}$. We show this by induction; the base case is trivial. Consider $b_{kn+1-k}$ and the sequence $a_{kn+2-k}$ to $a_{kn}$. Clearly this sequence contains all of the $1$s that contribute to the sum in $b_{kn+1-k}$. It follows that all values from $a_{kn+1}$ to $a_{kn+n-k}$ are equal to $0$. However, $b_{kn+1}$ is equal to $k$, which implies that the $k$ elements from $a_{kn+n-k+1}$ to $a_{kn+n}$ are equal to $1$. Therefore, we are done. $\blacksquare$
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
awesomeming327.
1687 posts
#23 • 4 Y
Y by ImSh95, Mango247, Mango247, Mango247
Let $s_i=a_{i + 1} + a_{i + 2} + \ldots + a_{i + n},0\le s_n\le n.$ Note that $s_0<s_n<\dots<s_{n^2}$ so $s_{kn}=k.$ In particular, $a_1=a_2=\dots=a_n=0,a_{n^2+1}=a_{n^2+1}=\dots=a_{n^2+n}=1$ Let $1\le k\le n-1$, then $s_k< s_{k+n}<\dots < s_{k+n^2-n}$ and $s_k+s_{k+n}+\dots+s_{k+n^2-n}=\frac{n(n+1)}{2}-(n-k)$ which means that this sequence contains every integer from $1$ to $n$ excluding $n-k.$ Thus, from $a_1=a_2=\dots=a_n=0,a_{n^2+1}=a_{n^2+1}=\dots=a_{n^2+n}=1$ we get the same construction everyone else has posted.
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
john0512
4176 posts
#24 • 1 Y
Y by ImSh95
We claim that the in the sequence, the first $n$ terms are all 0, in the next $n$, only the last term is 1, in the next $n$, only the last 2 terms are 1, and so on, until in the last $n$, all terms are 1. This sequence clearly works.

Note that each block of $n$ must contain strictly more 1's than the previous block. This implies that there must be no 1's in the first $n$, one 1 in the next $n$, two 1s in the next $n$, and so on until $n$ ones in the last $n$.

Consider the prefix sums of this sequence. We will put the prefix sums in $n+1$ rows of $n$ each so that when the grid is read by rows, it gives the prefix sum sequence. Note that by our earlier observation, the last column must contain $0,1,3,6\cdots n(n+1)/2.$ Additionally, condition (b) is equivalent to each column forming a strictly convex sequence. Now, consider the second to last column of these prefix sums. This column must end in $n(n+1)/2 -1$ since the final $n$ terms are all 1's, so the final row of this grid contains consecutive integers. However, note that the minimal convex sequence starting with $0,1$ with a length of $n+1$ ends with $n(n+1)/2$, contradiction, so the second to last column must start with $0,0$ instead. Note that consecutive prefix sums can differ by no more than 1, so the second to last column must be $0,0,2,5,9,14\cdots n(n+1)/2 -1.$ We can then repeat this argument with previous columns. For example, in the third to last column, it must start with $0,0,1$ since the minimal convex sequence starting in $0,0,2$ reaches $n(n+1)/2-1$ on term $n+1$, but it needs to end in $n(n+1)/2-2,$ so it must start in $0,0,1$, and we can also use the argument that it can never fall behind the second to last column by more than 1. Repeating this argument with all previous columns, we get a unique possible grid of prefix sums, from which we can uniquely recover the original sequence, and since the sequence we showed earlier works, we are done.
This post has been edited 3 times. Last edited by john0512, Jan 6, 2023, 8:04 AM
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
#25 • 1 Y
Y by ImSh95
Odd problem.

Divide the sequence into subsequences $s_1 = (a_1, a_2, \dots, a_n)$, $s_2 = (a_{n+1}, a_{n+2}, \dots, a_{2n})$, and so on. The only such sequences are those with $s_i = (0, 0, 0, \dots, 1, 1, \dots, 1)$, where there are $i-1$ ones consecutively.

To prove this, notice that each subsequence $s_i$ contains a strictly greater number of ones than any previous subsequence; by Pigeonhole it follows that it must contain exactly $i-1$ ones. Now, suppose for the sake of contradiction that there exists a minimal index $k$ for which $s_k$ contains a one before index $n-k+2$ in that subsequence. Call this index $i$.

By minimality, we know that the $n$ digits leading up to index $i$ (spanning two subsequences) contains at least $k-1$ ones because due to the condition $i \leq n-k+1$, all zeroes at the tail of the previous subsequence are contained in these $n$ digits. This means that there are at least $k$ ones in the $n$ digits immediately following; in other words, all $k$ ones in the subsequence $s_{k+1}$ must fall in these $n$ digits, and thus strictly before the index $n-k+2$ in that sequence.

This implies that the next list $s_{k+1}$ also satisfies the aforementioned condition, so inductively, the list $s_{n+1}$ must also satisfy this condition. But this is absurd, because clearly there are no elements of $s_{n+1}$ that are before the element indexed $n-(n+1) + 2 = 1$.
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
peppapig_
279 posts
#26 • 2 Y
Y by mulberrykid, ImSh95
We claim that there is one unique sequence. First, we will construct this sequence, which will be made up of $n+1$ blocks of $n$ digits. The first block will be of $n$ zeros, the next will be of $n-1$ zeros with the last digit being $1$, and the second block will have the last two digits as $1$, and so on and so forth. E.g. for $n=3$, we have the sequence $000001011111$.

Clearly this construction works, as for each time we "increase" or move to the next block of $n$ numbers from any block of $n$ numbers(not necessarily the ones specified in the previous definition, a "block" could mean index $2$ to index $n+1$), we "exchange" a zero for a $1$, adding one to the sum.

Now we must prove that there are no other sequences. Notice that if we section off the $n^2+n$ numbers into $n+1$ disjoint blocks of $n$ (there is only one way to do this), we have that the sum of the first block must be $0$, the next is $1$, and so on and so forth, since these sums must be increasing. Using this and filling out the sequence from left to right, we find that we must have the configuration, and we are done.

FS found by bobthegod78

Now we must prove that there are no other sequences. Let the variable $S_{m,m+k}$ for $k>0$ denote the sum $a_m+a_{m+1}+a_{m+2}+\dots{}+a_{m+k}$. Notice that
\[S_{1,n}<S_{n+1,2n}<S_{2n+1,3n}<\dots{}S_{n^2+1,n^2+n}\]which means that $S_{cn+1,cn+n}=c$ for any integer $c$ from $0$ to $n$ inclusive.

Now we will prove that $a_{n+1}=a_{n+2}=\dots{}=a_{2n-1}=0$, and $a_{2n}=1$. Notice that since $S_{n+1,2n}=1$, we have that exactly one of the $n$ values between $a_{n+1}$ and $a_{2n}$ is $1$, and because $S_{1,n}=0$, we also must have that $a_1=a_2=\dots{}=a_n=0$.

FTSOC, assume that $a_{n+1}=1$. From the condition, we have that
\[S_{2,n+1}<S_{n+2,2n+1}<\dots{}S_{n^2-n+2,n^2+1}\]and since $S_{2,n+1}=1$, we must have that $S_{n+2,2n+1}=2$. However, this implies that $a_{2n+1}=2$, a clear contradiction.

Similarly, if we let $a_{n+c}=1$ for some $0<c<n$, we will find that it implies that $a_{cn+1}=2$, a contradiction. Therefore, we must have that $a_{2n}=1$. Similarly, we can do this for the other $n-1$ blocks of binary with sums $2$, $3$, $\dots$, $n-1$ by focusing on the first $1$ that appears in that block, and we can conclude that it will always be $a_{cn-c+2}=a_{cn-c+3}=\dots{}=a_{cn}=1$. Therefore there is only one sequence, and we are done.
This post has been edited 1 time. Last edited by peppapig_, Apr 30, 2023, 2:48 PM
Reason: fakesolve fix
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
#27 • 1 Y
Y by ImSh95
Solution
This post has been edited 1 time. Last edited by vsamc, Apr 23, 2023, 3:43 PM
Reason: add ommited observation
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
Math4Life7
1703 posts
#28 • 2 Y
Y by ImSh95, Amir Hossein
We compare the $n+1$ groups of $n$ integers from beginning to the end. We can see that since there are $n+1$ possible values of the sum, the $n$th group must sum to $n-1$. We claim that the only configuration is when those $n-1$ $1$'s are at the end of that group. Specifically, for $n = 4$ our configuration is: \[00000001001101111111\]
We can see that this works since there are always increments for every increment in $n$

We claim by induction that we cannot have $a_x = 1$ where $x = y \cdot n + z$ where $y$ and $z$ are integers with $0 \leq y \leq n$ and $0 \leq z \leq n-y$.

Our base case is trivial.

Now for the inductive step. If we have $x = 1$, then we can compare the $n$ groups of $n$ numbers from \[ \{a_{z+1} \ldots a_{n+z} \}, \{a_{n+z+1} \ldots a_{2n+z} \} , \ldots \{a_{n^2 - n +z+1} \ldots a_{n^2 + z} \} \]. We can see from our inductive step that for each of first $y-1$ terms they equal every integer from $0$ to $y-2$ we can see that the term that contains $x$ is $y$ (also from our inductive step). Since there are $n$ terms in total, we can see that the next $n - y$ terms must occupy every integer from $y+1$ to $n$.

We can thus compute that the total number of $1$'s would be $\frac{(y-1)(y-2)}{2} + \frac{(n+y)(n-y+1)}{2}$. Simplifying this we can see that this is equal to $\binom{n}{2} + 1$. However, we know that the total number of $1$'s is $\binom{n}{2}$. Contradiction. $\blacksquare$
This post has been edited 3 times. Last edited by Math4Life7, Jun 17, 2023, 7:29 PM
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
#29
Y by
holy this took me 3 hours, imo should be placed in c3 lol
The key is to compare partial sums $s_i=a_{i+1}+\dots+a_{i+n}$. The condition implies $s_0<s_n<\dots<s_{n^2}$; in particular, since these values range from 0 to n, and there are n+1 groups, each group corresponds s.t. $s_{kn}=k$ (rigid!). We proceed by induction to show that there is one unique sequence, namely the sequence starting with the first n numbers 0, then the next string of n numbers having n-1 0s, with the last number being a 1, etc. by increasing the number of 1s that end in a string with length n. It's easy to check that this works. The base case n=1 is easily verified because the condition only needs to hold for i=0, meaning $a_1<a_2$ so it's just $0,1$ unique.

Then take the smallest i s.t. $a_i=1$ (rigid!), along with $s_n=1$ implying $n+1\le i\le 2n$. Also, noting that the value of i makes $s_{i-n}$ contain $a_i$, meaning it's at least 1, we get $$1\le s_{i-n}< s_i <\dots s_{i+(n-2)n}\le n\implies s_{i+nj} = j+2\implies\sum_{k=0}^{n} s_{nk} = \sum_{j=-1}^{n-2}s_{i+nj}$$since there are n choices and n values for $s_{i+nj}$; in particular, there cannot be any 1s in $(i+(n-2)n,n^2+n]$ (since otherwise the sums are nonequivalent), which implies, along with the fact that $s_{n^2}=n\implies a_x=1\forall n^2+1\le x\le n^2+n$, that we must have $i+(n-2)n=n^2\implies i=2n$ (otherwise there is a 1 in between).

On the other hand, note that $s_{2n-1}$ contains $a_{2n}$ and another 1, since it has at least as many 1s as $s_{2n}=2$ minus 1 (if $a_{2n}$ were to equal 1). So we have the bound $$2\le s_{2n-1} < s_{3n-1} < \ldots < s_{n^2-1} \le n\implies 2=s_{2n-1}=s_{2n}\stackrel{a_{2n}=1}{\implies}a_{3n}=1;$$in the same manner inductively (next we would take $3=s_{3n-1}=s_{3n}\stackrel{a_{3n}=1}{\implies}a_{4n}=1$), we can get that $a_{ln}=1$. Now, we can erase $a_x\forall x\in\{1,2,...,n,2n,3n,...,n^2+n\}$, which doesn't effect the condition, so we are done, because this has reduced the problem by 2n, which is indeed $n^2+n-(n-1)^2-(n-1)=2n$ into the hypothesis $(n-1)^2$. We already know that the terms that we erased did satisfy our claimed sequence, whence nothing changes. $\blacksquare$

edit: in OTIS version it said $n\ge 1$, which is why i used base case n=1; probably n=2 shouldn't be too nontrivial though even though its SIX VARIABLES.

also is it fine in contest if you extend domain given that there's no problems? im not sure if this is plausible someone pls answer
This post has been edited 1 time. Last edited by huashiliao2020, Aug 13, 2023, 5:38 AM
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
cursed_tangent1434
565 posts
#30 • 1 Y
Y by Shreyasharma
Kinda involved bruh.
Heres my sol.

We claim there exists only one such sequence which is the sequence,
\begin{align*}
    a_1=a_2=\dots=a_n &= 0\\
    a_{n+1} = a_{n+2} = \dots = a_{2n-1}&=0 \ a_{2n}=1\\
    a_{2n+1} = a_{2n+2} = \dots = a_{3n-2}&=0 \ a_{3n-1}=a_{3n}=1\\
    &\vdots\\
    a_{n^2-n+1} =0 \ a_{n^2-n +2} = \dots = a_{n^2-1} = a_{n^2}&=1\\
    a_{n^2+1}=a_{n^2+2} = \dots = a_{n^2+n} &=1
\end{align*}It is clear that this sequence clearly satisfies the required condition since if $a_k,a_{k+1},\dots,a_{l} \in \{a_{i+1},\dots,a_{i+n}\}$ are 1s for $0\leq i \leq n^2-n$, then so are $a_{k+n},a_{k+1+n},\dots,a_{l+n}$ an in addition so is $a_{k+n-1}$ confirming the strict inequality. We shall then show that this is the only sequence which satisfies the given conditions.

We have the following key claim.
Claim : Consider the range $a_{(k-1)n+1},\dots,a_{kn}$. There exists no terms $a_i=1$ such that $i<kn-k+2$.

Proof : Consider the above range. By way of contradiction, assume that there exists some $i<kn-k+2$ such that $a_i=1$. Let $m$ be the minimum such index. Let $m=kn-n+p$ ($p<n-k+2$).

First, we have the chain of inequalities
\[a_1+\dots+a_n < a_{n+1}+\dots + a_{2n} < \dots < a_{n^2}+\dots + a_{n^2+n}\]This means that since we only have 0s and 1s as terms, $a_(k-1)n+1+ \dots a_{kn} = k-1$ for all $1 \leq k \leq n+1$.
First, note that since $m$ is the minimum such index, and $m<kn-k+2$,
\[a_{m-n+1} + \dots + a_{m-1} + a_m = (k-2)+a_{(k-1)n+1}+\dots + a_m = k-1\]Then, we have the following chain of inequalities,
\begin{align*}
        k-1 = a_{m-n+1} + \dots + a_{m-1} + a_m &< a_{m+1}+\dots + a_{kn} + a_{kn+1} + \dots + a_{m+n}\\
        &< a_{m+n+1} + \dots + a_{(k+1)n} + a_{(k+1)n +1} + \dots + a_{m+2n}\\
        &\vdots\\
        &< a_{n(n-k)+m+1} + \dots + a_{n^2} + a_{n^2+1} + \dots + a_{n(n-k+1)+m}
    \end{align*}Note that since these are strict inequalities the value of each sum must be atleast 1 more than the previous (this is what we use below).

Now, we require $a_{m+1}+\dots + a_{kn} = k-2$ as $a_{(k-1)n+1} + \dots + a_{m+1}+\dots + a_{kn}=k-1$. This then gives us that
\[a_{kn+1} + \dots + a_{m+n} > 2\]Since the sum $a_{kn+1} + \dots + a_{(k+1)n}=k$ again this gives
\[a_{m+n+1} + \dots + a_{(k+1)n} < k-2\]Again using the sum of $a_{(k+1)n+1}+\dots + a_{(k+2)n} = k+1$ we must have
\[ a_{(k+1)n +1} + \dots + a_{m+2n} > 3\]we then continue likewise. If it is indeed possible to have $a_m=1$, then there must exist possible values for all $a_i$ when $a_m=1$. Thus, this continues until the last bath of terms, giving us that
\[a_{n^2} + a_{n^2+1} + \dots + a_{n(n-k+1)+m} > n-k+2\]But, note that since $m=kn-n+p$, we also have
\[a_{n^2} + a_{n^2+1} + \dots + a_{n(n-k+1)+m} < 1(m-nk+n)+1 = kn -n + p -nk + n +1 = p+1 \leq n-k+2\]which is a clear contradiction to the previous inequality. Thus, clear there cannot exist such $c$.

Now, by the nature of the claim it is clear that indeed the above described sequence is the only one which works.
This post has been edited 1 time. Last edited by cursed_tangent1434, Sep 1, 2023, 1:12 AM
Reason: edits
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
shendrew7
793 posts
#31
Y by
We claim the only sequence which works is analogous to the following example for $n=4$:
\[0000~0001~0011~0111~1111.\]
Define a $(k)$ block as a block of $n$ consecutive terms starting with $a_j$, where $j \equiv k \pmod n$. Notice the $n+1$ $(1)$ blocks are fixed up to permutation, as the minimum possible sum is 0 and the maximum is $n$.

It follows that all $(k)$ blocks are also fixed up to permutation. Since the first/last $(1)$ blocks must be all 0s/1s, the total sum of all $(k)$ blocks, for each $2 \leq k \leq n$, will be $\tfrac{n(n+1)}{2} - (n-k)$, which can only be written as the sum of $n$ distinct integers between 0 and $n$, inclusive, as
\[0+1+2+\ldots+(n-k-1)+(n-k+1)+\ldots+n.\]
Going from left to right, we can fix each term of the sequence by considering increments. $\blacksquare$
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
ezpotd
1251 posts
#32 • 1 Y
Y by de-Kirschbaum
Define a block starting at index $i$ to be refer to the $n$ consecutive elements of the sequence $a$ starting at $a_i$.



We claim that the answer is only the sequence uniquely defined by the blocks starting at $ni + 1$ being $n - i$ 0s followed by $i$ 1s.



Proof that this works: For each element $a_i$, if $a_i$ is $1$ then $a_{n + i}$ is also $1$, if $a_i$ is $0$ we only have $a_{n + i} = 1$ if $i = nj + n - j$. We see that for each element of the block, the corresponding element in the next block is at least the current element, and we are also guaranteed to have an element with index $(n -1)(j + 1) + 1$ in each block, since it's just things that are $1$ mod $n - 1$, so the inequality is strict.



Proof of necessity: We induct, base case is trivial for $n = 1$. We see all the blocks of starting with $ni + 1$ have distinct sums, so they must be $0,1, \cdots n$ in that order, so each block of that form has $i$ 1s. We show each of these blocks must end with $1$. Call these block ending indices "good". Consider the first good index that is not a $1$ and is not index $n$. If the index is $kn$ for $k > 2$, we know the block starting with $(k - 1)n$ contains $1 + k - 1 = k$ 1s, and the block starting at $kn$ contains at most the number of 1s as the block starting with $kn + 1$, which is $k$, so the property cannot be satisfied. If $k = 2$, let the position of the unique $1$ in that block be $n + c$. Now we inductively prove that each block starting at $xn + c + 1$ has $x$ 1s, as well as all elements from $xn + n+c + 1$ to $xn + 2n$ being 0. The base case of $x = 0$ is obvious, then clearly if it is true for $x - 1$ we need at least $x$ 1s in the block $xn + c + 1$, we know cannot have anything positive from $xn + c + 1$ to $xn + n$, but for the sum to be at least $x$ we then need all 1s in the block starting at $xn + n + 1$ to be in the block starting at $xn + c + 1$, meaning that there is nothing in the range $xn + n + c + 1$ to $xn + 2n$, since all $x$ 1s were used up in the first $c$ elements of the block, which also forces the sum to be exactly $x$. Now at some point we end up with all the $1$s in the block starting at $ni + 1$ in the first $c$ elements of the block, but there is eventually going to be more than $c$ 1s in the block, contradiction. Thus no good indices can have a $0$.

Now, we can remove the first $n$ elements. The property still must hold for the remaining indices, and note that each block contains exactly one good index, so we can just remove all good indices and the property should still hold for blocks of size $n - 1$. Since we are also left with $n^2 - n$ elements, we can just induct.
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
Maximilian113
524 posts
#33
Y by
I'm not sure of a more efficient method other than literally bashing...

We claim that the only sequence that works is the one defined with $n+1$ "blocks" of $n$ numbers, with the $k$th block having $k-1$ $1$'s at its end. For, example, for $n=4$ it would be: $0000|0001|0011|0111|1111.$

Let $S_k = a_k+a_{k+1}+\cdots+a_{k+n-1}.$ Then $0 \leq S_1<S_{n+1}<\cdots < S_{n^2+1} \leq n \implies S_{mn+1}=m$ for $1 \leq m \leq n.$ Therefore there is a total of $S=n(n+1)/2$ $1$'s in the sequence. Meanwhile, for $0 \leq r < n, r \neq 1,$ we have that $0 \leq S_r < S_{r+n}<\cdots < S_{r+n(n-1)} \leq n,$ so this list is the list $0, 1, 2, \dots, n$ but with one of these numbers not appearing. However, note that their sum is $S,$ hence because $S_{r+n(n-1)}$ goes up to index $a_{r+n^2-1},$ there are still $n^2+n-(r+n^2-1) = n-r+1$ $1$'s at the end (since $S_{n^2+1}=n$). Therefore, $S_r, S_{r+n}, \cdots$ is the list $0, 1, 2, \cdots, n$ but with $n-r+1$ missing.

Then, it is easy to show from a process-like argument that $S_i$ is a sequence with $n$ $1$'s, then $n-1$ $2$'s, $n-1$ $3$'s, etc. until $n-1$ $n$'s, and finally one $n=S_{n^2+1}.$

Now, we have the recurrence $a_k=(S_{k-n+1}-S_{k-n})+a_{k-n},$ so the increment depends on the difference between consecutive $S_k$s. Then, going through the sequence manually would finish. QED
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
EpicBird08
1741 posts
#34
Y by
The only such sequence is that satisfying $a_i = 1$ if $kn - k+2 <= i <= kn$ for some $1 \le k \le n+1$ and $a_i = 0$ otherwise. For concreteness, we provide the sequence for $n = 5$ below; splitting the sequence into "chunks" will make the construction more clear: $$0,0,0,0,0|0,0,0,0,1|0,0,0,1,1|0,0,1,1,1|0,1,1,1,1|1,1,1,1,1.$$One can check (say by making a table) that this works.

It suffices to show that there is at most one sequence satisfying the desired property. Consider the sums $$a_1 + \dots + a_n < a_{n+1} + \dots + a_{2n} < \dots < a_{n^2+1} + \dots + a_{n^2 + n}.$$These sums hence take on $n+1$ distinct values, but there are only $n+1$ possible values for each sum, those being the integers between $0$ and $n$ inclusive. Hence $a_1 + \dots + a_n = 0$ and $a_{n^2+1} + \dots + a_{n^2+n} = n.$ As such, $a_i = 0$ for $1 \le i \le n$ and $a_i = 1$ for $n^2 + 1 \le i \le n^2 + n.$ Additionally, we see that each sum counts the number of ones in the sum, so there are a total of $0 + 1 + \dots + n = \frac{n^2+n}{2}$ ones.

For any $2 \le k \le n,$ we can say something similar about the sums $$a_k + \dots + a_{k+n-1} < a_{k+n} + \dots + a_{k+2n-1} < \dots < a_{k+n^2-n} + \dots + a_{k+n^2-1}.$$These sums take on distinct integers between $0$ and $n,$ inclusive. For brevity, let $s_i = a_i + \dots + a_{n+i-1}.$ Then $$s_k + s_{k+n} + \dots + s_{k+n^2-n} = \frac{n^2+n}{2} - (n-k+1).$$Given that the $s_{k+mn}$ are integers in strictly increasing order, this implies that there is exactly one way to assign values to each of the $s_{k+mn}$. As such, this implies that for all $i,$ we have that $s_i$ is always equal to a fixed value. From this, since $s_1 = 0$ implies $a_i = 0$ for $1 \le i \le n,$ we uniquely determine the sequence $a_i.$

Since the sequence we claimed at the beginning works, we are done.
This post has been edited 3 times. Last edited by EpicBird08, Jan 31, 2025, 9:08 PM
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
de-Kirschbaum
187 posts
#35
Y by
This solution is a lot easier to follow if you just draw the pictures. It's just annoying to actually write everything out in indices.

Consider filling in a $n+1 \times n$ matrix with the elements in order. Then, the only sequences that work are ones where the last $i$ elements of the $i$th row are 1 and everywhere else is 0. For example, for $n=3$ we have
$$\begin{bmatrix}
0 & 0 & 0 \\ 0 & 0 & 1\\ 0 & 1 & 1 \\ 1 & 1 & 1
\end{bmatrix}$$
It is not difficult to verify that any sequence of this form does work. Now, we will prove that they are the only viable sequences.

First, note that for any $n$, we have the inequality $$a_1+a_2+a_3+\ldots+a_n < a_{n+1}+a_{n+2}+a_{n+3}+\ldots+a_{2n}< a_{2n+1}+a_{2n+2}+\ldots+a_{3n}<\cdots < a_{n^2+1}+\ldots+a_{n^2+n}$$This means that we must have $$a_1+a_2+\ldots+a_n=0, a_{n+1}+a_{n+2}+a_{n+3}+\ldots+a_{2n}=2, \ldots, a_{n^2+1}+\ldots+a_{n^2+n}=n$$
So we know that in our matrix, the $i$th row must contain $i-1$ 1s for all $1 \leq i \leq n+1$. Now, we start with the second row. If the $1$ is in some entry $n+j \leq 2n-1$, then we must have $a_{j+1}+\ldots + a_{n+j}=1<a_{n+j+1}+\ldots+a_{2n+j}$ which means that both of the 1s must be in the first $j$ entries of the second row. We can then repeat the process with $a_{n+j+1}+\ldots+a_{2n+j}<a_{2n+j+1}+\ldots+a_{3n+j}$ and we would get that the three 1s in row 4 must all be in the first $j$ entries. Repeating, eventually we arrive at row $j+1 \leq n$ where all $j$ 1s in row are in the first $j$ entries, then repeating the process we must have $j+1$ 1s in the first $j$ entries of the $j+2 \leq n+1$nd row and that is impossible. Thus, the first 1 must be in the $n$th entry of the 2nd row. Then, if $a_{3n+k}=a_{3n+t}=1, k<t \leq n-1$ we could consider the shortest sequence of length $n$ ending at $a_{3n+t}$ and take the replica of that sequence shifted up by $n$. Then, we get that the 4th row must contain 4 1s, and that's impossible. Thus the $n$th entry of row 3 must be a 1. Similarly, the $n$th entry of every row besides the first one must be a 1.

Now we remove the last column and the first row of the matrix. Note that we end up with a matrix of size $n \times n-1$ where the $i$th row has sum $i-1$ for all $1 \leq i \leq n+1$. Now, for any $$a_j+a_{j+1}+a_{j+2}+\ldots+a_{j+n}<a_{j+n+1}+\ldots +a_{j+2n}$$in the original matrix, we have that there is exactly one element (the one in the last column) removed from the left side of the inequality, and one element (the one in the last column) removed from the right side of the inequality. Since we have established that those must both be 1, the inequality still holds without them. Thus this smaller matrix must satisfy every condition in the problem. We can now see that this is the only possible construction by induction.
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
AshAuktober
960 posts
#36
Y by
Same as the official sol, although this is so filled with writing I won't even bother writing it up.
Z K Y
N Quick Reply
G
H
=
a