Summer is a great time to explore cool problems to keep your skills sharp!  Schedule a class today!

G
Topic
First Poster
Last Poster
k a June Highlights and 2025 AoPS Online Class Information
jlacosta   0
Jun 2, 2025
Congratulations to all the mathletes who competed at National MATHCOUNTS! If you missed the exciting Countdown Round, you can watch the video at this link. Are you interested in training for MATHCOUNTS or AMC 10 contests? How would you like to train for these math competitions in half the time? We have accelerated sections which meet twice per week instead of once starting on July 8th (7:30pm ET). These sections fill quickly so enroll today!

[list][*]MATHCOUNTS/AMC 8 Basics
[*]MATHCOUNTS/AMC 8 Advanced
[*]AMC 10 Problem Series[/list]
For those interested in Olympiad level training in math, computer science, physics, and chemistry, be sure to enroll in our WOOT courses before August 19th to take advantage of early bird pricing!

Summer camps are starting this 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 a transformative 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][*]June 5th, Thursday, 7:30pm ET: Open Discussion with Ben Kornell and Andrew Sutherland, Art of Problem Solving's incoming CEO Ben Kornell and CPO Andrew Sutherland host an Ask Me Anything-style chat. Come ask your questions and get to know our incoming CEO & CPO!
[*]June 9th, Monday, 7:30pm ET, Game Jam: Operation Shuffle!, Come join us to play our second round of Operation Shuffle! If you enjoy number sense, logic, and a healthy dose of luck, this is the game for you. No specific math background is required; all are welcome.[/list]
Our full course list for upcoming classes is below:
All classes run 7:30pm-8:45pm ET/4:30pm - 5:45pm PT unless otherwise noted.

Introductory: Grades 5-10

Prealgebra 1 Self-Paced

Prealgebra 1
Sunday, Jun 15 - Oct 12
Monday, Jun 30 - Oct 20
Wednesday, Jul 16 - Oct 29
Sunday, Aug 17 - Dec 14
Tuesday, Aug 26 - Dec 16
Friday, Sep 5 - Jan 16
Monday, Sep 8 - Jan 12
Tuesday, Sep 16 - Jan 20 (4:30 - 5:45 pm ET/1:30 - 2:45 pm PT)
Sunday, Sep 21 - Jan 25
Thursday, Sep 25 - Jan 29
Wednesday, Oct 22 - Feb 25
Tuesday, Nov 4 - Mar 10
Friday, Dec 12 - Apr 10

Prealgebra 2 Self-Paced

Prealgebra 2
Monday, Jun 2 - Sep 22
Sunday, Jun 29 - Oct 26
Friday, Jul 25 - Nov 21
Sunday, Aug 17 - Dec 14
Tuesday, Sep 9 - Jan 13
Thursday, Sep 25 - Jan 29
Sunday, Oct 19 - Feb 22
Monday, Oct 27 - Mar 2
Wednesday, Nov 12 - Mar 18

Introduction to Algebra A Self-Paced

Introduction to Algebra A
Sunday, Jun 15 - Oct 12
Thursday, Jun 26 - Oct 9
Tuesday, Jul 15 - Oct 28
Sunday, Aug 17 - Dec 14
Wednesday, Aug 27 - Dec 17
Friday, Sep 5 - Jan 16
Thursday, Sep 11 - Jan 15
Sunday, Sep 28 - Feb 1
Monday, Oct 6 - Feb 9
Tuesday, Oct 21 - Feb 24
Sunday, Nov 9 - Mar 15
Friday, Dec 5 - Apr 3

Introduction to Counting & Probability Self-Paced

Introduction to Counting & Probability
Sunday, Jun 1 - Aug 24
Thursday, Jun 12 - Aug 28
Wednesday, Jul 2 - Sep 17
Sunday, Jul 27 - Oct 19
Monday, Aug 11 - Nov 3
Wednesday, Sep 3 - Nov 19
Sunday, Sep 21 - Dec 14 (1:00 - 2:30 pm ET/10:00 - 11:30 am PT)
Friday, Oct 3 - Jan 16
Tuesday, Nov 4 - Feb 10
Sunday, Dec 7 - Mar 8

Introduction to Number Theory
Monday, Jun 9 - Aug 25
Sunday, Jun 15 - Sep 14
Tuesday, Jul 15 - Sep 30
Wednesday, Aug 13 - Oct 29
Friday, Sep 12 - Dec 12
Sunday, Oct 26 - Feb 1
Monday, Dec 1 - Mar 2

Introduction to Algebra B Self-Paced

Introduction to Algebra B
Wednesday, Jun 4 - Sep 17
Sunday, Jun 22 - Oct 19
Friday, Jul 18 - Nov 14
Thursday, Aug 7 - Nov 20
Monday, Aug 18 - Dec 15
Sunday, Sep 7 - Jan 11
Thursday, Sep 11 - Jan 15
Wednesday, Sep 24 - Jan 28
Sunday, Oct 26 - Mar 1
Tuesday, Nov 4 - Mar 10
Monday, Dec 1 - Mar 30

Introduction to Geometry
Monday, Jun 16 - Dec 8
Friday, Jun 20 - Jan 9
Sunday, Jun 29 - Jan 11
Monday, Jul 14 - Jan 19
Wednesday, Aug 13 - Feb 11
Tuesday, Aug 26 - Feb 24
Sunday, Sep 7 - Mar 8
Thursday, Sep 11 - Mar 12
Wednesday, Sep 24 - Mar 25
Sunday, Oct 26 - Apr 26
Monday, Nov 3 - May 4
Friday, Dec 5 - May 29

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
Friday, Aug 8 - Feb 20
Tuesday, Aug 26 - Feb 24
Sunday, Sep 28 - Mar 29
Wednesday, Oct 8 - Mar 8
Sunday, Nov 16 - May 17
Thursday, Dec 11 - Jun 4

Intermediate Counting & Probability
Sunday, Jun 22 - Nov 2
Sunday, Sep 28 - Feb 15
Tuesday, Nov 4 - Mar 24

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

Precalculus
Sunday, Jun 1 - Nov 9
Monday, Jun 30 - Dec 8
Wednesday, Aug 6 - Jan 21
Tuesday, Sep 9 - Feb 24
Sunday, Sep 21 - Mar 8
Monday, Oct 20 - Apr 6
Sunday, Dec 14 - May 31

Advanced: Grades 9-12

Olympiad Geometry
Tuesday, Jun 10 - Aug 26

Calculus
Wednesday, Jun 25 - Dec 17
Sunday, Sep 7 - Mar 15
Wednesday, Sep 24 - Apr 1
Friday, Nov 14 - May 22

Group Theory
Thursday, Jun 12 - Sep 11

Contest Preparation: Grades 6-12

MATHCOUNTS/AMC 8 Basics
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!)
Sunday, Aug 17 - Nov 9
Wednesday, Sep 3 - Nov 19
Tuesday, Sep 16 - Dec 9
Sunday, Sep 21 - Dec 14 (1:00 - 2:30 pm ET/10:00 - 11:30 am PT)
Monday, Oct 6 - Jan 12
Thursday, Oct 16 - Jan 22
Tues, Thurs & Sun, Dec 9 - Jan 18 (meets three times a week!)

MATHCOUNTS/AMC 8 Advanced
Wednesday, Jun 11 - Aug 27
Sunday, Jun 22 - Sep 21
Tues & Thurs, Jul 8 - Aug 14 (meets twice a week!)
Sunday, Aug 17 - Nov 9
Tuesday, Aug 26 - Nov 11
Thursday, Sep 4 - Nov 20
Friday, Sep 12 - Dec 12
Monday, Sep 15 - Dec 8
Sunday, Oct 5 - Jan 11
Tues, Thurs & Sun, Dec 2 - Jan 11 (meets three times a week!)
Mon, Wed & Fri, Dec 8 - Jan 16 (meets three times a week!)

AMC 10 Problem Series
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!)
Sunday, Aug 10 - Nov 2
Thursday, Aug 14 - Oct 30
Tuesday, Aug 19 - Nov 4
Mon & Wed, Sep 15 - Oct 22 (meets twice a week!)
Mon, Wed & Fri, Oct 6 - Nov 3 (meets three times a week!)
Tue, Thurs & Sun, Oct 7 - Nov 2 (meets three times a week!)

AMC 10 Final Fives
Monday, Jun 30 - Jul 21
Friday, Aug 15 - Sep 12
Sunday, Sep 7 - Sep 28
Tuesday, Sep 9 - Sep 30
Monday, Sep 22 - Oct 13
Sunday, Sep 28 - Oct 19 (1:00 - 2:30 pm ET/10:00 - 11:30 am PT)
Wednesday, Oct 8 - Oct 29
Thursday, Oct 9 - Oct 30

AMC 12 Problem Series
Thursday, Jun 12 - Aug 28
Sunday, Jun 22 - Sep 21
Wednesday, Aug 6 - Oct 22
Sunday, Aug 10 - Nov 2
Monday, Aug 18 - Nov 10
Mon & Wed, Sep 15 - Oct 22 (meets twice a week!)
Tues, Thurs & Sun, Oct 7 - Nov 2 (meets three times a week!)

AMC 12 Final Fives
Thursday, Sep 4 - Sep 25
Sunday, Sep 28 - Oct 19
Tuesday, Oct 7 - Oct 28

AIME Problem Series A
Thursday, Oct 23 - Jan 29

AIME Problem Series B
Sunday, Jun 22 - Sep 21
Tuesday, Sep 2 - Nov 18

F=ma Problem Series
Wednesday, Jun 11 - Aug 27
Tuesday, Sep 16 - Dec 9
Friday, Oct 17 - Jan 30

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
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
Thursday, Aug 14 - Oct 30
Sunday, Sep 7 - Nov 23
Tuesday, Dec 2 - Mar 3

Intermediate Programming with Python
Sunday, Jun 1 - Aug 24
Monday, Jun 30 - Sep 22
Friday, Oct 3 - Jan 16

USACO Bronze Problem Series
Sunday, Jun 22 - Sep 1
Wednesday, Sep 3 - Dec 3
Thursday, Oct 30 - Feb 5
Tuesday, Dec 2 - Mar 3

Physics

Introduction to Physics
Sunday, Jun 15 - Sep 14
Monday, Jun 23 - Sep 15
Tuesday, Sep 2 - Nov 18
Sunday, Oct 5 - Jan 11
Wednesday, Dec 10 - Mar 11

Physics 1: Mechanics
Monday, Jun 23 - Dec 15
Sunday, Sep 21 - Mar 22
Sunday, Oct 26 - Apr 26

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

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


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


More specifically:

For new threads:


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

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


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

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


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


For answers to already existing threads:


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

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



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


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

The above rules will be applied from next monday (5. march of 2007).
Feel free to discuss on this here.
49 replies
ZetaX
Feb 27, 2007
NoDealsHere
May 4, 2019
Serbian selection contest for the IMO 2025 - P1
OgnjenTesic   4
N 10 minutes ago by Mathgloggers
Source: Serbian selection contest for the IMO 2025
Let \( p \geq 7 \) be a prime number and \( m \in \mathbb{N} \). Prove that
\[\left| p^m - (p - 2)! \right| > p^2.\]Proposed by Miloš Milićev
4 replies
OgnjenTesic
May 22, 2025
Mathgloggers
10 minutes ago
Complex number
soruz   1
N 15 minutes ago by Mathzeus1024
$i)$ Determine $z \in \mathbb{C} $ such that $2|z| \ge |z^n-3|, \forall n \in  \mathbb N^*.$
$ii)$ Determine $z \in \mathbb{C} $ such that $2|z| \ge |z^n+3|, \forall n \in  \mathbb N^*.$
1 reply
soruz
Nov 28, 2024
Mathzeus1024
15 minutes ago
k colorings and triangles
Rijul saini   2
N 28 minutes ago by kotmhn
Source: LMAO Revenge 2025 Day 1 Problem 3
In the city of Timbuktu, there is an orphanage. It shelters children from the new mysterious disease that causes children to explode. There are m children in the orphanage. To try to cure this disease, a mad scientist named Myla has come up with an innovative cure. She ties every child to every other child using medicinal ropes. Every child is connected to every other child using one of $k$ different ropes. She then performs a experiment that causes $3$ children, each connected to each other with the same type of rope, to be cured. Two experiments are said to be of the same type, if each of the ropes connecting the children has the same medicine imbued in it. She then unties them and lets them go back home.

We let $f(n, k)$ be the minimum m such that Myla can perform at least $n$ experiments of the same type. Prove that:

$i.$ For every $k \in \mathbb N$ there exists a $N_k \in N$ and $a_k, b_k \in \mathbb Z$ such that for all $n > N_k$, \[f(n, k) = a_kn + b_k.\]
$ii.$ Find the value of $a_k$ for every $k \in \mathbb N$.
2 replies
Rijul saini
Wednesday at 7:11 PM
kotmhn
28 minutes ago
IMO ShortList 2008, Number Theory problem 1
April   65
N 33 minutes ago by Siddharthmaybe
Source: IMO ShortList 2008, Number Theory problem 1
Let $n$ be a positive integer and let $p$ be a prime number. Prove that if $a$, $b$, $c$ are integers (not necessarily positive) satisfying the equations \[ a^n + pb = b^n + pc = c^n + pa\] then $a = b = c$.

Proposed by Angelo Di Pasquale, Australia
65 replies
April
Jul 9, 2009
Siddharthmaybe
33 minutes ago
Aloo and Batata play game on N-gon
guptaamitu1   0
40 minutes ago
Source: LMAO revenge 2025 P6
Aloo and Batata are playing a game. They are given a regular $n$-gon, where $n > 2$ is an even integer. At the start, a line joining two vertices is chosen arbitrarily and one of its endpoints is chosen as its pivot. Now, Aloo rotates the line around the pivot either clockwise or anti-clockwise until it passes through another vertex of the $n$-gon. Then, the new vertex becomes the pivot and Batata again chooses to rotate the line clockwise or anti-clockwise
about the pivot. The player who moves the line into a position it has already been in (i.e. it passes through the same two vertices of the $n$-gon it was in at a previous time) loses.
Find all $n$ such that Batata always has a winning strategy irrespective of the starting edge.

Proposed by Anik Sardar, Om Patil and Anudip Giri
0 replies
guptaamitu1
40 minutes ago
0 replies
Trig Inequality back in Olympiads!
guptaamitu1   0
an hour ago
Source: LMAO revenge 2025 P5
Let $x,y,z \in \mathbb R$ be such that $x + y + z = \frac{\pi}{2}$ and $0 < x,y,z \le \frac{\pi}{4}$. Prove that:
$$  \left( \frac{\sin x - \sin y}{\cos z} \right)^2  \le 1 - 8 \sin x \sin y \sin z $$
Proposed by Shreyas Deshpande
0 replies
guptaamitu1
an hour ago
0 replies
Reflection of (BHC) in AH
guptaamitu1   0
an hour ago
Source: LMAO revenge 2025 P4
Let $ABC$ be a triangle with orthocentre $H$. Let $D,E,F$ be the foot of altitudes of $A,B,C$ onto the opposite sides, respectively. Consider $\omega$, the reflection of $\odot(BHC)$ about line $AH$. Let line $EF$ cut $\omega$ at distinct points $X,Y$, and let $H'$ be the orthocenter of $\triangle AYD$. Prove that points $A,H',X,D$ are concyclic.

Proposed by Mandar Kasulkar
0 replies
guptaamitu1
an hour ago
0 replies
King's Constrained Walk
Hellowings   2
N an hour ago by Hellowings
Source: Own
Given an n x n chessboard, with a king starting at any square, the king's task is to visit each square in the board exactly once (essentially an open path); this king moves how a king in chess would.
However, we are allowed to place k numbers on the board of any value such that for each number A we placed on the board, the king must be in the position of that number A on its Ath square in its journey, with the starting square as its 1st square.
Suppose after we placed k numbers, there is one and only one way to complete the king's task (this includes placing the king in a starting square), find the minimum value of k set by n.

Should've put one of its tag as "Open problem"; I have no idea how to tackle this problem either.
2 replies
Hellowings
May 30, 2025
Hellowings
an hour ago
Brilliant Problem
M11100111001Y1R   8
N an hour ago by The5
Source: Iran TST 2025 Test 3 Problem 3
Find all sequences \( (a_n) \) of natural numbers such that for every pair of natural numbers \( r \) and \( s \), the following inequality holds:
\[
\frac{1}{2} < \frac{\gcd(a_r, a_s)}{\gcd(r, s)} < 2
\]
8 replies
M11100111001Y1R
May 27, 2025
The5
an hour ago
Nut equation
giangtruong13   2
N an hour ago by Mathzeus1024
Source: Mie black fiends
Solve the quadratic equation: $$[4(\sqrt{(1+x)^3})^2-3\sqrt{1+x^2}](4x^3+3x)=2$$
2 replies
giangtruong13
Apr 1, 2025
Mathzeus1024
an hour ago
Euler line problem
m4thbl3nd3r   2
N an hour ago by m4thbl3nd3r
Let $O,H$ be the circumcenter and orthocenter of triangle $ABC$ and $E,F$ be intersections of $OH$ with $AB,AC$. Let $H',O'$ be orthocenter and circumcenter of triangle $AEF$. Prove that $O'H'\parallel BC.$
2 replies
m4thbl3nd3r
2 hours ago
m4thbl3nd3r
an hour ago
f(x)+f(1-x)=0
ChildFlower   2
N 2 hours ago by mashumaro
Find all functions $f:\mathbb (0;1] \to\mathbb R$ such that
$$f(x)+f(1-x)=0\; \forall x \in (0;1] $$
2 replies
ChildFlower
Today at 4:10 AM
mashumaro
2 hours ago
Determine the number $N$ of such distinct necklaces (up to rotation and reflecti
Arytva   0
2 hours ago
Let $n\ge 3$ be a positive integer. Consider necklaces of length n whose beads are colored in one of three colors, say red, green, or blue, with exactly two beads of each color (so $n=6$). A rotation of the necklace or a reflection (flipping) is considered the same necklace. But now impose the extra condition that no two beads of the same color are adjacent around the circle. Determine the number $N$ of such distinct necklaces (up to rotation and reflection).
0 replies
Arytva
2 hours ago
0 replies
Geometry
Arytva   0
2 hours ago
Source: Source?
Let two circles \(\omega_1\) and \(\omega_2\) meet at two distinct points \(X\) and \(Y\). Choose any line \(\ell\) through \(X\), and let \(\ell\) meet \(\omega_1\) again at \(A\) (other than \(X\)) and meet \(\omega_2\) again at \(B\). On \(\omega_1\), let \(M\) be the midpoint of the minor arc \(AY\) (i.e., the point on \(\omega_1\) such that \(\angle AMY\) subtends the arc \(AY\)), and on \(\omega_2\) let \(N\) be the midpoint of the minor arc \(BY\). Prove that
\[
MN \parallel \text{(radical axis of } \omega_1, \omega_2).
\]
0 replies
Arytva
2 hours ago
0 replies
A Sequence of +1's and -1's
ike.chen   36
N May 29, 2025 by maromex
Source: ISL 2022/C1
A $\pm 1$-sequence is a sequence of $2022$ numbers $a_1, \ldots, a_{2022},$ each equal to either $+1$ or $-1$. Determine the largest $C$ so that, for any $\pm 1$-sequence, there exists an integer $k$ and indices $1 \le t_1 < \ldots < t_k \le 2022$ so that $t_{i+1} - t_i \le 2$ for all $i$, and $$\left| \sum_{i = 1}^{k} a_{t_i} \right| \ge C.$$
36 replies
ike.chen
Jul 9, 2023
maromex
May 29, 2025
A Sequence of +1's and -1's
G H J
G H BBookmark kLocked kLocked NReply
Source: ISL 2022/C1
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
ike.chen
1162 posts
#1 • 1 Y
Y by NO_SQUARES
A $\pm 1$-sequence is a sequence of $2022$ numbers $a_1, \ldots, a_{2022},$ each equal to either $+1$ or $-1$. Determine the largest $C$ so that, for any $\pm 1$-sequence, there exists an integer $k$ and indices $1 \le t_1 < \ldots < t_k \le 2022$ so that $t_{i+1} - t_i \le 2$ for all $i$, and $$\left| \sum_{i = 1}^{k} a_{t_i} \right| \ge C.$$
This post has been edited 7 times. Last edited by ike.chen, Aug 6, 2023, 10:00 PM
Reason: Typo
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
Tintarn
9045 posts
#2 • 1 Y
Y by Funcshun840
Answer
Solution
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
CrazyInMath
460 posts
#3
Y by
The solution might be flawed but I would post it here
Solution?
edit: I wrote the solution with the statement @below
This post has been edited 1 time. Last edited by CrazyInMath, Jul 9, 2023, 6:09 AM
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
ike.chen
1162 posts
#4 • 2 Y
Y by GoodMorning, ehuseyinyigit
For context, this problem appeared during the US IMO Training Camp with the following flavor text:
MOP Test 4 wrote:
There are $2022$ buckets of water arranged in a row, each colored red or blue. Sally the salmon plays the following game:
    1. First, she chooses any bucket to start in and begins to jump.
    2. At each step, she may jump to the next bucket, or the one after that.
    3. She may stop jumping at any point, ending the game.
After the game ends, her score is the absolute value of the difference between the number of red buckets and the number of blue buckets she visited. Find the largest possible score Sally can achieve, regardless of the colors of the buckets.
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
VicKmath7
1391 posts
#5
Y by
Solution of C1
This post has been edited 3 times. Last edited by VicKmath7, Jul 9, 2023, 7:43 AM
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
cj13609517288
1930 posts
#7
Y by
The answer is $\boxed{506}$, achieved by $+--++--+...+--++-$. If you really want a proof for why this gives $506$ use dp or something.

To prove that $506$ is the lowest you can get, consider the following algorithm:
Start at the first $+$, then go through every $+$ and go through every other $-$ in a gap(so say if we have $++---+++$ we go through indices $1,2,4,6,7,8$).
The algorithm where you swap $+$ and $-$ is the other algorithm we will consider. In both cases, we go through at most half of each gap, so we can just consider what happens if we go through half of the other sign.
Let $x$ be the number of $+$s, so there are $2022-x$ $-$s. Then we must have
\[C\le \text{max}\left(x-\frac{2022-x}{2},2022-x-\frac{x}{2}\right) = \text{max}\left(\frac{3x-2022}{2},\frac{4044-3x}{2}\right).\]This is the maximum of two numbers that sum up to $1011$, so it must be at least $505.5$, so it must be at least $506$. $\blacksquare$
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
megarnie
5610 posts
#8 • 3 Y
Y by OronSH, Spectator, jerryzhang16
Solved with OronSH.

The answer is $\boxed{506}$. The construction is $1, -1, -1, 1, 1, -1, -1, 1, \ldots, 1, -1, -1, 1, 1, -1$, where $1, -1, -1, 1$ is repeated $505$ times and $1, -1$ is added to it. Notice the maximal sum we can get in each block of $1,-1,-1,1$ is $1$, and the maximal sum we can get in $1,-1$ is $1$, so we have a maximal value of $505\cdot 1 + 1 = 506$. Similarly, the minimal sum we can get in $-1,1,1,-1$ is $-1$, and the minimal sum we can get in $1,-1$ is $-1$, so we have a minimal value of $(-1) + -1 \cdot 505  = -506$, as desired.

Now we show that we can always create a subsequence as in the problem with absolute value at least $506$. WLOG that there are at least $1011$ ones.

Let $A$ be the number of ones and $B$ be the number of negative ones in total. The idea is to select every single $1$, and the every second element in each string of $-1$'s. This selection satisfies $t_{i+1} - t_i \le 2$. This gives us a total of at least $A - B/2 \ge 1011 - 1011/2 = 505.5$. Since it must be an integer, it is at least $506$.
This post has been edited 1 time. Last edited by megarnie, Jul 14, 2023, 5:27 PM
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
OgnjenTesic
47 posts
#9
Y by
WLOG, we can assume that we have an equal or greater number of $1$ than $-1$ (since we are considering the sum in terms of absolute value).

Let's consider the "blocks" of $-1$. Let's say that in the first "block" we have $n_1$ numbers $-1$, in the second "block" we have $n_2$, ..., and in the $k$-th block, we have $n_k$ numbers $-1$:
$$\dots \underbrace{-1,-1,-1,\dots,-1}_{n_1}, 1,1,1, \dots, 1, \underbrace{-1,-1,-1,\dots,-1}_{n_2},1,1,1, \dots,1, \underbrace{-1,-1,-1,\dots,-1}_{n_k}, \dots$$In a block of $x$ number $-1$, we have to take at least $\left \lfloor{\frac{x}{2}}\right \rfloor$ numbers. Therefore, sum of $-1$ is at most
$$\left \lfloor{\frac{n_1}{2}}\right \rfloor+\left \lfloor{\frac{n_2}{2}}\right \rfloor+\dots+\left \lfloor{\frac{n_k}{2}}\right \rfloor\leqslant \left \lfloor{\frac{n_1+n_2+\dots+n_k}{2}}\right \rfloor=\left \lfloor{\frac{1011}{2}}\right \rfloor=505\text{.}$$So for every $\pm 1$-sequence, we can achieve sum $1011-505=506$. ($1011$ because we have at least 1011 number $1$)

Construction for $506$: $\underbrace{1, -1, -1, 1}{}, \underbrace{1, -1, -1, 1}{}, \dots, \underbrace{1, -1, -1, 1}, 1, -1$.
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
bobthegod78
2982 posts
#10 • 1 Y
Y by centslordm
The answer is $506$, with equality achieved using 505 copies of $1,-1,-1,1$ and then a $1,-1$ at the end. To show this achieves it, consider each block of 4 (plus one block of 2), we can get at most one from each of these and it follows easily.

Let there be at most as many $-1$s as $1$s, then take as little $-1$'s as you can to take all the $+1$s. Let $c(1),c(-1)$ denote the number of 1s and -1s respectively. For each block of $x$ negatives, we need to take at least $\left\lfloor \frac x2 \right\rfloor$ of them. Then the problem follows since
\[
c(1) - \sum_{\text{block of } x} \left\lfloor \frac x2 \right\rfloor \geq 1011 - \left\lfloor \frac{1011}{2} \right\rfloor = 506,
\]as desired.
This post has been edited 2 times. Last edited by bobthegod78, Jul 14, 2023, 2:43 PM
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
#11 • 1 Y
Y by centslordm
Solution
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
peace09
5446 posts
#12 • 2 Y
Y by megarnie, pi271828
Solved with pi271828.

The answer is $506$. Let $S$ denote the sum in question; we seek the minimum of $\max(|S|)$ over all sequences $a_1,\dots,a_{2022}$.

Optimality. Consider the sequence $1,-1,-1,1,1,\dots,1,1,-1$, and specifically the middle $2020$ terms; by symmetry, we can maximize the raw value of $S$ (rather than minimizing it and so maximizing its absolute value). If only one of the two terms $a_{4n-1},a_{4n}=1$ are among the chosen $a_{t_1},\dots,a_{t_k}$, we can include the other of the two whilst preserving all conditions and incrementing $S$. Additionally, for any "block" $-1,-1,1,1$ adjacent to but not among the chosen terms, we can include the terms $-1,1,1$ whilst preserving conditions and incrementing $|S|$. Including $a_1=1$, we therefore have the "steady state"
\[S\le1-1+1+1-1+1+1-\dots-1+1+1=506,\]as claimed.

Sufficiency. For any sequence, let $r_1,\dots,r_m$ denote the lengths of contiguous blocks of consecutive $-1$'s, and define $b_1,\dots,b_n$ similarly. To maximize the magnitude of $S$ in the negative direction, we include all the $-1$'s from $r_1,\dots,r_m$, and "bridge" these disjoint blocks with every other $1$, of which there are $\textstyle\sum\lfloor\tfrac{b_i}{2}\rfloor$. Analogously, to maximize the magnitude of $S$ in the positive direction, we include all the $1$'s from $b_1,\dots,b_n$ and bridge with every other $-1$, of which there are $\textstyle\sum\lfloor\tfrac{r_i}{2}\rfloor$. Hence,
\[|S|_1=\sum_{i=1}^mr_i-\sum_{i=1}^n\left\lfloor\frac{b_i}{2}\right\rfloor\quad\text{and}\quad|S|_2=\sum_{i=1}^nb_i-\sum_{i=1}^m\left\lfloor\frac{r_i}{2}\right\rfloor\]are both attainable. Summing, we have
\[|S|_1+|S|_2=\left(\sum_{i=1}^mr_i+\sum_{i=1}^nb_i\right)-\left(\sum_{i=1}^n\left\lfloor\frac{b_i}{2}\right\rfloor+\sum_{i=1}^m\left\lfloor\frac{r_i}{2}\right\rfloor\right)\ge2022-1011=1011,\]whence one of $|S|_1,|S|_2$ are $\ge506$, as desired. $\square$
This post has been edited 1 time. Last edited by peace09, Jul 14, 2023, 6:51 PM
Reason: formatting
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
JAnatolGT_00
559 posts
#13
Y by
We claim the answer $C=506.$ By a straightforward check the exact bound is obtained for the sequence $$+1,-1,-1,+1,+1,-1,-1,\ldots ,+1,+1,-1.$$
Now let's prove that such a sum is attainable for an arbitrary sequence. Divide the sequence in ascending order of index by consecutive blocks of equal numbers, and let these blocks contain $x_1,y_1,x_2,y_2,\ldots ,x_n,y_n$ numbers respectively ($x_i$ belongs to the block of $+1;$ probably $x_1$ or $y_n$ equal to $0$). Multiplying each number by $-1$ doesn't change the condition, so WLOG $\sum_{i=1}^n y_i\leq 1011.$ As a strategy lets pick all $+1,$ and in each block of $-1$ pick all numbers with even positions in this block - the sum of picked elements is $\sum_{i=1}^n \left( x_i-\left\lfloor \frac{y_i}{2}\right\rfloor \right) \geq 2022-\sum_{i=1}^n y_i -\left\lfloor \sum_{i=1}^n \frac{y_i}{2}  \right\rfloor \geq 2022-1011-505=506.$
This post has been edited 2 times. Last edited by JAnatolGT_00, Jul 19, 2023, 4:32 PM
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
GreenTea2593
239 posts
#14 • 2 Y
Y by peace09, CANBANKAN
ike.chen wrote:
A $\pm 1$-sequence is a sequence of $2022$ numbers $a_1, \ldots, a_{2022},$ each equal to either $+1$ or $-1$. Determine the largest $C$ so that, for any $\pm 1$-sequence, there exists an integer $k$ and indices $1 \le t_1 < \ldots < t_k \le 2022$ so that $t_{i+1} - t_i \le 2$ for all $i$, and $$\left| \sum_{i+1}^{k} a_{t_i} \right| \ge C.$$

isn't it supposed to be $i=1$ instead of $i+1$ in the sigma notation?
\[\left| \sum_{i=1}^{k} a_{t_i} \right| \geqslant C.\]
Attachments:
This post has been edited 3 times. Last edited by GreenTea2593, Aug 3, 2023, 8:35 AM
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
awesomeming327.
1746 posts
#15
Y by
The answer is $506$ with construction is $+,-,-,+$ $505$ times and $+,-$ in addition. In each $+,-,-,+$ and $-,+,+,-$ we can get at most $1$ in absolute value so the construction works.

$~$
Now to show the bound, suppose WLOG there are at least $1011$ $+$. Select all the $+$, and every other $-$ then it's easy to show that we have at least $506$.
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
Inconsistent
1455 posts
#16
Y by
Answer $506$ from taking $-1, 1, 1, -1, -1, 1, 1, \ldots$. To prove notice that we can process each block of consecutive $+1$ or $-1$ so that if $x, y$ are the number of $+1, -1$ total then we have on a fixed sequence:

$\max \text{LHS} \geq \max(x - y/2, y - x/2) \geq \frac{x+y}{4} = 505 \frac{1}{2}$, so $\max \text{LHS} \geq 506$.

This constant is achieved by the construction via the same blocking logic so we are done.
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
asdf334
7585 posts
#18
Y by
Assume there are $a$ of the $+1$ and $b$ of the $-1$. Then $a+b=2022$.

Let's now try to find the worst possible configuration for a fixed $a$ and $b$.
  • To maximize $C$, realize that we are limited by the number of $-1$ we can remove. Turns out when all the $-1$ are consecutive this is the worst possible (there are equivalent configurations, but calculations will be the same.)
  • Analogously all the $1$s are consecutive.
From this logic we've proven both (1) guaranteed maximums and minimums and (2) provided the construction, say, $1,1,1,\dots,-1,-1,-1$.

Now realize that the maximum is $M=a-b+\left \lceil \frac{b}{2}\right \rceil$ and the minimum is $m=a-b-\left \lceil \frac{a}{2}\right \rceil$.
\[M+(-m)=\left \lceil \frac{a}{2}\right \rceil + \left \lceil \frac{b}{2}\right \rceil\]which is equal to $1011$ when $a$ is even. When $a$ is odd it's equal to $1012$. So we can always get at least $506$ difference.
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
jelena_ivanchic
151 posts
#19
Y by
Proof
This post has been edited 1 time. Last edited by jelena_ivanchic, Jan 13, 2024, 10:33 AM
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
Leo.Euler
577 posts
#20
Y by
The answer is $\boxed{506}$. Construction is to take $1, -1, -1, 1$ repeatedly $505$ times and append $1, -1$.

WLOG, suppose that there are at least $1011$ positive terms and at most $1011$ negative terms among the $a_i$. Break the sequence of $a_i$ into blocks of $1$s and $-1$s, so that the signs of the blocks alternate. If we let $x_1$, $x_2$, ... denote the sequence of negative block sizes, then the number of negative terms in the subsequence $a_{t_i}$ is at most \[ \sum \left\lfloor x_i/2 \right\rfloor \le \left\lfloor (x_1+x_2+\dots)/2 \right\rfloor \le 505, \]so adding in all of the positive terms yields that $C \le 506$ always.
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
SnowPanda
186 posts
#21
Y by
Solution
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
Shreyasharma
685 posts
#22
Y by
We will work the wording provided during the US IMO Training Camp.

We claim that the answer is $\boxed{506}$.

Upper Bound
Proof. Consider the arrangement,
\begin{align*}
\text{RBBRRBB \dots RRB}
\end{align*}Clearly it is optimal for Sally to begin on a ``block" of red buckets as if she begins on blue, she may just shift one ``block" back. Thus say she attempts to maximize $\text{Red} - \text{Blue}$. It is clear that in any block of four buckets, Sally can achieve a score of at most $+1$. As there are at most $506$ such sets, Sally can guarantee a score of at most $506$. $\square$

Lower Bound
Proof. To show that Sally can always guarantee a score of $506$ take a random sequence. Assume that there are at most $1011$ blue buckets and at least $1011$ red buckets. Then say that there are ``blocks" of red buckets $r_1$, $r_2$, \dots, $r_x$ and blocks of blue buckets $b_1$, $b_2$, \dots $b_{x-1}$. Then the problem becomes the following.
  • Pick an initial block $r_i$ to begin at, and a block $r_j$ to end at.
  • Define the function $S(i, j) = \sum_{m=i}^j r_m - \sum_{m=i}^{j-1} \left\lfloor \frac{b_m}{2} \right\rfloor$
  • Maximize $S(a, b)$.
Note that we may bound,
\begin{align*}
\sum_{m = i}^{j-1} \left\lfloor \frac{b_m}{2} \right\rfloor \leq \left\lfloor \frac{\sum_{m=1}^{x-1} b_m}{2} \right\rfloor \leq \left\lfloor \frac{1011}{2} \right\rfloor = 505
\end{align*}Then we guarantee at least,
\begin{align*}
S(1, x) \geq \sum_{m=1}^{x} r_m - 505 \geq 1011 - 505 = 506
\end{align*}and hence we are done. $\square$
This post has been edited 1 time. Last edited by Shreyasharma, Feb 7, 2024, 7:03 PM
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
mathboy100
675 posts
#23
Y by
The answer is $506$.

Define $f(S, C)$ for subsequence $S$ and $C \in {1, -1}$ to be the sum of the lengths of consecutive subsequences of $C$ in subsequence $S$ minus the sum of the floors of half of the length of each consecutive subsequence of $-C$ in subsequence $S$. It is obvious that the problem is asking for the minimum value of the maximum value of $C$ over every subsequence of every possible $\pm 1$ sequence.

Observe that if $x$ is the number of $1$s in a subsequence, and $y$ is the number of $-1$s in a subsequence, then $f(S, 1) \geq x - \frac{y}{2}$, and $f(S, -1) \geq y - \frac{x}{2}$. Adding the two, we obtain $f(S, 1) + f(S, -1) \geq \frac{x+y}{2}$, so one of the function values must be greater than or equal to $\frac{x+y}{4}$. In particular, if our subsequence is the entire sequence, we must have a function value greater than or equal to $506$.

Now, we claim that the sequence $1, -1, -1, 1, 1, -1, -1, \ldots -1$ satisfies the conditions. Observe that both $f(S, 1)$ and $f(S, -1)$ are equal to $506$ when $S$ is the full sequence. The rest of the proof that this sequence works is just casework, and I will omit it because I am lazy.
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
Mogmog8
1080 posts
#24 • 1 Y
Y by centslordm
We claim the answer is $506$, which can be achieved by $505$ repetitions of $1,1,-1,-1$ followed by $1,-1$. For the bound, WLOG there are $a\le 1011$ negative ones. Then, in each consecutive group of negative ones we can eliminate at least half of them so there are at most $\lfloor a/2\rfloor$ negative ones left. Hence, the sum is at least $2022-a-\lfloor a/2\rfloor\ge 506$, as desired. $\square$
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
sami1618
928 posts
#25
Y by
The answer is $\boxed{506}$.

Construction:
WLOG assume that there are at least $1011$ $a_i$ equal to $1$. Then over each gap of $a$ consecutive $a_i$ equal to $-1$ we can choose all but $\lfloor\frac{a}{2}\rfloor$ of them. So there exists a sequence with at least $1011$ positive $a_i$ and at most $505$ negative $a_i$.

Bound:
Consider the sequence $1,-1,-1,1,1,\dots,-1,-1,1,1,-1$. Each middle gap is 'unavoidable' leading to the desired bound.
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
Nuterrow
254 posts
#26
Y by
Proof: We claim that the answer is $506$. Note that if we have more $-1$'s than $+1$'s, we can flip the signs of all the numbers without affecting the problem. For the upper bound, we just consider the sequence,
$$+1 - 1 - 1 + 1 +1 -1 -1 \dots$$Now for the lower bound, suppose the number of $+1$'s in each block is $a_i$ from $a_1$ through $a_n$ and similarly the number of $-1$'s in each block is $b_i$ from $b_1$ through $b_m$. Our strategy will be to pick all the $+1$'s and pick as few $-1$'s as possible. For each block of $-1$ we will end up picking $\left \lfloor{\frac{b_i}{2}} \right \rfloor$ and thus,
$$C \geq \sum_{i=1}^n a_i - \left(\sum_{i=1}  \left \lfloor{\frac{b_i}{2}} \right \rfloor \right)$$$$C \geq \sum_{i=1}^n a_i - \left \lfloor {\frac{\sum_{i=1}^m b_i}{2}} \right \rfloor$$$$C \geq 1011 - 505 = 506$$
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
SomeonesPenguin
129 posts
#27
Y by
The answer is $506$.

For the construction take $$1,-1,-1,1,1,-1,-1,\dots,-1,-1,1,1,-1$$
Where the sequence $1,-1,-1,1$ is repeated $505$ times and at the end we add $1$ and $-1$.

Now we show that we can always achieve $506$. Suppose that $1$ appears $a$ times and $-1$ appears $b$ times.

Case 1. $a=b=1011$.

Suppose the last number is negative and suppose the first one is positive (if it is not positive than just deleting the first negative numbers from the sequence gives a weaker problem). So consider the sequence $a_{1},a_{2},\dots,a_{2021}$. Now choose $t_i$ by this algorithm: Pick $t_{1}=1$. After this, if we have chosen $t_1,t_2,\dots,t_k$ and $a_{t_k+1} = 1$ pick $t_{k+1}=t_k+1$ and if $a_{t_k+1}=-1$ pick $t_{k+1}=t_k+2$. Notice that by doing this, we pick all the $1$s and skip at least $505$ of the $-1$s so the overall sum is at least $506$.

Case 2. $a\neq b$.

Suppose that $a > b$. We have that $a \ge 1012 > 1010 \ge b$ so by repeating the same algorithm from the start (without forgetting about the last number) we can choose every positive number and skip at least $\left\lfloor\frac{b}{2}\right\rfloor$ negative numbers so the sum will be at least $a-\left\lceil\frac{b}{2}\right\rceil\ge 1012-505=507$.
This post has been edited 1 time. Last edited by SomeonesPenguin, Aug 14, 2024, 2:00 PM
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
laura0105_somali
16 posts
#28
Y by
2022 C1 Ex. Ex.
the extreme version found here
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
onyqz
195 posts
#29
Y by
posting for storage
solution
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
ezpotd
1328 posts
#30
Y by
I claim the answer is $506$.

Construction with $506$ as maximal: $xxyyxxyyxxyy \cdots xxyyxy$, where $x$ represents $1$ and $y$ represents $-1$. The largest possible positive sum is accomplished when all positive elements are in the sequence, and we are forced to take $505$ negative elements since there are $505$ blocks of $2$ negative elements, this gives a sum of $1011 - 505 = 506$.

Proof that we can always get $506$: Without loss of generality let there be at least as many positive elements as negative ones. Separate the sequence into blocks of positive and negative elements, we can take all the elements in positive blocks and we can ensure we take at most half of the elements in the negative blocks, so letting there be $x$ positive elements we can guarantee as a sum of at least $x - (\frac{2022 - x}{2}) = \frac 32 x - 1011$, since $x \ge 1011$ we have we can guarantee a sum at least $505.5$, since the sum is an integer we can guarantee $506$.
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
Bonime
38 posts
#31 • 1 Y
Y by H_Taken
Ps: For some reason, AOPS won't let me post the solution to this problem in English, so it will be in Portuguese.

Primeiro, observe que a resposta é $\boxed{506}$ e pode ser facilmente obtida pelo seguinte padrão: $$+--++--++--++...--++-$$
Agora, para provar o limite, vamos supor, SPG, que a quantidade de $a_i=+1$ é $\ge a_j=-1$

Seja $X_i$ o $i$-ésimo bloco composto de $x_i$ $a_j=+1$ e $Y_i$ o $i$-ésimo bloco composto de $y_i$ $a_j=-1$
Observe que para cada $\pm1$-sequência, podemos executar o seguinte algoritmo para obter $\sum_{i = 1}^{k} a_{t_i} \ge 506.$

Tome $(t_1, t_2, ..., t_{x_1})=X_1$ e $(t_{x_1+1}, t_{x_1+2}, ..., t_{x_1+\left \lfloor{\frac{y_1}{2}}\right \rfloor})$ alternadamente entre os termos de $Y_1$ começando com $t_{x_1+1}=a_{x_1+2}$. Mais especificamente, para cada $X_i$, tome todos os seus termos como elementos do conjunto ${a_{t_1}, a_{t_2}, ..., a_{t_k}}$ e, para cada $Y_i$, tome alternadamente seus valores como termos desse conjunto. Portanto, veja que isso pode ser feito já que a maior distância entre dois $t_i$s é $2$. Além disso, com este algoritmo, garantimos que: $$\sum_{i = 1}^{k} a_{t_i} \ge \sum_i x_i + \sum_i {\left \lfloor{\frac{y_i}{2}}\right \rfloor} \ge 1011-505=506$$Como queríamos mostrar.
This post has been edited 3 times. Last edited by Bonime, Oct 29, 2024, 1:46 AM
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
sansgankrsngupta
154 posts
#32
Y by
is $t_{k+1}= t_1$?
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
eibc
600 posts
#35
Y by
The answer is $C = 506$. For a construction, take the sequence $+1, +1, \ldots, +1, -1, \ldots, -1$, consisting of $1011$ terms of $+1$ followed by $1011$ terms of $-1$.

To prove bound holds, suppose WLOG there are more terms which are $+1$ than $-1$. Let $x$ be the number of terms which are $+1$. Now, suppose that whenever we come across a run of consecutive $-1$s, we only take the second term in the run to be one of the $a_{t_i}$, and then the fourth term, and so on. Then at most $\lfloor \tfrac{2022 - x}{2}\rfloor$ of the $a_{t_i}$ will be $-1$, so the sum of $a_{t_i}$ across all $1 \le i \le k$ is at least $x - \lfloor \tfrac{2022 - x}{2}\rfloor$. Since $x \ge 1011$ we have $\lfloor \tfrac{2022 - x}{2}\rfloor \le \tfrac{2022 - 1011}{2} = 505$, so $x - \lfloor \tfrac{2022 - x}{2}\rfloor \ge 1011 - 505 = 506.$
This post has been edited 1 time. Last edited by eibc, Dec 27, 2024, 10:33 PM
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
AshAuktober
1016 posts
#36
Y by
Warning: Super long writeup.
Answer
Solution:
This post has been edited 2 times. Last edited by AshAuktober, Jan 1, 2025, 8:33 AM
Reason: Hid stuff for cleanliness.
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
lelouchvigeo
183 posts
#37
Y by
sketch
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
EpicBird08
1758 posts
#38
Y by
The answer is $\boxed{C = 506}.$

Necessity: Consider the $\pm 1$-sequence $$1, 1, -1, -1, 1, 1, -1, -1, \dots, 1, 1, -1, -1, 1, 1, -1, -1, 1, -1.$$Here there are $505$ chunks of $1$s and $505$ chunks of $-1$s, for a total of $1011$ ones and $1011$ negative ones. Clearly we want to maximize the absolute difference between the number of $1$s we choose and the number of $-1$s we choose. If we want the number of $1$s we use to be greater than the number of $-1$s we use, we want to choose all the $1$s we can and choose as little $-1$s as we can. In each chunk of $-1$s, we must take at least one of the $-1$s as we cannot skip over any of them at once. Thus the absolute value of our absolute sum is bounded by $1011 - \frac{1010}{2} = 506.$ Similar work holds if we let the number of $-1$s we use to be greater than the number of $1$s we use. This gives $C \le 506.$

Sufficiency: Suppose without loss of generality that there are $a \ge 1011$ ones in our sequence, so that there are $2022-a$ negative ones. As before, we choose our sequence $t_i$ greedily. We choose all of the ones, and choose as little $-1$s as possible. while still navigating the entire sequence (so we don't stop in the middle somewhere). Suppose that the $-1$s come in contiguous runs of length $x_1, x_2, \dots, x_k,$ where $x_1 + \dots + x_k = 2022 - a.$ In a run of $m$ contiguous $-1$s, we can clearly only ignore at most $\left\lceil \frac{m}{2} \right\rceil$ of them, requiring us to choose $\left\lfloor \frac{m}{2} \right\rfloor$ of them. Therefore, when we choose the sequence which satisfies this, we get our sum is $$a - \sum_{i=1}^k \left\lfloor \frac{x_i}{2} \right\rfloor \ge a - \sum_{i=1}^k \frac{x_i}{2} = a - \frac{2022-a}{2} = \frac{3a-2022}{2} \ge \frac{3 \cdot 1011 - 2022}{2} \ge 505.5.$$Since the sum is an integer, it is at least $506,$ showing sufficiency.

Therefore, the best we can do is $C = 506,$ as claimed.

Remark: Once you get the idea of "jumping over" the $-1$s, both the equality case and the bound come naturally.
This post has been edited 2 times. Last edited by EpicBird08, Mar 3, 2025, 1:27 AM
Reason: messed up construction slightly
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
fearsum_fyz
56 posts
#39
Y by
We claim that the answer is $\boxed{506}$.

Proof of attainability: Assume, without loss of generality, that there are at least as many $+1$s in the sequence as there are $-1$s. There must be at least $1011$ $+1$s and at most $1011$ $-1$s.
Divide the sequence into maximal contiguous blocks of $+1$s and $-1$s:
$$\underbrace{+1, +1, \dots, +1,}_{a_1 \text{ times}} \underbrace{-1, -1, \dots, -1,}_{a_2 \text{ times}} \underbrace{+1, +1, \dots, +1,}_{a_3 \text{ times}} \underbrace{-1, -1, \dots, - 1}_{a_4 \text{ times}} \dots$$Consider all the $+1$s, and the $-1$s that are at even numbered positions within their block (of which there may be at most $\lfloor \frac{1011}{2} \rfloor = 505$). Clearly, no two elements of this subsequence are further than two places apart, and the sum is at least $1011 - 505 = 506$ as desired.

Proof of bound: Consider the following sequence:
$$+, -, -, +, +, -, -, +, + \dots, -, -, +, +, -$$It is easy to check that the maximum possible sum in this case is 506.

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.
anudeep
202 posts
#40
Y by
We claim that the optimal value of $C$ is $506$.
Constructing a sequence that gives an upper bound of $506$ on $C$ is very natural. Consider the sequence,
$$\textcolor{blue}{1},\textcolor{blue}{1}, \textcolor{red}{-1}, \textcolor{red}{-1}, \textcolor{blue}{1},\textcolor{blue}{1}, \textcolor{red}{-1}, \textcolor{red}{-1},\ldots, \textcolor{blue}{1},\textcolor{blue}{1}, \textcolor{red}{-1}, \textcolor{red}{-1},\textcolor{blue}{1}, \textcolor{red}{-1}.$$There are $505$ copies of $1,1,-1, -1$ chunks with an anomaly at the end. Say we want to maximise the number of $1$s in the list, then we must have at least $507$ more $1$s than $-1$s and this is impossible as appending a $1$ in our list comes at the cost of appending a $-1$ unless we are yet to start.

Establishing The Lower bound on C. We will show that no matter what $a_1,a_2,\ldots, a_{2022}$ are, we can always achieve
$$\left|\sum_{1\le i\le k}a_{t_i}\right|\ge 506 \qquad\text{with $t_{i+1}-t_i\le 2$,}$$for some $k$. Say there are at least $1011$ ones in the sequence and we want to include all of it in the list i.e, $a_{t_1}, a_{t_2}, \ldots, a_{t_k}.$ We do so according to the following algorithm,
  • Begin from the smallest index that contains a $1$ and append it to the list.
  • If the next nearest $1$ is at most two steps away, jump to that index and append it to the list.
  • And if you don't find a $1$, then always jump to the right by two steps until you find a $1$ and of course appending the number you jumped on each time. Eventually if you encounter a $1$ which is at most two steps away, follow the above procedure.
Aha! following these steps, the worst case is you would have collected at most $505$ (a jump of length $2$ is essentially avoiding a $-1$) number of $-1$s in the list and we are done. $\square$
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
maromex
230 posts
#41
Y by
We claim $C = 506.$
First, we prove $C \le 506.$ Take the construction
\[ a_i = \begin{cases}1 & i = 1 \\ -1 & i = 2022 \\ -1 & i \equiv 2, 3 \pmod 4 \text{ and } i \neq 2022 \\ 1&i \equiv 0, 1 \pmod 4 \text{ and } i \neq 1.\end{cases}\]This configuration is symmetric because $a_i = -a_{2023 - i}$ for all $1 \le i \le 2022,$ so without loss of generality, it is sufficient to prove that $\sum\limits_{i=1}^k a_{t_i} \le 506$ for all possible configurations of the $t_i.$

In each "group of four" $(a_{4j-2}, a_{4j-1}, a_{4j}, a_{4j+1})$ for each $1 \le j \le 505$, there are two $-1$'s and then two $1$'s.. The $t_i$ cannot increase by more than $2,$ so we must take a $-1$ from each group. Therefore, in each group, our net gain must be at most $2 - 1 = 1$, unless the group is at the beginning, in which case our net gain could be $2- 0 = 2.$ If we choose to take $t_1 = 4,$ so that we get $2,$ then we cannot get the $+1$ at $a_1,$ so our maximum would be $504 \cdot 1 + 2 = 506.$ Otherwise, our maximum would be $505 \cdot 1 + 1 = 506.$

Now we prove $C \ge 506.$ Assume without loss of generality that the number of $1$'s in $(a_n)$ is at least $1011.$ (If instead the number of $-1$'s in $(a_n)$ is more than $1011,$ apply a similar strategy as described below but with signs flipped.)

Include every index that has a $1$ in the configuration; for all $i$, if $a_i = 1$ then $i$ is in the sequence $(t_n).$ Then "fill in the gaps" where needed. If, in $(a_n),$ there is a run of $2k$ instances of $-1$'s, then we only take $k$ of them; if instead there is a run of $2k+1$ instances of $-1$'s, only take $k$ of them. If there are a total of $m$ instances of $-1$'s, then this strategy will allow us to take at most $\lfloor \frac{m}{2} \rfloor$ of them. Now, $m \le 1011$ by our without-loss-of-generality, so we can take $505$ or less of the $-1$'s while still taking $1011$ of the $1$'s. We are done because, with this strategy, we can guarantee that \[ \sum\limits_{i=1}^{k} a_{t_i} \ge 1011 \cdot 1 + 505 \cdot -1 = 506.\]
This post has been edited 2 times. Last edited by maromex, May 29, 2025, 12:36 PM
Reason: apparently it's single & not double who would've guessed
Z K Y
N Quick Reply
G
H
=
a