Happy Memorial Day! Please note that AoPS Online is closed May 24-26th.

G
Topic
First Poster
Last Poster
k a May Highlights and 2025 AoPS Online Class Information
jlacosta   0
May 1, 2025
May is an exciting month! National MATHCOUNTS is the second week of May in Washington D.C. and our Founder, Richard Rusczyk will be presenting a seminar, Preparing Strong Math Students for College and Careers, on May 11th.

Are you interested in working towards MATHCOUNTS and don’t know where to start? We have you covered! If you have taken Prealgebra, then you are ready for MATHCOUNTS/AMC 8 Basics. Already aiming for State or National MATHCOUNTS and harder AMC 8 problems? Then our MATHCOUNTS/AMC 8 Advanced course is for you.

Summer camps are starting next month at the Virtual Campus in math and language arts that are 2 - to 4 - weeks in duration. Spaces are still available - don’t miss your chance to have an enriching summer experience. There are middle and high school competition math camps as well as Math Beasts camps that review key topics coupled with fun explorations covering areas such as graph theory (Math Beasts Camp 6), cryptography (Math Beasts Camp 7-8), and topology (Math Beasts Camp 8-9)!

Be sure to mark your calendars for the following upcoming events:
[list][*]May 9th, 4:30pm PT/7:30pm ET, Casework 2: Overwhelming Evidence — A Text Adventure, a game where participants will work together to navigate the map, solve puzzles, and win! All are welcome.
[*]May 19th, 4:30pm PT/7:30pm ET, What's Next After Beast Academy?, designed for students finishing Beast Academy and ready for Prealgebra 1.
[*]May 20th, 4:00pm PT/7:00pm ET, Mathcamp 2025 Qualifying Quiz Part 1 Math Jam, Problems 1 to 4, join the Canada/USA Mathcamp staff for this exciting Math Jam, where they discuss solutions to Problems 1 to 4 of the 2025 Mathcamp Qualifying Quiz!
[*]May 21st, 4:00pm PT/7:00pm ET, Mathcamp 2025 Qualifying Quiz Part 2 Math Jam, Problems 5 and 6, Canada/USA Mathcamp staff will discuss solutions to Problems 5 and 6 of the 2025 Mathcamp Qualifying Quiz![/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
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
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, 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
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
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
Tuesday, May 6 - Aug 19
Wednesday, Jun 4 - Sep 17
Sunday, Jun 22 - Oct 19
Friday, Jul 18 - Nov 14

Introduction to Geometry
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

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

Intermediate: Grades 8-12

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

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

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

Precalculus
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
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
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

AIME Problem Series A
Thursday, May 22 - Jul 31

AIME Problem Series B
Sunday, Jun 22 - Sep 21

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
Mon, Tue, Wed & Thurs, Jun 23 - Jun 26 (meets every day of the week!)
0 replies
jlacosta
May 1, 2025
0 replies
k i Suggestion Form
jwelsh   0
May 6, 2021
Hello!

Given the number of suggestions we’ve been receiving, we’re transitioning to a suggestion form. If you have a suggestion for the AoPS website, please submit the Google Form:
Suggestion Form

To keep all new suggestions together, any new suggestion threads posted will be deleted.

Please remember that if you find a bug outside of FTW! (after refreshing to make sure it’s not a glitch), make sure you’re following the How to write a bug report instructions and using the proper format to report the bug.

Please check the FTW! thread for bugs and post any new ones in the For the Win! and Other Games Support Forum.
0 replies
jwelsh
May 6, 2021
0 replies
k i Read me first / How to write a bug report
slester   3
N May 4, 2019 by LauraZed
Greetings, AoPS users!

If you're reading this post, that means you've come across some kind of bug, error, or misbehavior, which nobody likes! To help us developers solve the problem as quickly as possible, we need enough information to understand what happened. Following these guidelines will help us squash those bugs more effectively.

Before submitting a bug report, please confirm the issue exists in other browsers or other computers if you have access to them.

For a list of many common questions and issues, please see our user created FAQ, Community FAQ, or For the Win! FAQ.

What is a bug?
A bug is a misbehavior that is reproducible. If a refresh makes it go away 100% of the time, then it isn't a bug, but rather a glitch. That's when your browser has some strange file cached, or for some reason doesn't render the page like it should. Please don't report glitches, since we generally cannot fix them. A glitch that happens more than a few times, though, could be an intermittent bug.

If something is wrong in the wiki, you can change it! The AoPS Wiki is user-editable, and it may be defaced from time to time. You can revert these changes yourself, but if you notice a particular user defacing the wiki, please let an admin know.

The subject
The subject line should explain as clearly as possible what went wrong.

Bad: Forum doesn't work
Good: Switching between threads quickly shows blank page.

The report
Use this format to report bugs. Be as specific as possible. If you don't know the answer exactly, give us as much information as you know. Attaching a screenshot is helpful if you can take one.

Summary of the problem:
Page URL:
Steps to reproduce:
1.
2.
3.
...
Expected behavior:
Frequency:
Operating system(s):
Browser(s), including version:
Additional information:


If your computer or tablet is school issued, please indicate this under Additional information.

Example
Summary of the problem: When I click back and forth between two threads in the site support section, the content of the threads no longer show up. (See attached screenshot.)
Page URL: http://artofproblemsolving.com/community/c10_site_support
Steps to reproduce:
1. Go to the Site Support forum.
2. Click on any thread.
3. Click quickly on a different thread.
Expected behavior: To see the second thread.
Frequency: Every time
Operating system: Mac OS X
Browser: Chrome and Firefox
Additional information: Only happens in the Site Support forum. My tablet is school issued, but I have the problem at both school and home.

How to take a screenshot
Mac OS X: If you type ⌘+Shift+4, you'll get a "crosshairs" that lets you take a custom screenshot size. Just click and drag to select the area you want to take a picture of. If you type ⌘+Shift+4+space, you can take a screenshot of a specific window. All screenshots will show up on your desktop.

Windows: Hit the Windows logo key+PrtScn, and a screenshot of your entire screen. Alternatively, you can hit Alt+PrtScn to take a screenshot of the currently selected window. All screenshots are saved to the Pictures → Screenshots folder.

Advanced
If you're a bit more comfortable with how browsers work, you can also show us what happens in the JavaScript console.

In Chrome, type CTRL+Shift+J (Windows, Linux) or ⌘+Option+J (Mac).
In Firefox, type CTRL+Shift+K (Windows, Linux) or ⌘+Option+K (Mac).
In Internet Explorer, it's the F12 key.
In Safari, first enable the Develop menu: Preferences → Advanced, click "Show Develop menu in menu bar." Then either go to Develop → Show Error console or type Option+⌘+C.

It'll look something like this:
IMAGE
3 replies
slester
Apr 9, 2015
LauraZed
May 4, 2019
k i Community Safety
dcouchman   0
Jan 18, 2018
If you find content on the AoPS Community that makes you concerned for a user's health or safety, please alert AoPS Administrators using the report button (Z) or by emailing sheriff@aops.com . You should provide a description of the content and a link in your message. If it's an emergency, call 911 or whatever the local emergency services are in your country.

Please also use those steps to alert us if bullying behavior is being directed at you or another user. Content that is "unlawful, harmful, threatening, abusive, harassing, tortuous, defamatory, vulgar, obscene, libelous, invasive of another's privacy, hateful, or racially, ethnically or otherwise objectionable" (AoPS Terms of Service 5.d) or that otherwise bullies people is not tolerated on AoPS, and accounts that post such content may be terminated or suspended.
0 replies
dcouchman
Jan 18, 2018
0 replies
Inspired by RMO 2006
sqing   6
N a few seconds ago by sqing
Source: Own
Let $ a,b >0  . $ Prove that
$$  \frac {a^{2}+1}{b+k}+\frac { b^{2}+1}{ka+1}+\frac {2}{a+kb}  \geq \frac {6}{k+1}  $$Where $k\geq 0.03 $
$$  \frac {a^{2}+1}{b+1}+\frac { b^{2}+1}{a+1}+\frac {2}{a+b}  \geq 3  $$
6 replies
sqing
Saturday at 3:24 PM
sqing
a few seconds ago
Simple triangle geometry [a fixed point]
darij grinberg   50
N a few seconds ago by ezpotd
Source: German TST 2004, IMO ShortList 2003, geometry problem 2
Three distinct points $A$, $B$, and $C$ are fixed on a line in this order. Let $\Gamma$ be a circle passing through $A$ and $C$ whose center does not lie on the line $AC$. Denote by $P$ the intersection of the tangents to $\Gamma$ at $A$ and $C$. Suppose $\Gamma$ meets the segment $PB$ at $Q$. Prove that the intersection of the bisector of $\angle AQC$ and the line $AC$ does not depend on the choice of $\Gamma$.
50 replies
darij grinberg
May 18, 2004
ezpotd
a few seconds ago
IMO 2009, Problem 2
orl   143
N 5 minutes ago by ezpotd
Source: IMO 2009, Problem 2
Let $ ABC$ be a triangle with circumcentre $ O$. The points $ P$ and $ Q$ are interior points of the sides $ CA$ and $ AB$ respectively. Let $ K,L$ and $ M$ be the midpoints of the segments $ BP,CQ$ and $ PQ$. respectively, and let $ \Gamma$ be the circle passing through $ K,L$ and $ M$. Suppose that the line $ PQ$ is tangent to the circle $ \Gamma$. Prove that $ OP = OQ.$

Proposed by Sergei Berlov, Russia
143 replies
orl
Jul 15, 2009
ezpotd
5 minutes ago
Interesting inequality
sqing   2
N 19 minutes ago by aidan0626
Source: Own
Let $ (a+b)^2+(a-b)^2=1. $ Prove that
$$0\geq (a+b-1)(a-b+1)\geq -\frac{3}{2}-\sqrt 2$$$$ -\frac{9}{2}+2\sqrt 2\geq (a+b-2)(a-b+2)\geq -\frac{9}{2}-2\sqrt 2$$
2 replies
+2 w
sqing
an hour ago
aidan0626
19 minutes ago
Request for the access of private marathons
Vulch   8
N 4 hours ago by roye
To all AoPS users and admin,
Sometimes I came across the marathon(i .e number theory marathon, functional equation marathon etc) which allow access only after submitting log in request.There is no other way to access the question related to that marathons.It would be glad to open all private marathons publicly.Thank you!
8 replies
Vulch
Yesterday at 6:06 AM
roye
4 hours ago
plz friend admins
JohannIsBach   2
N 5 hours ago by JohannIsBach
hi just so u no im not trying 2 postfarm i just wanted 2 c how many aops admins i could get 2 friend me. if u dont like this then feel free 2 remove it
aops admins so far:
asuth_asuth
gmass
rrusczyk
sbarrack
thats all right now!
plz friend
again, if u dont like this then plz remove if u dont want it here
2 replies
JohannIsBach
5 hours ago
JohannIsBach
5 hours ago
Who is Halp! ? (resolvedd)
A7456321   8
N 5 hours ago by JohannIsBach
Is Halp! a bot? This user has been posting questions in nearly all of my AoPS classes when the user isn't a part of the class, and this user has 150k posts.
8 replies
A7456321
Saturday at 9:22 PM
JohannIsBach
5 hours ago
How to create a poll?
whwlqkd   32
N Yesterday at 6:54 PM by Yiyj
How to create a poll in aops?
32 replies
whwlqkd
Saturday at 12:24 PM
Yiyj
Yesterday at 6:54 PM
banned myself from own blog
Spacepandamath13   8
N Yesterday at 3:55 PM by sultanine
I got curious and decided to see if I can ban myself from my own blog.
can site admins give it back? it says site admins are the administrators of this blog

I honestly don't know where I come up with stuff like this
8 replies
Spacepandamath13
May 24, 2025
sultanine
Yesterday at 3:55 PM
resolved!
JohannIsBach   6
N May 24, 2025 by bpan2021
hi srry if this is in the rong place i didnt no where 2 put it i was wondering how u find a user? i tried using the search but they dont have any posts? dont no wat 2 do...
6 replies
JohannIsBach
May 24, 2025
bpan2021
May 24, 2025
k Introducing myself at AoPS, and what's your magic wand?
asuth_asuth   1193
N May 23, 2025 by Penguin117
Hi!

I'm Andrew Sutherland. I'm the new Chief Product Officer at AoPS. As you may have read, Richard is retiring and Ben Kornell and I are working together to lead the company now. I'm leading all the software and digital stuff at AoPS. I just wanted to say hello and introduce myself! I'm really excited to be part of the special community that is AoPS.

Previously, I founded Quizlet as a 15-year-old high school student. I did Course 6 at MIT and then left to lead Quizlet full-time for a total of 14 years. I took a few years off and now I'm doing AoPS! I wrote more about all that on my blog: https://asuth.com/im-joining-aops

I have a question for all of you. If you could wave a magic wand, and change anything about AoPS, what would it be? All suggestions welcome! Thank you.
1193 replies
asuth_asuth
Mar 30, 2025
Penguin117
May 23, 2025
k how 2 play reaper?
JohannIsBach   3
N May 22, 2025 by JohannIsBach
hi srry if this is in the rong place i dont no where else 2 put it how do u play reaper? and is htere a link 2 the game? just wondering
3 replies
JohannIsBach
May 22, 2025
JohannIsBach
May 22, 2025
k Alcumus reset
Happycat2   1
N May 22, 2025 by bpan2021
Hi! Because you can't reset your alcumus when your in classes can you email sheriff and let them reset it? My class already ended but I think that you have to wait until it completely disappears but I'm signing up for another class so I can't reset it. So can you email sheriff?
1 reply
Happycat2
May 22, 2025
bpan2021
May 22, 2025
All Topics Marked
alpha31415   14
N May 22, 2025 by alpha31415
Excuse me!
for I am a frashman in aops.I wonder how I could get back to mark all my read.All topics in the forum became as if they had been marked.Would someone please help me deal with it???
14 replies
alpha31415
May 16, 2025
alpha31415
May 22, 2025
Find all sequences satisfying two conditions
orl   34
N Apr 23, 2025 by YaoAOPS
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
34 replies
orl
Jul 13, 2008
YaoAOPS
Apr 23, 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 • 4 Y
Y by vsathiam, ImSh95, Adventure10, H_Taken
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
596 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
1923 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
1449 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
7585 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.
1735 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
4190 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
8868 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_
280 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
3789 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
643 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
799 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
1295 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
575 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
1755 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
202 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
1009 posts
#36 • 1 Y
Y by H_Taken
Same as the official sol, although this is so filled with writing I won't even bother writing it up.
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
YaoAOPS
1541 posts
#37
Y by
Represent the sequence as an $n+1 \times n$ grid so that each row of the grid has $n$ elements and represents a consecutive sum. We write $a_{i,j} = a_{ni+j}$ for $0 \le i \le n, 1 \le j \le n$.

We claim that the only solution is when $a_{i,j} = 1$ if and only if $i+j \ge n+1$, which gives a pyramid of $1$s whose first row is all $0$s and last row is all $1$s.

We now show that $a_{i,n} = 1$ for all $i \ge 1$, which allows us to induct downward on the condition by deleting the first row and last column.

Since there are $n+1$ rows and only possible $n+1$ row sums, the sums of the numbers in the $n$th row must be $n-1$.

FTSOC suppose that $a_{i,n} = 0$ for some $i$. Then take maximal $j < n$ such that $a_{i,j} = 1$. Then we have that
\[
	i = a_{i,1} + \dots + a_{i,j} + a_{i-1,j+1} + \dots + a_{i-1,n} < 
	a_{i+1,1} + \dots + a_{i+1,j} + a_{i,j+1} + \dots + a_{i,n} =
	a_{i+1,1} + \dots + a_{i+1,j}
\]so $a_{i+1,1} + \dots + a_{i+1,j} = i+1$, and $j$ remains the sum. Repeating this, we get a contradiction when $i = j+1$. This finishes.
Z K Y
N Quick Reply
G
H
=
a