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

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 A Letter to MSM
Arr0w   23
N Sep 19, 2022 by scannose
Greetings.

I have seen many posts talking about commonly asked questions, such as finding the value of $0^0$, $\frac{1}{0}$,$\frac{0}{0}$, $\frac{\infty}{\infty}$, why $0.999...=1$ or even expressions of those terms combined as if that would make them defined. I have made this post to answer these questions once and for all, and I politely ask everyone to link this post to threads that are talking about this issue.
[list]
[*]Firstly, the case of $0^0$. It is usually regarded that $0^0=1$, not because this works numerically but because it is convenient to define it this way. You will see the convenience of defining other undefined things later on in this post.

[*]What about $\frac{\infty}{\infty}$? The issue here is that $\infty$ isn't even rigorously defined in this expression. What exactly do we mean by $\infty$? Unless the example in question is put in context in a formal manner, then we say that $\frac{\infty}{\infty}$ is meaningless.

[*]What about $\frac{1}{0}$? Suppose that $x=\frac{1}{0}$. Then we would have $x\cdot 0=0=1$, absurd. A more rigorous treatment of the idea is that $\lim_{x\to0}\frac{1}{x}$ does not exist in the first place, although you will see why in a calculus course. So the point is that $\frac{1}{0}$ is undefined.

[*]What about if $0.99999...=1$? An article from brilliant has a good explanation. Alternatively, you can just use a geometric series. Notice that
\begin{align*}
\sum_{n=1}^{\infty} \frac{9}{10^n}&=9\sum_{n=1}^{\infty}\frac{1}{10^n}=9\sum_{n=1}^{\infty}\biggr(\frac{1}{10}\biggr)^n=9\biggr(\frac{\frac{1}{10}}{1-\frac{1}{10}}\biggr)=9\biggr(\frac{\frac{1}{10}}{\frac{9}{10}}\biggr)=9\biggr(\frac{1}{9}\biggr)=\boxed{1}
\end{align*}
[*]What about $\frac{0}{0}$? Usually this is considered to be an indeterminate form, but I would also wager that this is also undefined.
[/list]
Hopefully all of these issues and their corollaries are finally put to rest. Cheers.

2nd EDIT (6/14/22): Since I originally posted this, it has since blown up so I will try to add additional information per the request of users in the thread below.

INDETERMINATE VS UNDEFINED

What makes something indeterminate? As you can see above, there are many things that are indeterminate. While definitions might vary slightly, it is the consensus that the following definition holds: A mathematical expression is be said to be indeterminate if it is not definitively or precisely determined. So how does this make, say, something like $0/0$ indeterminate? In analysis (the theory behind calculus and beyond), limits involving an algebraic combination of functions in an independent variable may often be evaluated by replacing these functions by their limits. However, if the expression obtained after this substitution does not provide sufficient information to determine the original limit, then the expression is called an indeterminate form. For example, we could say that $0/0$ is an indeterminate form.

But we need to more specific, this is still ambiguous. An indeterminate form is a mathematical expression involving at most two of $0$, $1$ or $\infty$, obtained by applying the algebraic limit theorem (a theorem in analysis, look this up for details) in the process of attempting to determine a limit, which fails to restrict that limit to one specific value or infinity, and thus does not determine the limit being calculated. This is why it is called indeterminate. Some examples of indeterminate forms are
\[0/0, \infty/\infty, \infty-\infty, \infty \times 0\]etc etc. So what makes something undefined? In the broader scope, something being undefined refers to an expression which is not assigned an interpretation or a value. A function is said to be undefined for points outside its domain. For example, the function $f:\mathbb{R}^{+}\cup\{0\}\rightarrow\mathbb{R}$ given by the mapping $x\mapsto \sqrt{x}$ is undefined for $x<0$. On the other hand, $1/0$ is undefined because dividing by $0$ is not defined in arithmetic by definition. In other words, something is undefined when it is not defined in some mathematical context.

WHEN THE WATERS GET MUDDIED

So with this notion of indeterminate and undefined, things get convoluted. First of all, just because something is indeterminate does not mean it is not undefined. For example $0/0$ is considered both indeterminate and undefined (but in the context of a limit then it is considered in indeterminate form). Additionally, this notion of something being undefined also means that we can define it in some way. To rephrase, this means that technically, we can make something that is undefined to something that is defined as long as we define it. I'll show you what I mean.

One example of making something undefined into something defined is the extended real number line, which we define as
\[\overline{\mathbb{R}}=\mathbb{R}\cup \{-\infty,+\infty\}.\]So instead of treating infinity as an idea, we define infinity (positively and negatively, mind you) as actual numbers in the reals. The advantage of doing this is for two reasons. The first is because we can turn this thing into a totally ordered set. Specifically, we can let $-\infty\le a\le \infty$ for each $a\in\overline{\mathbb{R}}$ which means that via this order topology each subset has an infimum and supremum and $\overline{\mathbb{R}}$ is therefore compact. While this is nice from an analytic standpoint, extending the reals in this way can allow for interesting arithmetic! In $\overline{\mathbb{R}}$ it is perfectly OK to say that,
\begin{align*}
a + \infty = \infty + a & = \infty, & a & \neq -\infty \\
a - \infty = -\infty + a & = -\infty, & a & \neq \infty \\
a \cdot (\pm\infty) = \pm\infty \cdot a & = \pm\infty, & a & \in (0, +\infty] \\
a \cdot (\pm\infty) = \pm\infty \cdot a & = \mp\infty, & a & \in [-\infty, 0) \\
\frac{a}{\pm\infty} & = 0, & a & \in \mathbb{R} \\
\frac{\pm\infty}{a} & = \pm\infty, & a & \in (0, +\infty) \\
\frac{\pm\infty}{a} & = \mp\infty, & a & \in (-\infty, 0).
\end{align*}So addition, multiplication, and division are all defined nicely. However, notice that we have some indeterminate forms here which are also undefined,
\[\infty-\infty,\frac{\pm\infty}{\pm\infty},\frac{\pm\infty}{0},0\cdot \pm\infty.\]So while we define certain things, we also left others undefined/indeterminate in the process! However, in the context of measure theory it is common to define $\infty \times 0=0$ as greenturtle3141 noted below. I encourage to reread what he wrote, it's great stuff! As you may notice, though, dividing by $0$ is undefined still! Is there a place where it isn't? Kind of. To do this, we can extend the complex numbers! More formally, we can define this extension as
\[\mathbb{C}^*=\mathbb{C}\cup\{\tilde{\infty}\}\]which we call the Riemann Sphere (it actually forms a sphere, pretty cool right?). As a note, $\tilde{\infty}$ means complex infinity, since we are in the complex plane now. Here's the catch: division by $0$ is allowed here! In fact, we have
\[\frac{z}{0}=\tilde{\infty},\frac{z}{\tilde{\infty}}=0.\]where $\tilde{\infty}/\tilde{\infty}$ and $0/0$ are left undefined. We also have
\begin{align*}
z+\tilde{\infty}=\tilde{\infty}, \forall z\ne -\infty\\
z\times \tilde{\infty}=\tilde{\infty}, \forall z\ne 0
\end{align*}Furthermore, we actually have some nice properties with multiplication that we didn't have before. In $\mathbb{C}^*$ it holds that
\[\tilde{\infty}\times \tilde{\infty}=\tilde{\infty}\]but $\tilde{\infty}-\tilde{\infty}$ and $0\times \tilde{\infty}$ are left as undefined (unless there is an explicit need to change that somehow). One could define the projectively extended reals as we did with $\mathbb{C}^*$, by defining them as
\[{\widehat {\mathbb {R} }}=\mathbb {R} \cup \{\infty \}.\]They behave in a similar way to the Riemann Sphere, with division by $0$ also being allowed with the same indeterminate forms (in addition to some other ones).
23 replies
Arr0w
Feb 11, 2022
scannose
Sep 19, 2022
k i Marathon Threads
LauraZed   0
Jul 2, 2019
Due to excessive spam and inappropriate posts, we have locked the Prealgebra and Beginning Algebra threads.

We will either unlock these threads once we've cleaned them up or start new ones, but for now, do not start new marathon threads for these subjects. Any new marathon threads started while this announcement is up will be immediately deleted.
0 replies
LauraZed
Jul 2, 2019
0 replies
k i Basic Forum Rules and Info (Read before posting)
jellymoop   368
N May 16, 2018 by harry1234
f (Reminder: Do not post Alcumus or class homework questions on this forum. Instructions below.) f
Welcome to the Middle School Math Forum! Please take a moment to familiarize yourself with the rules.

Overview:
[list]
[*] When you're posting a new topic with a math problem, give the topic a detailed title that includes the subject of the problem (not just "easy problem" or "nice problem")
[*] Stay on topic and be courteous.
[*] Hide solutions!
[*] If you see an inappropriate post in this forum, simply report the post and a moderator will deal with it. Don't make your own post telling people they're not following the rules - that usually just makes the issue worse.
[*] When you post a question that you need help solving, post what you've attempted so far and not just the question. We are here to learn from each other, not to do your homework. :P
[*] Avoid making posts just to thank someone - you can use the upvote function instead
[*] Don't make a new reply just to repeat yourself or comment on the quality of others' posts; instead, post when you have a new insight or question. You can also edit your post if it's the most recent and you want to add more information.
[*] Avoid bumping old posts.
[*] Use GameBot to post alcumus questions.
[*] If you need general MATHCOUNTS/math competition advice, check out the threads below.
[*] Don't post other users' real names.
[*] Advertisements are not allowed. You can advertise your forum on your profile with a link, on your blog, and on user-created forums that permit forum advertisements.
[/list]

Here are links to more detailed versions of the rules. These are from the older forums, so you can overlook "Classroom math/Competition math only" instructions.
Posting Guidelines
Update on Basic Forum Rules
What belongs on this forum?
How do I write a thorough solution?
How do I get a problem on the contest page?
How do I study for mathcounts?
Mathcounts FAQ and resources
Mathcounts and how to learn

As always, if you have any questions, you can PM me or any of the other Middle School Moderators. Once again, if you see spam, it would help a lot if you filed a report instead of responding :)

Marathons!
Relays might be a better way to describe it, but these threads definitely go the distance! One person starts off by posting a problem, and the next person comes up with a solution and a new problem for another user to solve. Here's some of the frequently active marathons running in this forum:
[list][*]Algebra
[*]Prealgebra
[*]Proofs
[*]Factoring
[*]Geometry
[*]Counting & Probability
[*]Number Theory[/list]
Some of these haven't received attention in a while, but these are the main ones for their respective subjects. Rather than starting a new marathon, please give the existing ones a shot first.

You can also view marathons via the Marathon tag.

Think this list is incomplete or needs changes? Let the mods know and we'll take a look.
368 replies
jellymoop
May 8, 2015
harry1234
May 16, 2018
Croatian mathematical olympiad, day 1, problem 2
Matematika   6
N 3 minutes ago by Cqy00000000
There were finitely many persons at a party among whom some were friends. Among any $4$ of them there were either $3$ who were all friends among each other or $3$ who weren't friend with each other. Prove that you can separate all the people at the party in two groups in such a way that in the first group everyone is friends with each other and that all the people in the second group are not friends to anyone else in second group. (Friendship is a mutual relation).
6 replies
Matematika
Apr 10, 2011
Cqy00000000
3 minutes ago
Game
Pascual2005   27
N an hour ago by HamstPan38825
Source: Colombia TST, IMO ShortList 2004, combinatorics problem 5
$A$ and $B$ play a game, given an integer $N$, $A$ writes down $1$ first, then every player sees the last number written and if it is $n$ then in his turn he writes $n+1$ or $2n$, but his number cannot be bigger than $N$. The player who writes $N$ wins. For which values of $N$ does $B$ win?

Proposed by A. Slinko & S. Marshall, New Zealand
27 replies
Pascual2005
Jun 7, 2005
HamstPan38825
an hour ago
MAP Goals
Antoinette14   7
N an hour ago by Rice_Farmer
What's yall's MAP goals for this spring?
Mine's a 300 (trying to beat my brother's record) but since I'm at a 285 rn, 290+ is more reasonable.
7 replies
Antoinette14
Yesterday at 11:59 PM
Rice_Farmer
an hour ago
Warning!
VivaanKam   25
N 2 hours ago by jb2015007
This problem will try to trick you! :!:

25 replies
VivaanKam
May 5, 2025
jb2015007
2 hours ago
Lines concur on bisector of BAC
Invertibility   2
N 3 hours ago by NO_SQUARES
Source: Slovenia 2025 TST 3 P2
Let $\Omega$ be the circumcircle of a scalene triangle $ABC$. Let $\omega$ be a circle internally tangent to $\Omega$ in $A$. Tangents from $B$ touch $\omega$ in $P$ and $Q$, such that $P$ lies in the interior of $\triangle{}ABC$. Similarly, tangents from $C$ touch $\omega$ in $R$ and $S$, such that $R$ lies in the interior of $\triangle{}ABC$.

Prove that $PS$ and $QR$ concur on the bisector of $\angle{}BAC$.
2 replies
Invertibility
3 hours ago
NO_SQUARES
3 hours ago
Why is the old one deleted?
EeEeRUT   16
N 3 hours ago by ravengsd
Source: EGMO 2025 P1
For a positive integer $N$, let $c_1 < c_2 < \cdots < c_m$ be all positive integers smaller than $N$ that are coprime to $N$. Find all $N \geqslant 3$ such that $$\gcd( N, c_i + c_{i+1}) \neq 1$$for all $1 \leqslant i \leqslant m-1$

Here $\gcd(a, b)$ is the largest positive integer that divides both $a$ and $b$. Integers $a$ and $b$ are coprime if $\gcd(a, b) = 1$.

Proposed by Paulius Aleknavičius, Lithuania
16 replies
EeEeRUT
Apr 16, 2025
ravengsd
3 hours ago
Renu would take $15$ days working $4$ hours per day to complete a certain task w
Vulch   3
N 4 hours ago by Capybara7017
Renu would take $15$ days working $4$ hours per day to complete a certain task whereas Seema would take $8$ days working $5$ hours per day to complete the same task. They decide to work together to complete this task. Seema agrees to work for double the number of hours per day as Renu, while Renu agrees to work for double the number of days as Seema. If Renu works $2$ hours per day, then the number of days Seema will work, is
3 replies
Vulch
Today at 1:44 PM
Capybara7017
4 hours ago
The best math formulas?
anticodon   18
N 4 hours ago by anticodon
my math teacher recently offhandedly mentioned in class that "the law of sines is probably in the top 10 of math formulas". This inspired me to make a top 10 list to see if he's right (imo he actually is...)

so I decided, it would be interesting to hear others' opinions on the top 10 and we can compile an overall list.

Attached=my list (sorry if you can't read my handwriting, I was too lazy to do latex, and my normal pencil handwriting looks better)

the formulas
18 replies
anticodon
Yesterday at 11:00 PM
anticodon
4 hours ago
Mathcounts Stories
Eyed   180
N 4 hours ago by Capybara7017
Because Mathcounts season is over, and I think we are free to discuss the problems, I think we can post our stories without fear of sharing information that is not allowed.
Hopefully this does not become too spammy, and I hope to see good quality stories. For example, I am not looking to see stories like this, or this.
Instead I would like to have higher quality stories.
Mods if this is not ok, then feel free to lock, I just hope we can all share our reflections on this contest, since mathcounts is now over.
Anyway, here's mine (At the request of Stormersyle)

old locked mathcounts stories thread
180 replies
Eyed
Jun 3, 2019
Capybara7017
4 hours ago
9 zeroes!.
ericheathclifffry   9
N 4 hours ago by Capybara7017
i personally have no idea
9 replies
ericheathclifffry
May 5, 2025
Capybara7017
4 hours ago
24 Game Strategies
Ljviolin11   1
N 4 hours ago by Capybara7017
Hello everybody! Probably most of you have heard of Game 24: You are given 4 numbers and you must add, subtract, multiply, and divide these numbers to achieve 24.
For example: 11, 9, 4, 7.
Solution
I am participating in a Game 24 contest soon. I have been using this online simulator to practie: https://www.4nums.com/. Sometimes, I can get the answer really quickly, but other times, it takes me a couple of minutes. Are there any general strategies that you have used for this game that you would recommend? Thank you very much!
1 reply
Ljviolin11
Today at 2:27 PM
Capybara7017
4 hours ago
prime numbers
wpdnjs   118
N 5 hours ago by Capybara7017
does anyone know how to quickly identify prime numbers?

thanks.
118 replies
wpdnjs
Oct 2, 2024
Capybara7017
5 hours ago
Calculate the distance AD
MTA_2024   0
Today at 3:50 PM
A semi-circle is inscribed in a quadrilateral $ABCD$. The center $O$ of the semi-circle is the midpoint of segment $AD$. We have $AB=9$ and $CD=16$.
Calculate the distance $AD$.
0 replies
MTA_2024
Today at 3:50 PM
0 replies
9 What is the best way to learn math???
lovematch13   93
N Today at 3:04 PM by ReticulatedPython
On the contrary, I'm also gonna try to send this to school admins. PLEASE DO NOT TROLL!!!!
93 replies
lovematch13
May 22, 2023
ReticulatedPython
Today at 3:04 PM
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
1915 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.
1717 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
4187 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
8862 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_
281 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
624 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
795 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
1266 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
1751 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
199 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
1005 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