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 Peer-to-Peer Programs Forum
jwelsh   157
N Dec 11, 2023 by cw357
Many of our AoPS Community members share their knowledge with their peers in a variety of ways, ranging from creating mock contests to creating real contests to writing handouts to hosting sessions as part of our partnership with schoolhouse.world.

To facilitate students in these efforts, we have created a new Peer-to-Peer Programs forum. With the creation of this forum, we are starting a new process for those of you who want to advertise your efforts. These advertisements and ensuing discussions have been cluttering up some of the forums that were meant for other purposes, so we’re gathering these topics in one place. This also allows students to find new peer-to-peer learning opportunities without having to poke around all the other forums.

To announce your program, or to invite others to work with you on it, here’s what to do:

1) Post a new topic in the Peer-to-Peer Programs forum. This will be the discussion thread for your program.

2) Post a single brief post in this thread that links the discussion thread of your program in the Peer-to-Peer Programs forum.

Please note that we’ll move or delete any future advertisement posts that are outside the Peer-to-Peer Programs forum, as well as any posts in this topic that are not brief announcements of new opportunities. In particular, this topic should not be used to discuss specific programs; those discussions should occur in topics in the Peer-to-Peer Programs forum.

Your post in this thread should have what you're sharing (class, session, tutoring, handout, math or coding game/other program) and a link to the thread in the Peer-to-Peer Programs forum, which should have more information (like where to find what you're sharing).
157 replies
jwelsh
Mar 15, 2021
cw357
Dec 11, 2023
k i C&P posting recs by mods
v_Enhance   0
Jun 12, 2020
The purpose of this post is to lay out a few suggestions about what kind of posts work well for the C&P forum. Except in a few cases these are mostly meant to be "suggestions based on historical trends" rather than firm hard rules; we may eventually replace this with an actual list of firm rules but that requires admin approval :) That said, if you post something in the "discouraged" category, you should not be totally surprised if it gets locked; they are discouraged exactly because past experience shows they tend to go badly.
-----------------------------
1. Program discussion: Allowed
If you have questions about specific camps or programs (e.g. which classes are good at X camp?), these questions fit well here. Many camps/programs have specific sub-forums too but we understand a lot of them are not active.
-----------------------------
2. Results discussion: Allowed
You can make threads about e.g. how you did on contests (including AMC), though on AMC day when there is a lot of discussion. Moderators and administrators may do a lot of thread-merging / forum-wrangling to keep things in one place.
-----------------------------
3. Reposting solutions or questions to past AMC/AIME/USAMO problems: Allowed
This forum contains a post for nearly every problem from AMC8, AMC10, AMC12, AIME, USAJMO, USAMO (and these links give you an index of all these posts). It is always permitted to post a full solution to any problem in its own thread (linked above), regardless of how old the problem is, and even if this solution is similar to one that has already been posted. We encourage this type of posting because it is helpful for the user to explain their solution in full to an audience, and for future users who want to see multiple approaches to a problem or even just the frequency distribution of common approaches. We do ask for some explanation; if you just post "the answer is (B); ez" then you are not adding anything useful.

You are also encouraged to post questions about a specific problem in the specific thread for that problem, or about previous user's solutions. It's almost always better to use the existing thread than to start a new one, to keep all the discussion in one place easily searchable for future visitors.
-----------------------------
4. Advice posts: Allowed, but read below first
You can use this forum to ask for advice about how to prepare for math competitions in general. But you should be aware that this question has been asked many many times. Before making a post, you are encouraged to look at the following:
[list]
[*] Stop looking for the right training: A generic post about advice that keeps getting stickied :)
[*] There is an enormous list of links on the Wiki of books / problems / etc for all levels.
[/list]
When you do post, we really encourage you to be as specific as possible in your question. Tell us about your background, what you've tried already, etc.

Actually, the absolute best way to get a helpful response is to take a few examples of problems that you tried to solve but couldn't, and explain what you tried on them / why you couldn't solve them. Here is a great example of a specific question.
-----------------------------
5. Publicity: use P2P forum instead
See https://artofproblemsolving.com/community/c5h2489297_peertopeer_programs_forum.
Some exceptions have been allowed in the past, but these require approval from administrators. (I am not totally sure what the criteria is. I am not an administrator.)
-----------------------------
6. Mock contests: use Mock Contests forum instead
Mock contests should be posted in the dedicated forum instead:
https://artofproblemsolving.com/community/c594864_aops_mock_contests
-----------------------------
7. AMC procedural questions: suggest to contact the AMC HQ instead
If you have a question like "how do I submit a change of venue form for the AIME" or "why is my name not on the qualifiers list even though I have a 300 index", you would be better off calling or emailing the AMC program to ask, they are the ones who can help you :)
-----------------------------
8. Discussion of random math problems: suggest to use MSM/HSM/HSO instead
If you are discussing a specific math problem that isn't from the AMC/AIME/USAMO, it's better to post these in Middle School Math, High School Math, High School Olympiads instead.
-----------------------------
9. Politics: suggest to use Round Table instead
There are important conversations to be had about things like gender diversity in math contests, etc., for sure. However, from experience we think that C&P is historically not a good place to have these conversations, as they go off the rails very quickly. We encourage you to use the Round Table instead, where it is much more clear that all posts need to be serious.
-----------------------------
10. MAA complaints: discouraged
We don't want to pretend that the MAA is perfect or that we agree with everything they do. However, we chose to discourage this sort of behavior because in practice most of the comments we see are not useful and some are frankly offensive.
[list] [*] If you just want to blow off steam, do it on your blog instead.
[*] When you have criticism, it should be reasoned, well-thought and constructive. What we mean by this is, for example, when the AOIME was announced, there was great outrage about potential cheating. Well, do you really think that this is something the organizers didn't think about too? Simply posting that "people will cheat and steal my USAMOO qualification, the MAA are idiots!" is not helpful as it is not bringing any new information to the table.
[*] Even if you do have reasoned, well-thought, constructive criticism, we think it is actually better to email it the MAA instead, rather than post it here. Experience shows that even polite, well-meaning suggestions posted in C&P are often derailed by less mature users who insist on complaining about everything.
[/list]
-----------------------------
11. Memes and joke posts: discouraged
It's fine to make jokes or lighthearted posts every so often. But it should be done with discretion. Ideally, jokes should be done within a longer post that has other content. For example, in my response to one user's question about olympiad combinatorics, I used a silly picture of Sogiita Gunha, but it was done within a context of a much longer post where it was meant to actually make a point.

On the other hand, there are many threads which consist largely of posts whose only content is an attached meme with the word "MAA" in it. When done in excess like this, the jokes reflect poorly on the community, so we explicitly discourage them.
-----------------------------
12. Questions that no one can answer: discouraged
Examples of this: "will MIT ask for AOIME scores?", "what will the AIME 2021 cutoffs be (asked in 2020)", etc. Basically, if you ask a question on this forum, it's better if the question is something that a user can plausibly answer :)
-----------------------------
13. Blind speculation: discouraged
Along these lines, if you do see a question that you don't have an answer to, we discourage "blindly guessing" as it leads to spreading of baseless rumors. For example, if you see some user posting "why are there fewer qualifiers than usual this year?", you should not reply "the MAA must have been worried about online cheating so they took fewer people!!". Was sich überhaupt sagen lässt, lässt sich klar sagen; und wovon man nicht reden kann, darüber muss man schweigen.
-----------------------------
14. Discussion of cheating: strongly discouraged
If you have evidence or reasonable suspicion of cheating, please report this to your Competition Manager or to the AMC HQ; these forums cannot help you.
Otherwise, please avoid public discussion of cheating. That is: no discussion of methods of cheating, no speculation about how cheating affects cutoffs, and so on --- it is not helpful to anyone, and it creates a sour atmosphere. A longer explanation is given in Seriously, please stop discussing how to cheat.
-----------------------------
15. Cutoff jokes: never allowed
Whenever the cutoffs for any major contest are released, it is very obvious when they are official. In the past, this has been achieved by the numbers being posted on the official AMC website (here) or through a post from the AMCDirector account.

You must never post fake cutoffs, even as a joke. You should also refrain from posting cutoffs that you've heard of via email, etc., because it is better to wait for the obvious official announcement. A longer explanation is given in A Treatise on Cutoff Trolling.
-----------------------------
16. Meanness: never allowed
Being mean is worse than being immature and unproductive. If another user does something which you think is inappropriate, use the Report button to bring the post to moderator attention, or if you really must reply, do so in a way that is tactful and constructive rather than inflammatory.
-----------------------------

Finally, we remind you all to sit back and enjoy the problems. :D

-----------------------------
(EDIT 2024-09-13: AoPS has asked to me to add the following item.)

Advertising paid program or service: never allowed

Per the AoPS Terms of Service (rule 5h), general advertisements are not allowed.

While we do allow advertisements of official contests (at the MAA and MATHCOUNTS level) and those run by college students with at least one successful year, any and all advertisements of a paid service or program is not allowed and will be deleted.
0 replies
v_Enhance
Jun 12, 2020
0 replies
k i Stop looking for the "right" training
v_Enhance   50
N Oct 16, 2017 by blawho12
Source: Contest advice
EDIT 2019-02-01: https://blog.evanchen.cc/2019/01/31/math-contest-platitudes-v3/ is the updated version of this.

EDIT 2021-06-09: see also https://web.evanchen.cc/faq-contest.html.

Original 2013 post
50 replies
v_Enhance
Feb 15, 2013
blawho12
Oct 16, 2017
|a^2-b^2-2abc|<2c implies abc EVEN!
tom-nowy   1
N 10 minutes ago by Tkn
Source: Own
Prove that if integers $a, b$ and $c$ satisfy $\left| a^2-b^2-2abc \right| <2c $, then $abc$ is an even number.
1 reply
+1 w
tom-nowy
May 3, 2025
Tkn
10 minutes ago
Tricky inequality
Orestis_Lignos   28
N 24 minutes ago by MR.1
Source: JBMO 2023 Problem 2
Prove that for all non-negative real numbers $x,y,z$, not all equal to $0$, the following inequality holds

$\displaystyle \dfrac{2x^2-x+y+z}{x+y^2+z^2}+\dfrac{2y^2+x-y+z}{x^2+y+z^2}+\dfrac{2z^2+x+y-z}{x^2+y^2+z}\geq 3.$

Determine all the triples $(x,y,z)$ for which the equality holds.

Milan Mitreski, Serbia
28 replies
Orestis_Lignos
Jun 26, 2023
MR.1
24 minutes ago
JBMO Shortlist 2023 A1
Orestis_Lignos   5
N 32 minutes ago by MR.1
Source: JBMO Shortlist 2023, A1
Prove that for all positive real numbers $a,b,c,d$,

$$\frac{2}{(a+b)(c+d)+(b+c)(a+d)} \leq \frac{1}{(a+c)(b+d)+4ac}+\frac{1}{(a+c)(b+d)+4bd}$$
and determine when equality occurs.
5 replies
Orestis_Lignos
Jun 28, 2024
MR.1
32 minutes ago
square root problem
kjhgyuio   6
N 34 minutes ago by kjhgyuio
........
6 replies
kjhgyuio
May 3, 2025
kjhgyuio
34 minutes ago
9 ARML Location
deduck   38
N Today at 3:45 AM by shawnzeng
UNR -> Nevada
St Anselm -> New Hampshire
PSU -> Pennsylvania
WCU -> North Carolina


Put your USERNAME in the list ONLY IF YOU WANT TO!!!! !!!!!

I'm going to UNR if anyone wants to meetup!!! :D

Current List:
Iowa
UNR
PSU
St Anselm
WCU
38 replies
deduck
May 6, 2025
shawnzeng
Today at 3:45 AM
USAMO Medals
YauYauFilter   54
N Today at 3:26 AM by ohiorizzler1434
YauYauFilter
Apr 24, 2025
ohiorizzler1434
Today at 3:26 AM
Will I fail again
hashbrown2009   16
N Today at 3:24 AM by ohiorizzler1434
so this year I got 34 on JMO 772 774 and got docked 1 point from top honors + mop

I just got info that I pretty much cannot do math for the rest of summer due to family reasons, and the only time I have is winter break

do you guys think it's enough time to practice/grind to qualify mop through USAMO, or should I tell my parents to reschedule the stuff because I really want to make mop

(Note: I'm aiming for like 25+ on USAMO so at least silver but I'm not sure that's realistic given the circumstances i'm in)
16 replies
hashbrown2009
Yesterday at 1:54 PM
ohiorizzler1434
Today at 3:24 AM
Wizard101
El_Ectric   65
N Today at 3:13 AM by HamstPan38825
Source: USAMO 2016, Problem 6
Integers $n$ and $k$ are given, with $n\ge k\ge2$. You play the following game against an evil wizard.

The wizard has $2n$ cards; for each $i=1,\ldots,n$, there are two cards labeled $i$. Initially, the wizard places all cards face down in a row, in unknown order.

You may repeatedly make moves of the following form: you point to any $k$ of the cards. The wizard then turns those cards face up. If any two of the cards match, the game is over and you win. Otherwise, you must look away, while the wizard arbitrarily permutes the $k$ chosen cards and then turns them back face-down. Then, it is your turn again.

We say this game is winnable if there exist some positive integer $m$ and some strategy that is guaranteed to win in at most $m$ moves, no matter how the wizard responds.

For which values of $n$ and $k$ is the game winnable?
65 replies
El_Ectric
Apr 20, 2016
HamstPan38825
Today at 3:13 AM
SUMaC Residential vs. Ross
AwesomeDude10   9
N Today at 2:43 AM by Rong0625
Hi! I got into the SUMaC residential i program, and I also recently got off the Ross waitlist. I was wondering if anyone had any insight on which program is
1) More useful in furthering my mathematical knowledge (which has a better curriculum)
2) Since I'm a junior, which is more useful for college apps? (I know this is a little cringe)
Thanks!
9 replies
AwesomeDude10
May 6, 2025
Rong0625
Today at 2:43 AM
HCSSiM results
SurvivingInEnglish   63
N Yesterday at 11:52 PM by KevinChen_Yay
Anyone already got results for HCSSiM? Are there any point in sending additional work if I applied on March 19?
63 replies
SurvivingInEnglish
Apr 5, 2024
KevinChen_Yay
Yesterday at 11:52 PM
Sad Algebra
tastymath75025   46
N Yesterday at 11:40 PM by Ilikeminecraft
Source: 2019 USAMO 6, by Titu Andreescu and Gabriel Dospinescu
Find all polynomials $P$ with real coefficients such that $$\frac{P(x)}{yz}+\frac{P(y)}{zx}+\frac{P(z)}{xy}=P(x-y)+P(y-z)+P(z-x)$$holds for all nonzero real numbers $x,y,z$ satisfying $2xyz=x+y+z$.

Proposed by Titu Andreescu and Gabriel Dospinescu
46 replies
tastymath75025
Apr 18, 2019
Ilikeminecraft
Yesterday at 11:40 PM
Aime ll 2022 problem 5
Rook567   1
N Yesterday at 9:39 PM by clarkculus
I don’t understand the solution. I got 220 as answer. Why does it insist, for example two primes must add to the third, when you can take 2,19,19 or 2,7,11 which for drawing purposes is equivalent to 1,1,2 and 2,7,9?
1 reply
Rook567
Yesterday at 9:08 PM
clarkculus
Yesterday at 9:39 PM
MathILy 2025 Decisions Thread
mysterynotfound   41
N Yesterday at 9:11 PM by cappucher
Discuss your decisions here!
also share any relevant details about your decisions if you want
41 replies
mysterynotfound
Apr 21, 2025
cappucher
Yesterday at 9:11 PM
The answer of 2022 AIME II #5 is incorrect
minz32   5
N Yesterday at 8:14 PM by Rook567
Source: 2022 AIME II problem 5
The answer posted on the AOPS page for the 2022 AIME II problem 5 has some flaw in it and the final answer is incorrect.

The answer is trying to use the symmetric property for the a, b, c. However the numbers are not exactly cyclically symmetric in the problem.

For example, the solution works well with a = 20, it derives 4 different pairs of b and c for p2 is in (3, 5, 11, 17) as stated. However, for a = 19, only 3 p2 in the set works, since if the p2 = 17, we will have c = 0, which is not a possible vertex label. So only three pairs of b and c work for a= 19, which are (19, 17, 14), (19, 17, 12), (19, 17, 6).

Same for a = 18.

However, for a = 17, one more possibility joined. c can be bigger than a. So the total triple satisfying the problem is back to 4.

There are two more cases that the total number of working pairs of b, c is 3, when a = 5, and a = 4.

So the final answer for this problem is not 072. It should be 068.



5 replies
minz32
Nov 20, 2022
Rook567
Yesterday at 8:14 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
8861 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
623 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