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

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

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

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

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

Introductory: Grades 5-10

Prealgebra 1 Self-Paced

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

Prealgebra 2 Self-Paced

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

Introduction to Algebra A Self-Paced

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

Introduction to Counting & Probability Self-Paced

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

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

Introduction to Algebra B Self-Paced

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

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

Intermediate: Grades 8-12

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

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

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

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

Advanced: Grades 9-12

Olympiad Geometry
Tuesday, Jun 10 - Aug 26

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

Group Theory
Thursday, Jun 12 - Sep 11

Contest Preparation: Grades 6-12

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

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

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

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

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

AMC 12 Final Fives
Sunday, May 18 - Jun 15

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

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


MathWOOT Level 1
MathWOOT Level 2
ChemWOOT
CodeWOOT
PhysicsWOOT

Programming

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

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

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

Physics

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

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

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

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


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


More specifically:

For new threads:


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

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


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

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


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


For answers to already existing threads:


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

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



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


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

The above rules will be applied from next monday (5. march of 2007).
Feel free to discuss on this here.
49 replies
ZetaX
Feb 27, 2007
NoDealsHere
May 4, 2019
Combo problem
soryn   3
N 2 minutes ago by soryn
The school A has m1 boys and m2 girls, and ,the school B has n1 boys and n2 girls. Each school is represented by one team formed by p students,boys and girls. If f(k) is the number of cases for which,the twice schools has,togheter k girls, fund f(k) and the valute of k, for which f(k) is maximum.
3 replies
soryn
Yesterday at 6:33 AM
soryn
2 minutes ago
Looking for the smallest ghost
Justpassingby   5
N 14 minutes ago by venhancefan777
Source: 2021 Mexico Center Zone Regional Olympiad, problem 1
Let $p$ be an odd prime number. Let $S=a_1,a_2,\dots$ be the sequence defined as follows: $a_1=1,a_2=2,\dots,a_{p-1}=p-1$, and for $n\ge p$, $a_n$ is the smallest integer greater than $a_{n-1}$ such that in $a_1,a_2,\dots,a_n$ there are no arithmetic progressions of length $p$. We say that a positive integer is a ghost if it doesn’t appear in $S$.
What is the smallest ghost that is not a multiple of $p$?

Proposed by Guerrero
5 replies
Justpassingby
Jan 17, 2022
venhancefan777
14 minutes ago
non-symmetric ineq (for girls)
easternlatincup   36
N 19 minutes ago by Tony_stark0094
Source: Chinese Girl's MO 2007
For $ a,b,c\geq 0$ with $ a+b+c=1$, prove that

$ \sqrt{a+\frac{(b-c)^2}{4}}+\sqrt{b}+\sqrt{c}\leq \sqrt{3}$
36 replies
easternlatincup
Dec 30, 2007
Tony_stark0094
19 minutes ago
Turbo's en route to visit each cell of the board
Lukaluce   20
N 21 minutes ago by Mathgloggers
Source: EGMO 2025 P5
Let $n > 1$ be an integer. In a configuration of an $n \times n$ board, each of the $n^2$ cells contains an arrow, either pointing up, down, left, or right. Given a starting configuration, Turbo the snail starts in one of the cells of the board and travels from cell to cell. In each move, Turbo moves one square unit in the direction indicated by the arrow in her cell (possibly leaving the board). After each move, the arrows in all of the cells rotate $90^{\circ}$ counterclockwise. We call a cell good if, starting from that cell, Turbo visits each cell of the board exactly once, without leaving the board, and returns to her initial cell at the end. Determine, in terms of $n$, the maximum number of good cells over all possible starting configurations.

Proposed by Melek Güngör, Turkey
20 replies
Lukaluce
Apr 14, 2025
Mathgloggers
21 minutes ago
Divisibility on 101 integers
BR1F1SZ   3
N 23 minutes ago by ClassyPeach
Source: Argentina Cono Sur TST 2024 P2
There are $101$ positive integers $a_1, a_2, \ldots, a_{101}$ such that for every index $i$, with $1 \leqslant i \leqslant 101$, $a_i+1$ is a multiple of $a_{i+1}$. Determine the greatest possible value of the largest of the $101$ numbers.
3 replies
BR1F1SZ
Aug 9, 2024
ClassyPeach
23 minutes ago
BMO 2021 problem 3
VicKmath7   19
N 28 minutes ago by NuMBeRaToRiC
Source: Balkan MO 2021 P3
Let $a, b$ and $c$ be positive integers satisfying the equation $(a, b) + [a, b]=2021^c$. If $|a-b|$ is a prime number, prove that the number $(a+b)^2+4$ is composite.

Proposed by Serbia
19 replies
VicKmath7
Sep 8, 2021
NuMBeRaToRiC
28 minutes ago
USAMO 2002 Problem 4
MithsApprentice   89
N an hour ago by blueprimes
Let $\mathbb{R}$ be the set of real numbers. Determine all functions $f: \mathbb{R} \to \mathbb{R}$ such that \[ f(x^2 - y^2) = x f(x) - y f(y)  \] for all pairs of real numbers $x$ and $y$.
89 replies
MithsApprentice
Sep 30, 2005
blueprimes
an hour ago
pqr/uvw convert
Nguyenhuyen_AG   8
N 2 hours ago by Victoria_Discalceata1
Source: https://github.com/nguyenhuyenag/pqr_convert
Hi everyone,
As we know, the pqr/uvw method is a powerful and useful tool for proving inequalities. However, transforming an expression $f(a,b,c)$ into $f(p,q,r)$ or $f(u,v,w)$ can sometimes be quite complex. That's why I’ve written a program to assist with this process.
I hope you’ll find it helpful!

Download: pqr_convert

Screenshot:
IMAGE
IMAGE
8 replies
Nguyenhuyen_AG
Apr 19, 2025
Victoria_Discalceata1
2 hours ago
Inspired by hlminh
sqing   2
N 2 hours ago by SPQ
Source: Own
Let $ a,b,c $ be real numbers such that $ a^2+b^2+c^2=1. $ Prove that $$ |a-kb|+|b-kc|+|c-ka|\leq \sqrt{3k^2+2k+3}$$Where $ k\geq 0 . $
2 replies
sqing
Yesterday at 4:43 AM
SPQ
2 hours ago
A cyclic inequality
KhuongTrang   3
N 2 hours ago by KhuongTrang
Source: own-CRUX
IMAGE
https://cms.math.ca/.../uploads/2025/04/Wholeissue_51_4.pdf
3 replies
KhuongTrang
Monday at 4:18 PM
KhuongTrang
2 hours ago
Tiling rectangle with smaller rectangles.
MarkBcc168   60
N 2 hours ago by cursed_tangent1434
Source: IMO Shortlist 2017 C1
A rectangle $\mathcal{R}$ with odd integer side lengths is divided into small rectangles with integer side lengths. Prove that there is at least one among the small rectangles whose distances from the four sides of $\mathcal{R}$ are either all odd or all even.

Proposed by Jeck Lim, Singapore
60 replies
MarkBcc168
Jul 10, 2018
cursed_tangent1434
2 hours ago
ALGEBRA INEQUALITY
Tony_stark0094   2
N 2 hours ago by Sedro
$a,b,c > 0$ Prove that $$\frac{a^2+bc}{b+c} + \frac{b^2+ac}{a+c} + \frac {c^2 + ab}{a+b} \geq a+b+c$$
2 replies
Tony_stark0094
3 hours ago
Sedro
2 hours ago
Checking a summand property for integers sufficiently large.
DinDean   2
N 3 hours ago by DinDean
For any fixed integer $m\geqslant 2$, prove that there exists a positive integer $f(m)$, such that for any integer $n\geqslant f(m)$, $n$ can be expressed by a sum of positive integers $a_i$'s as
\[n=a_1+a_2+\dots+a_m,\]where $a_1\mid a_2$, $a_2\mid a_3$, $\dots$, $a_{m-1}\mid a_m$ and $1\leqslant a_1<a_2<\dots<a_m$.
2 replies
DinDean
Yesterday at 5:21 PM
DinDean
3 hours ago
Bunnies hopping around in circles
popcorn1   22
N 3 hours ago by awesomeming327.
Source: USA December TST for IMO 2023, Problem 1 and USA TST for EGMO 2023, Problem 1
There are $2022$ equally spaced points on a circular track $\gamma$ of circumference $2022$. The points are labeled $A_1, A_2, \ldots, A_{2022}$ in some order, each label used once. Initially, Bunbun the Bunny begins at $A_1$. She hops along $\gamma$ from $A_1$ to $A_2$, then from $A_2$ to $A_3$, until she reaches $A_{2022}$, after which she hops back to $A_1$. When hopping from $P$ to $Q$, she always hops along the shorter of the two arcs $\widehat{PQ}$ of $\gamma$; if $\overline{PQ}$ is a diameter of $\gamma$, she moves along either semicircle.

Determine the maximal possible sum of the lengths of the $2022$ arcs which Bunbun traveled, over all possible labellings of the $2022$ points.

Kevin Cong
22 replies
popcorn1
Dec 12, 2022
awesomeming327.
3 hours ago
IMO Shortlist 2009 - Problem C3
nsato   24
N Apr 6, 2025 by zuat.e
Let $n$ be a positive integer. Given a sequence $\varepsilon_1$, $\dots$, $\varepsilon_{n - 1}$ with $\varepsilon_i = 0$ or $\varepsilon_i = 1$ for each $i = 1$, $\dots$, $n - 1$, the sequences $a_0$, $\dots$, $a_n$ and $b_0$, $\dots$, $b_n$ are constructed by the following rules: \[a_0 = b_0 = 1, \quad a_1 = b_1 = 7,\] \[\begin{array}{lll}
	a_{i+1} = 
	\begin{cases}
		2a_{i-1} + 3a_i, \\
		3a_{i-1} + a_i, 
	\end{cases} & 
        \begin{array}{l} 
                \text{if } \varepsilon_i = 0, \\  
                \text{if } \varepsilon_i = 1, \end{array} 
         & \text{for each } i = 1, \dots, n - 1, \\[15pt]
        b_{i+1}= 
        \begin{cases}
		2b_{i-1} + 3b_i, \\
		3b_{i-1} + b_i, 
	\end{cases} & 
        \begin{array}{l} 
                \text{if } \varepsilon_{n-i} = 0, \\  
                \text{if } \varepsilon_{n-i} = 1, \end{array} 
         & \text{for each } i = 1, \dots, n - 1.
	\end{array}\] Prove that $a_n = b_n$.

Proposed by Ilya Bogdanov, Russia
24 replies
nsato
Jul 6, 2010
zuat.e
Apr 6, 2025
IMO Shortlist 2009 - Problem C3
G H J
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
nsato
15653 posts
#1 • 5 Y
Y by Adventure10, Mango247, PikaPika999, Fishheadtailbody, and 1 other user
Let $n$ be a positive integer. Given a sequence $\varepsilon_1$, $\dots$, $\varepsilon_{n - 1}$ with $\varepsilon_i = 0$ or $\varepsilon_i = 1$ for each $i = 1$, $\dots$, $n - 1$, the sequences $a_0$, $\dots$, $a_n$ and $b_0$, $\dots$, $b_n$ are constructed by the following rules: \[a_0 = b_0 = 1, \quad a_1 = b_1 = 7,\] \[\begin{array}{lll}
	a_{i+1} = 
	\begin{cases}
		2a_{i-1} + 3a_i, \\
		3a_{i-1} + a_i, 
	\end{cases} & 
        \begin{array}{l} 
                \text{if } \varepsilon_i = 0, \\  
                \text{if } \varepsilon_i = 1, \end{array} 
         & \text{for each } i = 1, \dots, n - 1, \\[15pt]
        b_{i+1}= 
        \begin{cases}
		2b_{i-1} + 3b_i, \\
		3b_{i-1} + b_i, 
	\end{cases} & 
        \begin{array}{l} 
                \text{if } \varepsilon_{n-i} = 0, \\  
                \text{if } \varepsilon_{n-i} = 1, \end{array} 
         & \text{for each } i = 1, \dots, n - 1.
	\end{array}\] Prove that $a_n = b_n$.

Proposed by Ilya Bogdanov, Russia
This post has been edited 2 times. Last edited by djmathman, Jun 26, 2015, 11:54 PM
Reason: changed latex to match that of english version of ISL2009
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
JBL
16123 posts
#2 • 3 Y
Y by Adventure10, PikaPika999, and 1 other user
Is there something wrong with the statement? Right now we trivially have $a_m = b_m$ for all $m$. :huh:

Edit: and now it's fixed.
This post has been edited 1 time. Last edited by JBL, Jul 7, 2010, 11:49 AM
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
Brut3Forc3
1948 posts
#3 • 3 Y
Y by Adventure10, PikaPika999, and 1 other user
The recurrence for $b_{n+1}$ should have $\epsilon_{n-i}$ equal 0 or 1 as the cases, as opposed to $\epsilon_i$.
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
April
1270 posts
#4 • 3 Y
Y by Adventure10, Mango247, PikaPika999
nsato wrote:
...
\[b_{i + 1} = \left\{
\begin{array}{cl}
2b_{i - 1} + 3b_i, & \text{if} \ \epsilon_i = 0, \\
3b_{i - 1} + b_i, & \text{if} \ \epsilon_i = 1,
\end{array}
\right.\]
for each $i = 1$, $\dots$, $n - 1$...
It should be
Quote:
\[b_{i + 1} = \left\{
\begin{array}{cl}
2b_{i - 1} + 3b_{i}, & \text{if} \ \epsilon_{n-i} = 0, \\
3b_{i - 1} + b_{i}, & \text{if} \ \epsilon_{n-i} = 1,
\end{array}
\right.\]
for each $i = 1$, $\dots$, $n - 1$.
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
darij grinberg
6555 posts
#5 • 20 Y
Y by kapilpavase, tarzanjunior, Pascal96, Plops, David-Vieta, Adventure10, Mango247, DS68, Deadline, PikaPika999, Fishheadtailbody, and 9 other users
This is definitely NOT a combinatorial problem. In contrast, it is one of the most algebraic problems on this shortlist. In this post, I give a solution using matrices (only elementary properties of matrices required) and some (less elementary) motivation for it.

Part 1: An algebraist's solution:

Solution. According to standard notations from linear algebra, we denote by $\mathrm{M}_2\left(\mathbb Q\right)$ the ring of $2\times 2$ matrices over the rational numbers.

Define two matrices $A\in \mathrm{M}_2\left(\mathbb Q\right)$ and $B\in \mathrm{M}_2\left(\mathbb Q\right)$ by $A=\left(\begin{array}{cc} 3&2\\ 1&0\end{array}\right)$ and $B=\left(\begin{array}{cc} 1&3\\ 1&0\end{array}\right)$.

For every $i\in\left\{1,2,...,n-1\right\}$, define a matrix $K_i\in \mathrm{M}_2\left(\mathbb Q\right)$ by $K_i=\varepsilon_i B + \left(1-\varepsilon_i\right) A$. This clearly yields that $K_i=A$ if $\varepsilon_i=0$, and that $K_i=B$ if $\varepsilon_i=1$.

For every $i\in\left\{1,2,...,n-1\right\}$, we have $\left(\begin{array}{c} a_{i+1}\\ a_i\end{array}\right) = K_i \left(\begin{array}{c} a_{i}\\ a_{i-1}\end{array}\right)$ (this is just another way to rewrite the equation $a_{i+1}=\left\{\begin{array}{cl}2a_{i-1}+3a_{i}, &\text{if}\ \epsilon_{i}= 0,\\ 3a_{i-1}+a_{i}, &\text{if}\ \epsilon_{i}= 1,\end{array}\right.$, as the reader can easily check). This yields that every $j\in\left\{0,1,...,n-1\right\}$ satifies $\left(\begin{array}{c} a_{j+1}\\ a_j\end{array}\right) = K_jK_{j-1}...K_1\left(\begin{array}{c} 7\\ 1\end{array}\right)$ (this follows by induction over $j$, using $\left(\begin{array}{c} a_1\\ a_0\end{array}\right)=\left(\begin{array}{c} 7\\ 1\end{array}\right)$). Applying this to $j=n-1$, we obtain $\left(\begin{array}{c} a_{n}\\ a_{n-1}\end{array}\right) =K_{n-1}K_{n-2}...K_1\left(\begin{array}{c} 7\\ 1\end{array}\right)$. Thus, $a_n=\left(\begin{array}{cc} 1&0 \end{array}\right) K_{n-1}K_{n-2}...K_1\left(\begin{array}{c} 7\\ 1\end{array}\right)$ (because $a_n=\left(\begin{array}{cc} 1&0 \end{array}\right)\left(\begin{array}{c} a_{n}\\ a_{n-1}\end{array}\right)$).

Similarly, for every $i\in\left\{1,2,...,n-1\right\}$, we have $\left(\begin{array}{c} a_{i+1}\\ a_i\end{array}\right) = K_{n-i} \left(\begin{array}{c} a_{i}\\ a_{i-1}\end{array}\right)$ (this is just another way to rewrite the equation $b_{i+1}=\left\{\begin{array}{cl}2b_{i-1}+3b_{i}, &\text{if}\ \epsilon_{n-i}= 0,\\ 3b_{i-1}+b_{i}, &\text{if}\ \epsilon_{n-i}= 1,\end{array}\right.$, as the reader can easily check). This yields that every $j\in\left\{0,1,...,n-1\right\}$ satifies $\left(\begin{array}{c} b_{j+1}\\ b_j\end{array}\right) = K_{n-j}K_{n-\left(j-1\right)}...K_{n-1}\left(\begin{array}{c} 7\\ 1\end{array}\right)$ (this follows by induction over $j$, using $\left(\begin{array}{c} b_1\\ b_0\end{array}\right)=\left(\begin{array}{c} 7\\ 1\end{array}\right)$). Applying this to $j=n-1$, we obtain $\left(\begin{array}{c} b_{n}\\ b_{n-1}\end{array}\right) = K_1K_2...K_{n-1}\left(\begin{array}{c} 7\\ 1\end{array}\right)$. Thus, $b_n=\left(\begin{array}{cc} 1&0 \end{array}\right) K_1K_2...K_{n-1}\left(\begin{array}{c} 7\\ 1\end{array}\right)$ (because $b_n=\left(\begin{array}{cc} 1&0 \end{array}\right)\left(\begin{array}{c} b_{n}\\ b_{n-1}\end{array}\right)$).

So far we have just translated the problem into the language of matrices. Now what is this of use for?

We have to prove $a_n=b_n$. Since $a_n=\left(\begin{array}{cc} 1&0 \end{array}\right) K_{n-1}K_{n-2}...K_1\left(\begin{array}{c} 7\\ 1\end{array}\right)$ and $b_n=\left(\begin{array}{cc} 1&0 \end{array}\right) K_1K_2...K_{n-1}\left(\begin{array}{c} 7\\ 1\end{array}\right)$, this means that we have to prove that

$\left(\begin{array}{cc} 1&0 \end{array}\right) K_{n-1}K_{n-2}...K_1\left(\begin{array}{c} 7\\ 1\end{array}\right) = \left(\begin{array}{cc} 1&0 \end{array}\right) K_1K_2...K_{n-1}\left(\begin{array}{c} 7\\ 1\end{array}\right)$.

In order to do this, it is clearly enough to define some map $s : \mathrm{M}_2\left(\mathbb Q\right) \to \mathrm{M}_2\left(\mathbb Q\right)$ which satisfies $s\left(K_{n-1}K_{n-2}...K_1\right) = K_1K_2...K_{n-1}$, and to show that every matrix $P\in \mathrm{M}_2\left(\mathbb Q\right)$ satisfies $\left(\begin{array}{cc} 1&0 \end{array}\right) P\left(\begin{array}{c} 7\\ 1\end{array}\right) = \left(\begin{array}{cc} 1&0 \end{array}\right) s\left(P\right)\left(\begin{array}{c} 7\\ 1\end{array}\right)$. How do we define such a map?

Let $U$ be the invertible matrix $\left(\begin{array}{cc} 7&1\\ 1&2\end{array}\right) \in \mathrm{M}_2\left(\mathbb Q\right)$. Let $s : \mathrm{M}_2\left(\mathbb Q\right) \to \mathrm{M}_2\left(\mathbb Q\right)$ be the map defined by ($s\left(P\right) = UP^TU^{-1}$ for every $P\in\mathrm{M}_2\left(\mathbb Q\right)$). We claim that

(1) this map $s$ satisfies $s\left(K_{n-1}K_{n-2}...K_1\right) = K_1K_2...K_{n-1}$,

and that

(2) this map $s$ satisfies $\left(\begin{array}{cc} 1&0 \end{array}\right) P\left(\begin{array}{c} 7\\ 1\end{array}\right) = \left(\begin{array}{cc} 1&0 \end{array}\right) s\left(P\right)\left(\begin{array}{c} 7\\ 1\end{array}\right)$ for every matrix $P\in \mathrm{M}_2\left(\mathbb Q\right)$.

Our definition of $s$ was seemingly a wild guess (I'll explain the motivation behind this guess in Parts 2 and 3), but if we manage to prove that this map $s$ satisfies (1) and (2), then the problem will be solved.

Verifying (2) is straightforward computation, which we leave out. Let us now prove (1):

The map $s$ satisfies $s\left(I_2\right)=I_2$ (where $I_2$ is the identity matrix $\left(\begin{array}{cc} 1&0\\ 0&1\end{array}\right) \in \mathrm{M}_2$) and $s\left(XY\right)=s\left(Y\right)\cdot s\left(X\right)$ for any two $2\times 2$ matrices $X$ and $Y$. Hence, by induction, we see that the map $s$ satisfies $s\left(X_kX_{k-1}...X_1\right) = s\left(X_1\right) s\left(X_2\right) ... s\left(X_k\right)$ for any $k\in \mathbb N$ and any $2\times 2$ matrices $X_1$, $X_2$, ..., $X_k$. Applying this to $k=n-1$ and $A_i=K_i$, we obtain $s\left(K_{n-1}K_{n-2}...K_1\right) = s\left(K_1\right) s\left(K_2\right) ... s\left(K_{n-1}\right)$. But our goal is to show that $s\left(K_{n-1}K_{n-2}...K_1\right) = K_1K_2...K_{n-1}$. So we must prove that $s\left(K_1\right) s\left(K_2\right) ... s\left(K_{n-1}\right) = K_1K_2...K_{n-1}$ now. Clearly, this will follow immediately once we have shown that $s\left(K_i\right) = K_i$ for every $i\in\left\{1,2,...,n-1\right\}$. But this is simple: Computation shows that $s\left(A\right)=A$ and $s\left(B\right)=B$, and recalling that $K_i=\varepsilon_i B + \left(1-\varepsilon_i\right) A$, we notice that

$s\left(K_i\right)=s\left(\varepsilon_i B + \left(1-\varepsilon_i\right) A\right)=\varepsilon_i \underbrace{s\left(B\right)}_{=B} + \left(1-\varepsilon_i\right)\underbrace{s\left(A\right)}_{=A}$ (since $s$ is linear)
$=\varepsilon_i B + \left(1-\varepsilon_i\right) A = K_i$.

This completes the solution.

Part 2: Motivation:

Remark: The above solution followed a rather standard procedure (translating linear recurrences into matrix multiplication - this is the same trick that solves many problems about Fibonacci numbers) until the point where we "guessed" the matrix $U$ and the map $s$. How did we do that?

The motivation is the following: We need a map $s$ which satisfies (1) and (2). We forget about (2) for a moment, and try to satisfy (1) only.

The easiest way to ensure that (1) holds for every choice of $n$ and $\varepsilon_1,\varepsilon_2,...,\varepsilon_{n-1}$ is to choose $s$ as a linear map satisfying $s\left(A\right)=A$ and $s\left(B\right)=B$ (this immediately guarantees that $s\left(K_i\right) = K_i$ for every $i$, because $K_i=\varepsilon_i B + \left(1-\varepsilon_i\right) A $ is a linear combination of $A$ and $B$) and satisfying $s\left(X_kX_{k-1}...X_1\right) = s\left(X_1\right) s\left(X_2\right) ... s\left(X_k\right)$ for any $k\in \mathbb N$ and any $2\times 2$ matrices $X_1$, $X_2$, ..., $X_k$. This condition $s\left(X_kX_{k-1}...X_1\right) = s\left(X_1\right) s\left(X_2\right) ... s\left(X_k\right)$ is fulfilled, for example, when the map $s$ has the form ($s\left(P\right) = UP^TU^{-1}$ for every $P\in\mathrm{M}_2\left(\mathbb Q\right)$) for $U$ an invertible $2\times 2$ matrix. Actually it is fulfilled only in this case, as I explain further below, but as for now let us at least agree that ($s\left(P\right) = UP^TU^{-1}$ for every $P\in\mathrm{M}_2\left(\mathbb Q\right)$) is a good point to start.

So now we are searching for a $2\times 2$ matrix $U$ such that the map $s$ defined by ($s\left(P\right) = UP^TU^{-1}$ for every $P\in\mathrm{M}_2\left(\mathbb Q\right)$) satisfies $s\left(A\right)=A$, $s\left(B\right)=B$ and (2). These conditions give linear equations on the entries of this matrix $U$, and the only matrix $U$ which solves all of them is (up to scaling) $\left(\begin{array}{cc} 7&1\\ 1&2\end{array}\right) \in \mathrm{M}_2\left(\mathbb Q\right)$. It is now clear how to proceed from here.

Part 3: Further motivation: why our choice of $s$ was not only correct but also the only possible

So I promised to tell why the only linear maps $s:\mathrm{M}_2\left(\mathbb Q\right)\to \mathrm{M}_2\left(\mathbb Q\right)$ which satisfy $s\left(X_kX_{k-1}...X_1\right) = s\left(X_1\right) s\left(X_2\right) ... s\left(X_k\right)$ for any $k\in \mathbb N$ and any $2\times 2$ matrices $X_1$, $X_2$, ..., $X_k$ are maps of the form ($s\left(P\right) = UP^TU^{-1}$ for every $P\in\mathrm{M}_2\left(\mathbb Q\right)$) for $U$ an invertible $2\times 2$ matrix. This is a particular case of the following general theorem:

Theorem. Let $F$ be a field, and $m$ a positive integer. The only $F$-linear maps $s:\mathrm{M}_m\left(F\right)\to\mathrm{M}_m\left(F\right)$ which satisfy $s\left(X_kX_{k-1}...X_1\right) = s\left(X_1\right) s\left(X_2\right) ... s\left(X_k\right)$ for any $k\in \mathbb N$ and any $m\times m$ matrices $X_1$, $X_2$, ..., $X_k$ (over $F$) are maps of the form ($s\left(P\right) = UP^TU^{-1}$ for every $P\in\mathrm{M}_m\left(F\right)$) for $U$ an invertible $m\times m$ matrix over $F$.

Proof of the Theorem. This is going to use some algebra...

Let $s$ be a map satisfying $s\left(X_kX_{k-1}...X_1\right) = s\left(X_1\right) s\left(X_2\right) ... s\left(X_k\right)$ for any $k\in \mathbb N$ and any $m\times m$ matrices $X_1$, $X_2$, ..., $X_k$ (over $F$). Define a map $t:\mathrm{M}_m\left(F\right)\to\mathrm{M}_m\left(F\right)$ by ($t\left(P\right)=s\left(P\right)^T$ for every $P\in\mathrm{M}_m\left(F\right)$). Then, this map $t$ satisfies $t\left(X_kX_{k-1}...X_1\right) = t\left(X_1\right) t\left(X_2\right) ... t\left(X_k\right)$ for any $k\in \mathbb N$ and any $m\times m$ matrices $X_1$, $X_2$, ..., $X_k$ (over $F$). In other words, $t$ is an algebra endomorphism of $\mathrm{M}_m\left(F\right)$. Now, a corollary of the Noether-Skolem theorem (Corollary 2.12 in Milne's Class Field Theory) states that all endomorphisms of a central simple $F$-algebra are inner automorphism (note that it usually states this only for automorphisms, but the proof still applies to endomorphisms). Since the matrix algebra $\mathrm{M}_m\left(F\right)$ is central simple, this shows that our endomorphism $t$ is an inner automorphism, i. e., that it has the form ($t\left(P\right) = VPV^{-1}$ for every $P\in\mathrm{M}_m\left(F\right)$) for $V$ an invertible $m\times m$ matrix over $F$. Now, $t\left(P\right)=s\left(P\right)^T$ yields

$s\left(P\right)=t\left(P\right)^T=\left(VPV^{-1}\right)^T = \left(V^{-1}\right)^TP^TV^T$.

In other words, if we define $U=\left(V^{-1}\right)^T$, then $s\left(P\right)=UP^TU^{-1}$ for every matrix $P\in\mathrm{M}_m\left(F\right)$, and the Theorem is proven.
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
jgnr
1343 posts
#6 • 4 Y
Y by Adventure10, Mango247, PikaPika999, and 1 other user
The official solution is actually quite nice, not algebraic at all. Here is the sketch.

Click to reveal hidden text
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
v_Enhance
6874 posts
#7 • 28 Y
Y by ahaanomegas, Mediocrity, anantmudgal09, kapilpavase, mhq, droid347, huricane, A_Math_Lover, samuel, Siddharth03, niyu, Limerent, TheUltimate123, rjiangbz, IAmTheHazard, Ritwin, khina, a22886, Adventure10, Mango247, Tqhoud, PikaPika999, Sedro, and 5 other users
This is probably close to a record for the weirdest solution I've ever found on an olympiad problem.

It's equivalent to show that $A_n = B_n$ where $A_n = 2^na_n$, $B_n = 2^nb_n$. In that case, $A_0 = B_0 = 1$, $A_1 = B_1 = 14$, and the recursion is $A_{n+1} = 8A_{n-1} + 6A_n$ or $A_{n+1} = 12A_{n-1} + 2A_n$.

[asy]
size(6cm);
int n = 7;
for (int i=1; i <= n; ++i) {
	draw( (i,0)--(i-1,0)--(i-1,1)--(i,1)--cycle );
	if (i <= 2) { MP("\epsilon_" + (string) i, (i,1), dir(90)); }
	if (i == n-2) { MP("\epsilon_{n-2}", (i,1), dir(90)); }
	if (i == n-1) { MP("\epsilon_{n-1}", (i,1), dir(90)); }
}
[/asy]
Consider a mansion with $n$ rooms labelled $1, 2, \dots, n$ arranged in a row. There are $n-1$ walls; we label the wall between rooms $i$ and $i+1$ with $\epsilon_i$. Now, suppose we wish to paint each room of the mansion with one of fourteen colors, called, $\star, 1, 2, \dots, 13$. Note that each wall thus receives two colors.

We do this subject to two strange rules. Suppose $i,j \neq \star$ are two colors of a wall. For walls labelled zero, we dictate that \[ i \in \left\{ j-2, j-1, j, j+1, j+2 \right\} \pmod{13}. \] For walls labelled one, we dictate that $i = j$. If a wall is marked $\star$, then there are no requirements. Note also that this is symmetric in $i$ and $j$ (so the mansion retains symmetry).

We claim that $A_k$ counts the number of ways to paint the leftmost $k$ rooms of the mansion, while $B_k$ counts the number of ways to paint the rightmost $k$ rooms of the mansion. Let's look at just $A_k$ when $\epsilon_k = 0$. Suppose we've painted the first $k-1$ rooms with the colors $c_1, \dots, c_{k-1}$. Most of the time, we have $6$ colors we can select for $c_k$, five from the specified set plus the extra choice $\star$. However, if $c_{k-1} = \star$, we have an additional $8$ choices. This happens for $A_{k-2}$ mansions. The recursion $A_k = 6A_{k-1} + 8A_{k-2}$ follows.

Now it's obvious $A_n = B_n$.
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
darij grinberg
6555 posts
#8 • 3 Y
Y by v_Enhance, Adventure10, Mango247
v_Enhance wrote:
The recursion $A_k = 8A_{k-1} + 6A_{k-2}$ follows.

I'm a bit confused, because this doesn't match $A_{n+1} = 8A_{n-1} + 6A_n$. Maybe you want to dictate \[ i \in \left\{ j-2, j-1, j, j+1, j+2 \right\} \pmod{13} \] for walls labelled zero, and \[ i = j \] for walls labelled one?

Otherwise, this is a really nice solution!
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
v_Enhance
6874 posts
#9 • 2 Y
Y by Adventure10, Mango247
Ah yes, I'm as careless as always. Thanks for pointing that out, I've edited the solution. :)
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
mathocean97
606 posts
#10 • 2 Y
Y by Adventure10, Mango247
Here's my solution that I found a while ago. It's not very cool though...
So given a string $w$ and 2 starting terms $a_0$ and $a_1$, if we apply the $w$ recursion to $a_0, a_1$, after $k$ steps we will have the number $c_k a_0 + d_k a_1$ for some integer coefficients $c_k, d_k$. Similarly, if we apply the first $k$ terms of $w$ backwards, then we get the number $e_k a_0 + f_k a_1$, where $e_k, f_k$ would be the backwards coefficients. The coefficients are unique to the string $w$. We induct on the length of $w$ (which is $n-1$). Assume that it's true for all lengths that are at most $n-2$. Note that by the inductive hypothesis, $c_k+7d_k = e_k+7f_k$ for $k \le n-2$.

We do casework on the last term of the sequence. Say it's $0$ ($1$ goes exactly the same way). Evaluating from the front, we would get that $a_{n-2} = c_{n-3}+7d_{n-3} = e_{n-3}+7f_{n-3}$ and $a_{n-1} = c_{n-2}+7d_{n-2} = e_{n-2}+7f_{n-2}$. Applying the $0$ to these, we get that $a_n = 2a_{n-2}+3a_{n-1} = 2(e_{n-3}+7f_{n-3}) + 3(e_{n-2}+7f_{n-2})$.
Now, going backwards, we first apply to $0$, so we now have the terms $1, 7, 23$. Now, this is equivalent to starting a sequence with $7, 23$ and doing the first $n-2$ terms backwards. So $b_n = 7e_{n-2}+23f_{n-2}$.

So for $a_n = b_n$ to be true, $2(e_{n-3}+7f_{n-3}) + 3(e_{n-2}+7f_{n-2}) = 7e_{n-2}+23f_{n-2}$ and simplifying this gives $e_{n-3}+7f_{n-3} = 2e_{n-2}+f_{n-2}$. So proving this for any $w$ would finish this. But this is easy. Indeed, note that the RHS is equivalent to starting with $(2, 1)$ and evaluating the first $n-2$ steps backwards while the RHS is equivalent to starting a sequence with $(1, 7)$ and evaluating the first $n-3$ steps backwards. But starting with $(2, 1)$ gives the next term of $7$ under both operations, so we're done.
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
MathPanda1
1135 posts
#11 • 1 Y
Y by Adventure10
v_Enhance wrote:
We claim that $A_k$ counts the number of ways to paint the leftmost $k$ rooms of the mansion, while $B_k$ counts the number of ways to paint the rightmost $k$ rooms of the mansion. Let's look at just $A_k$ when $\epsilon_k = 0$. Suppose we've painted the first $k-1$ rooms with the colors $c_1, \dots, c_{k-1}$. Most of the time, we have $6$ colors we can select for $c_k$, five from the specified set plus the extra choice $\star$. However, if $c_{k-1} = \star$, we have an additional $8$ choices. This happens for $A_{k-2}$ mansions. The recursion $A_k = 6A_{k-1} + 8A_{k-2}$ follows.

What if $\epsilon_k = 1$? Wouldn't that add 1 more case?
Also, v_Enhance, what is the motivation for your very beautiful solution?
Thank you very much for all your help!
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
v_Enhance
6874 posts
#12 • 2 Y
Y by Adventure10, Mango247
MathPanda1 wrote:
What if $\epsilon_k = 1$? Wouldn't that add 1 more case?
Yes, I just omitted it because this case is exactly the same; it gives you the other recursion.

The idea was just that I wanted to see if I could get the relation to be symmetric from left to right in the way I did... because I wanted a combinatorial interpretation, I did the doubling to get the coefficients to be $12+2=8+6$. From there it amounted to putting the right restrictions on the walls in order to get the desired cases.
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
MathPanda1
1135 posts
#13 • 2 Y
Y by Adventure10, Mango247
Thank you very much for the motivation v_Enhance!
But I was wondering what the inspiration for using the walls and how you made such restrictions?
Thank you again and look forward for your reply!
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
andywu
56 posts
#14 • 3 Y
Y by IAmTheHazard, Adventure10, Tqhoud
there is my solution.

$ b_{n-i+1}=(3-2\varepsilon_{i})b_{n-i}+(2+\varepsilon_{i})b_{n-i-1}=\frac{-2a_{i+1}+7a_{i-1}}{-2a_{i}+a_{i-1}}b_{n-i}+\frac{a_{i+1}-7a_{i}}{-2a_{i}+a_{i-1}}b_{n-i-1} $
$ -2(a_{n-i}b_{i+1}-a_{n-i+1}b_{i})+(a_{n-i-1}b_{i+1}-a_{n-i+1}b_{i-1})-7(a_{n-i-1}b_{i}-a_{n-i}b_{i-1})=0 $
$ 2(a_{n-i}b_{i+1}-a_{n-i+1}b_{i})-(a_{n-i-1}b_{i+1}-a_{n-i}b_{i})=(a_{n-i}b_{i}-a_{n-i+1}b_{i-1})-7(a_{n-i-1}b_{i}-a_{n-i}b_{i-1})=0 $
plus them for $ i=1,2,\dots n-2 $ and we can get $ 13(b_{n}-a_{n})=0 $
which is $ b_{n}=a_{n} $
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
leminscate
109 posts
#15 • 3 Y
Y by randomusername, anantmudgal09, Adventure10
Here's a really weird solution!

We define the sequence $P_0, \cdots, P_n$ of multivariate polynomials as follows: $P_0=1, P_1=7$ and $P_{i+1} = (2+x_i)P_{i-1}+(3-2x_i)P_i$ for $i=1,\cdots, n-1$. Note that $x_i=0$ corresponds to $\varepsilon_i=0$ and $x_i=1$ corresponds to $\varepsilon_i=1$. We're done if we can show that $P_n(x_1, \cdots, x_{n-1}) = P_n(x_{n-1}, \cdots, x_1)$. Now this follows if we can prove it with the restrictions that $x_i\in \left\{-2, \frac{3}{2}\right\}$, for all $i=1,\cdots, n-1$. Observe that $P_0=1, P_1=7$, $P_{i+1}=7P_i$ if $x_i=-2$, and $P_{i+1}=\frac{7}{2}P_{i-1}$ if $x_i = \frac{3}{2}$. We want to show that $P_n$ is the same if we reverse the order of the $x_i$.

Let $d_i$ be the power of $7$ in $P_i$. We have $d_0=0, d_1=1$, $d_{i+1}=d_i+1$ if $x_i=-2$, and $d_{i+1}=d_{i-1}+1$ if $x_i=\frac{3}{2}$. This is an increasing sequence where the difference between consecutive terms is either $0$ or $1$. Consider the blocks of $-2$'s and $\frac{3}{2}$'s. A $-2$ will always cause an increase by $1$ from the previous term. A block of $k$ $\frac{3}{2}$'s, starting at $x_i$, will cause an increase of $\left\lfloor \frac{k}{2} \right\rfloor$ from $d_i$. So if we reverse everything the amount of each increase is still the same, just occurs in a different order, so $P_n$ will have the same power of $7$. A similar argument can be done for powers of $2$, and we can then conclude that $P_n$ is the same upon reversing the $x_i$.
This post has been edited 1 time. Last edited by leminscate, Nov 22, 2016, 12:00 PM
Reason: fixed latex
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
solver6
259 posts
#16 • 1 Y
Y by Adventure10
From ideas similar to $\textbf{darij grinberg}$ we see how to construct more similar problems :

First we need to chose some symmetrical matrices $A_1, A_2, \ldots, A_n$ and vector $v$. So we get relation $v^TA_1A_2\ldots A_n v = v^TA_nA_{n-1}\ldots A_1 v$.

Next for every invertible $U$ we have $v_1^T A'_1A'_2\ldots A_n v_2 = v_1^TA'_nA'_{n-1}\ldots A'_1 v_2$, where $A'_i := UA_iU^{-1}, v_1^T := v^T U^{-1}, v_2 :=Uv$. And (conjecturally) all such examples can be constructed in this way.
This post has been edited 4 times. Last edited by solver6, Dec 2, 2016, 9:34 PM
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
MathStudent2002
934 posts
#17 • 6 Y
Y by huricane, william122, DrYouKnowWho, Adventure10, Mango247, Quidditch
Similar approach to lemniscate's. The problem itself is very similar to USAJMO 2011/4.

Define the polynomials $P_n$ inductively by $P_0 = 1$, $P_1 = 7$, and \[
P_n = (2+x_{n-1})P_{n-2} + (3-2x_{n-1})P_{n-1}
\]for $n\geq 0$. We will show that $P_n(x_1,\ldots, x_{n-1}) = P_n(x_{n-1},\ldots, x_1)$ as well. We proceed by strong induction on $n$; the base cases of $n=1,2,3,4,5$ are easily checked by hand. For the inductive step, note that \[
P_n(x_1,\ldots, x_{n-1}) = (2+x_{n-1})P_{n-2}(x_1,\ldots, x_{n-3}) + (3-2x_{n-1})P_{n-1}(x_1,\ldots, x_{n-2}).
\]Now, \[
\begin{aligned}
P_n(x_{n-1}, \ldots, x_1) &= (2+x_1)P_{n-2}(x_{n-1},\ldots, x_3) + (3-2x_1)P_{n-1}(x_{n-1},\ldots, x_2)\\
&= (2+x_1)P_{n-2}(x_3,\ldots, x_{n-1}) + (3-2x_1)P_{n-1}(x_2,\ldots, x_{n-1}). \qquad \qquad (\spadesuit)
\end{aligned}
\]Now, \[
P_{n-1}(x_2,\ldots, x_{n-1}) = (2+x_{n-1})P_{n-3}(x_2,\ldots, x_{n-3}) + (3-2x_{n-1})P_{n-2}(x_2,\ldots, x_{n-2}),
\]and
\[
P_{n-2}(x_3,\ldots, x_{n-1}) = (2+x_{n-1})P_{n-4}(x_3,\ldots, x_{n-3}) + (3-2x_{n-1})P_{n-3}(x_3,\ldots, x_{n-2}).
\]Substituting into $(\spadesuit)$ and collecting $(2+x_{n-1})$ and $(3-2x_{n-1})$ terms, we see that \[
P_n(x_{n-1},\ldots, x_1) = (2+x_{n-1})((2+x_1)P_{n-4}(x_3,\ldots, x_{n-3})+(3-2x_1)P_{n-3}(x_2,\ldots, x_{n-3}))\]\[+(3-2x_{n-1})((2+x_1)P_{n-3}(x_3,\ldots, x_{n-2}) + (3-2x_1)P_{n-2}(x_2,\ldots, x_{n-2})).
\]The first collapses into \[
(2+x_{n-1})((2+x_1)P_{n-4}(x_{n-3},\ldots, x_{3})+(3-2x_1)P_{n-3}(x_{n-3},\ldots, x_2))\]\[= (2+x_{n-1})P_{n-2}(x_{n-3},\ldots, x_1) = (2+x_{n-1})P_{n-2}(x_1,\ldots, x_{n-3}),
\]while the latter collapses into \[
(3-2x_{n-1})((2+x_1)P_{n-3}(x_{n-2},\ldots, x_{3}) + (3-2x_1)P_{n-2}(x_{n-2},\ldots, x_{2}))\]\[ = (3-2x_{n-1})P_{n-1}(x_{n-2},\ldots, x_1) = (3-2x_{n-1})P_{n-1}(x_1,\ldots, x_{n-2}),
\]which when summed equals $P_n(x_1,\ldots, x_{n-1})$. $\blacksquare$
This post has been edited 3 times. Last edited by MathStudent2002, Feb 27, 2018, 11:53 PM
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
tastymath75025
3223 posts
#18 • 1 Y
Y by Adventure10
Another boring inductive solution: let $f_0 (a_{i-1}, a_i) = 2a_{i-1}+3a_i, f_1 (a_{i-1}, a_i) = 3a_{i-1}+a_i$. We'll abuse notation by letting a "word" be any sequence $W=f_{\epsilon_k}f_{\epsilon_{k-1}}...f_{\epsilon_0}$ where $W(a_0, a_1)$ is the $k+1$th term of the sequence $\{a_i\}$ given by the corresponding choice of $\epsilon_i$. Note that this matches with our earlier definition when $k=0$.

We'd like to show $W(1,7)=\overline{W}(1,7)$, where $\overline{W}$ denotes reversing the order. We'll induct on the length of $W$ with base cases $1,2$ obvious. For the inductive step, it's enough to show that if $A,B\in \{f_0, f_1\}$, then $ABW(1,7) = \overline{W}BA(1,7)$. Note that $\overline{W}BA(1,7) = \overline{W}(A(1,7), BA(1,7))$ and $ABW(1,7) = A(W(1,7), BW(1,7))=A(W(1,7), \overline{W}B(1,7))$ so it's enough to show these latter quantities are equal. Suppose $W(a_0, a_1) = ua_0+va_1$ and $\overline{W} (a_0, a_1) = u'a_0+v'a_1$; then by the inductive hypothesis, we have $u+7v = u'+7v'$.

Case 1: $A=B=f_0$. Then $A(W(1,7), \overline{W}B(1,7)) = A(u+7v, \overline{W}(7,23)) = A(u+7v,  7u' + 23v') = 2(u+7v) + 3(7u' + 23v')$. Meanwhile $\overline{W}BA(1,7) = \overline{W}(23, 83) = 23u'+83v'$; utilizing the fact that $u+7v=u'+7v'$ proves the equality.

Case 2: $A=B=f_1$. Then $A(W(1,7), \overline{W}B(1,7)) = A(u+7v, \overline{W} (7, 10)) = A(u+7v, 7u' + 10v') = 3(u+7v)+(7u'+10v')$; meanwhile $\overline{W}BA(1,7) = \overline{W} (10, 31) = 10u'+31v'$, so again the equality holds.

Case 3: $A=f_0, B=f_1$. Then $A(W(1,7), \overline{W}B(1,7)) = A(u+7v, \overline{W}(7,10)) = A(u+7v, 7u' + 10v') = 2(u+7v) + 3(7u' + 10v')$; meanwhile $\overline{W}BA(1,7) = \overline{W} (23, 44) = 23u'+44v'$, so again the equality holds.

Case 4: $A=f_1, B=f_0$. Then $A(W(1,7), \overline{W}B(1,7)) = A(u+7v, \overline{W} (7, 23)) = A(u+7v, 7u'+23v') = 3(u+7v) + (7u'+23v')$; meanwhile $\overline{W}BA(1,7) = \overline{W} (10, 44) = 10u'+44v'$, so again the desired equality holds.

In all four cases, we're done, so the inductive step is complete as desired.
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
pandadude
710 posts
#19 • 2 Y
Y by Adventure10, Mango247
I did the 4 case induction but I have a solution idea that involves combo:
I realized that $7=3*1+2*2=1*1+3*2$(If we have 2,1 then the next term will always be 7), this gives an intuition to build a new sequence.

Thus, lets create a new sequence, $x_k=\frac{a_k}{2^{n-k}}$ and $y_k=\frac{b_k}{2^{n-k}}$

Now we have $x_k=6x_{k-1}+8x_{k-2}$ if e is 0, and $x_k=2x_{k-1}+12x_{k-2}$ if e is 1. Same for $y_k$. This is nice because the 2 numbers sum to 14 in both cases. I think we need to do something with recursion that is symmetrical? If anybody has any ideas how to finish, please tell me.
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
yayups
1614 posts
#20
Y by
Terribly written up solution, but this is exactly how I thought of it when solving the problem.

Note that \[a_{i+1} = (2+\varepsilon_i)a_{i-1} + (3-2\varepsilon_i)a_i\]and \[a_{i+1} = (2+\varepsilon_{n-i})a_{i-1} + (3-2\varepsilon_{n-i})a_i.\]Using these relations without plugging in $\varepsilon_i=0,1$, we see that $a_n$ and $b_n$ are both $(n-1)$-degree polynomials in $\varepsilon_1,\ldots,\varepsilon_{n-1}$. Furthermore, each term is squarefree by a trivial induction. It suffices to show that the polynomial for $a_n$ is symmetric under a $(\varepsilon_1,\ldots,\varepsilon_{n-1})\to(\varepsilon_{n-1},\ldots,\varepsilon_1)$ interchange. It is intuitively clear that it suffices to show this for all $(\varepsilon_1,\ldots,\varepsilon_{n-1})\in\{x,y\}^{n-1}$ for some fixed $x$ and $y$, but we'll formally prove this by an application of Combinatorial Nullstellensatz.

Claim: Suppose we have a squarefree polynomial $P(x_1,\ldots,x_m)$ of degree at most $m$ such that it is zero for all $(x_1,\ldots,x_m)\in\{x,y\}^m$ for some fixed $x$ and $y$. Then, $P$ is identically $0$.

Proof: Suppose not, so let the degree be $d$, and let a term of maximal degree be $x_{i_1}\cdots x_{i_d}$. By CNS, there is some $(x_1,\ldots,x_n)\in\prod S_i$ where $S_{i_k}=\{x,y\}$ and $S_i=\{x\}$ for $i\ne i_k$ for any $i$ such that \[P(x_1,\ldots,x_n)\ne 0.\]This is a contradiction, so we're done. $\blacksquare$

We may now assume that $\varepsilon_i\in\{-2,\tfrac{3}{2}\}$. We now have $a_{i+1}=7a_i$ if $\varepsilon_i=-2$ and $a_{i+1}=\frac{7}{2}a_{i-1}$ if $\varepsilon_i=\tfrac{3}{2}$. Let $\delta_i=1$ if $\varepsilon_i=-2$ and $\delta_i=2$ if $\varepsilon_i=\tfrac{3}{2}$.

Thus, to find the value of $a_n$, we perform the following algorithm with $a_n$ initially set to $1$. Consider the number line and start at position $n$. From position $i$, jump to $i-\delta_i$, and if $\delta_i=1$, update $a_n$ to $7a_n$, and if $\delta_i=2$, update $a_n$ to $7a_n/2$. If we stop at $1$, then update $a_n$ to $7a_n$, and if we stop at $0$, then we just output $a_n$ without any change. It suffices to show that this process gives the same value of $a_n$ if we reverse the initial sequence of $\delta_i$s.

It's not hard to see that the final value of $a_n$ we get is $7^{n-x}2^{-x}$, where $x$ is the number of times we land on $i$ with $\delta_i=2$. Thus, it suffices to show that the process gives the same value for $x$ if we flip the sequence. Indeed, it is not hard to see that \[x=\sum_{B}\lceil f(B)/2\rceil,\]where $B$ ranges over all blocks of consecutive $2$s, and $f(B)$ is the size of the block. This stays the same if we flip the sequence, so we're done.
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
pad
1671 posts
#21 • 1 Y
Y by David-Vieta
Nice problem. Probably a new solution.

Note
\begin{align*}
a_{i+1} &= (3-2\varepsilon_i)a_i+(2+\varepsilon_i)a_{i-1}. \qquad (\spadesuit)
\end{align*}Starting with $a_0=1$ and $a_1=7$, using the above process we can write $a_k$ as a polynomial in $\varepsilon_1,\ldots,\varepsilon_{k-1}$. It suffices to prove that this polynomial is invariant when we replace $\varepsilon_1,\ldots,\varepsilon_{k-1}$ with $\varepsilon_{k-1},\ldots,\varepsilon_1$, respectively (i.e. reverse the list of variables), since for all $n$, $b_n$ is constructed in the same way as $a_n$ but $\varepsilon_{n-i}$ is used wherever $\varepsilon_i$ is used instead. So now we can forget about the $b$ sequence entirely!

Example: first few terms of polynomial sequence

Fix an arbitrary $n$.
Observation 1. The polynomial for $a_n$ is squarefree in terms of the variables. This is clear since to generate $a_{i+1}$, we take a linear combination of the polynomials $a_i$ and $a_{i-1}$ whose coefficients are in terms of the new variable $\varepsilon_i$.
Observation 2. By Observation 1, each term in the polynomial form of $a_n$ has either 0 or 1 of each of $\varepsilon_1,\ldots,\varepsilon_{n-1}$ multiplied together times some constant coefficient. So we can express $a_n$ as a table where each binary string of length $n-1$ has a corresponding coefficient.

Example: first few tables

Now, let's analyze the recursive equation $(\spadesuit)$ in terms of the binary table. We have
\[ a_{n+1} = 3a_n- 2\varepsilon_n a_n + 2a_{n-1} + 1\varepsilon_n a_{n-1}. \]So to generate the table for $a_{n+1}$ from previous tables:
  • Take the binary strings of $a_n$ and add $0$ to the end. Multiply the values all by $3$.
  • Take the binary strings of $a_n$ and add $1$ to the end. Multiply the values all by $-2$.
  • Take the binary strings of $a_{n-1}$ and add $00$ to the end. Multiply the values all by $2$.
  • Take the binary strings of $a_{n-1}$ and add $01$ to the end. Multiply the values all by $1$.
Finally, vector sum everything (sum up all the values for each specific binary string from the above process) to get the final table for $a_{n+1}$.
We can restate the problem as a combinatorics problem now similar to above:
Combo problem wrote:
Define the function $f:\text{binary strings} \to \mathbb{Z}$ as follows: $f(\emptyset)=7$, $f(0)=23$, $f(1)=-13$, and
\begin{align*}
f(S) &= \mathbf{1}(\text{$S$ ends in 0}) \cdot 3f(S-0) \\
&~ + \mathbf{1}(\text{$S$ ends in 1}) \cdot (-2)f(S-1) \\
&~ + \mathbf{1}(\text{$S$ ends in 00}) \cdot 2f(S-00) \\
&~ + \mathbf{1}(\text{$S$ ends in 01}) \cdot 1f(S-01),
\end{align*}Prove $f(S)=f(\overline{S})$ for all binary strings $S$.

(Here, $S-S'$ denotes removing $S'$ from the end of $S$ if it's there. And $\overline{S}$ denotes the reverse of $S$.)
We go by induction on the length of $S$. Brute force to prove the statement for all $S$ of length at most 4 (by writing out the table as shown in the example above).
Main idea: We split into cases based on the first two and last two characters in the binary string. Use the inductive hypothesis heavily.
Sketch of finish. There's not much to the combo problem after this idea, so the remaining case-bash is a sketch. The first few cases are computed explicitly, but the rest can be filled in and are extremely similar to each other.
  • Case 1: 00S00 This is equal to $f(00\overline{S}00)$ since the two middle terms have the same coefficient.
  • Case 2: 00S01 10S00 These are equal.
  • Case 3: 00S10 01S00 These are equal.
  • Case 4: 00S11 11S00 These are equal.
  • Case 5: 01S01 10S10 These are equal.
  • Case 6: 01S10 Equal to its reverse.
  • Case 7: 01S11 11S10 These are equal.
  • Case 8: 10S01 Equal to its reverse.
  • Case 9: 10S11 11S01 These are equal.
  • Case 10: 11S11 Equal to its reverse.
This finishes the induction, and the proof.

Remarks
This post has been edited 3 times. Last edited by pad, Feb 9, 2022, 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.
CT17
1481 posts
#22
Y by
We strong induct on $n$. The base cases $n=1,2$ are trivial and $n=3$ is easy to check.

First, for two linear functions $k(x,y)$ and $\ell(x,y)$, define their composition $k\circ \ell(x,y) = \ell(y,k(x,y))$. Restating the problem, let $n\ge 4$, $k_0(x,y) = 2x + 3y$ and $k_1(x,y) = 3x + y$. We have the linear functions $a = k_{\epsilon_1}\circ \dots \circ k_{\epsilon_{n-1}}$ and $b = k_{\epsilon_{n-1}}\circ \dots\circ k_{\epsilon_1}$ (with order of operations from left to right), and we want to show $a(1,7) = b(1,7)$. By the inductive hypothesis, $a'(1,7) = b'(1,7)$ and $a''(1,7) = b''(1,7)$ where $a' =  k_{\epsilon_1}\circ \dots \circ k_{\epsilon_{n-2}}$, $a'' =  k_{\epsilon_1}\circ \dots \circ k_{\epsilon_{n-3}}$, $b' =  k_{\epsilon_{n-2}}\circ \dots\circ k_{\epsilon_1}$, and $b'' =  k_{\epsilon_{n-3}}\circ \dots\circ k_{\epsilon_1}$.

If $\epsilon_n = 0$, we have

$$a(1,7) = 2a''(1,7) + 3a'(1,7) = 2b''(1,7) + 3b'(1,7) = 2b'(2,1) + 3b'(1,7) = b'(7,23) = k_{\epsilon_n}\circ b'(1,7) = b(1,7).$$
If $\epsilon_n = 1$, we have

$$a(1,7) = 3a''(1,7) + a'(1,7) = 3b''(1,7) + b'(1,7) = 3b'(2,1) + b'(1,7) = b'(7,10) = k_{\epsilon_n}\circ b'(1,7) = b(1,7).$$
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
HamstPan38825
8857 posts
#25
Y by
The arch $20\%$ hint led me to this monstrosity, so at least I can divert some blame.

Let $x_n = 2^n a_n$ and $y_n = 2^n b_n$ for each $n$. Then the existing recurrences read
\[x_n \in \{12x_{n-2} + 2x_{n-1}, 6x_{n-2} + 8x_{n-1}\}.\]This satisfies the important (!) property that $12+2=7 \cdot 2 = 6+8$. In particular, we consider the following totally not contrived combinatorial problem:
New Problem wrote:
We have a line of $n$ cells delimited by $n-1$ walls, some of which are weak. We want to color some (not necessarily all) of the $n$ cells using $13$ different colors, such that the following rules are satisfied:
  • If two colored cells are delimited by a weak wall, then they must be the same color;
  • If two colored cells are delimited by a strong wall, then they must be within two spaces of each other on the color wheel (we have to insert black somewhere random on the wheel unfortunately.)
We let wall $i$ from the left be weak if $\varepsilon_i = 1$. We let $x_i$ denote the number of ways to color the first $i$ cells from the left, and $y_i$ the number of ways to color the first $i$ cells from the right. Then consider:
  • If the $i$th cell from the left is delimited by a weak wall from the $i-1$th cell, we can either leave it colorless, yielding $x_{i-1}$ colorings. If we color the cell, we have one of two cases:
    • The $i-1$th cell is colored that same color. Then our problem bijects to coloring the first $i-1$ cells in the obvious way, except that the $i-1$th cell cannot be left colorless. Hence, there are $x_{i-1} - x_{i-2}$ cases here.
    • The $i-1$th cell is left colorless. Then we just need to color the remaining $i-2$ cells, yielding $13x_{i-2}$ cases for the $13$ possible colorings of the last cell.
    So this case yields $x_i = 2x_{i-1} + 12x_{i-2}$, which is what we want.
  • If the $i$th cell from the left is delimited by a strong wall from the $i-1$th wall, we can again either leave it colorless, yielding $x_{i-1}$ colorings. Otherwise:
    • If the $i-1$th cell is also colored, there are $5$ ways to color it and we have again a bijection to the $i-1$ case because the colors are symmetric! So there are $5\left(x_{i-1}-x_{i-2}\right)$ colorings here.
    • If the $i-1$th cell is left uncolored, there are again $13x_{i-2}$ ways total to color the first $i-2$ cells.
    Thus this case yields $x_i = 6x_{i-1} + 8x_{i-2}$, which is also what we want.
Now observe that both conditions are symmetric, so we get the same recursion for $\{y_i\}$. As $x_1 = y_1 = 14$, $x_n$ and $y_n$ both count the number of ways to color the entire line, which means that they are equal.

Remark: The problem works (in the $\{x_i\}$ statement) in general as long as the recursion reads \[x_n \in \{2a x_{n-1} + (k-2a)x_{n-2}, 2b x_{n-1} + (k-2b)x_{n-2}\}.\]In this case, the two types of walls permit colors with distance within $a-1$ and within $b-1$, respectively.

Remark: Although this solution is slick, I think it's almost impossible to find. I was told to make the $x_n = 2^n a_n$ substitution, and even after embarking on the combinatorial construction route, finding the actual construction took me more than four hours. In particular, the idea of making a ``colorless" color and making the other $13$ colors symmetric, which is the heart of the construction, is not natural at all to come by. In hindsight, the strong induction approach seems much easier, but my brain got hooked on ``hey this looks like a combinatorial recursion" almost immediately, so oh well.
This post has been edited 2 times. Last edited by HamstPan38825, Jan 4, 2025, 11:17 PM
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
#26
Y by
pretty fun problem, found #10's solution after some work. really liked it, there's sort of this one major hurdle you have to get over but then you get to commit and finish it up which is cool (basically the idea of given a string $w$ and 2 starting terms $a_0$ and $a_1$, which you have to do because in a sense you lack information when you add another term to the end of the $\varepsilon$ list when you try to induct)
Okay so first there are some other ways to try this problem out (like direct expansion, or ideas with $2+\varepsilon_i$ and $3-2\varepsilon_i$ but they are sort of annoying to try out.

So we turn to induction. The issue with induction, though, is this: let's say we have two sequences like those mentioned in the problem (the second, reversed sequence here is the one corresponding to sequence $b$) $\{\varepsilon_1,\dots,\varepsilon_{n-1}\}$ and $\{\varepsilon_{n-1},\dots,\varepsilon_1\}$. Then if we add $\varepsilon_n$ to the end of the first sequence, it is actually added to the start of the second sequence. In essence, soon we start to realize that the choice of $a_0=1$ and $a_1=7$ is somewhat arbitrary, so we can just more generally write that a sequence $\{\varepsilon_1,\dots,\varepsilon_{n-1}\}$ corresponds to a pair $(c_1,c_2)$ where $a_n=c_1a_0+c_2a_1$.

This is also useful for the transition $\{\varepsilon_1,\dots,\varepsilon_{n-1}\}\cup \{\varepsilon_n\}$ as well in some sense, which should become clearer later in this solution so that's nice.
Alright here we go. Consider the following:
\[\{\varepsilon_1,\dots,\varepsilon_{n-1}\}:= (c_1,c_2)\]\[\{\varepsilon_{n-1},\dots,\varepsilon_1\}:= (d_1,d_2)\]and by inductive hypothesis assume that $c_1+7c_2=d_1+7d_2$.

Now when we induct we have to split into cases.
Case 1: $\varepsilon_n=0$. In that case from $\{\varepsilon_n,\dots,\varepsilon_1\}$ we actually start with $(7,23)$ (essentially shift one term forward, since $a_2=23$ and we get $7d_1+23d_2$ as the desired common value.

It remains to determine what $\{\varepsilon_1,\dots,\varepsilon_n\}$ leads to. To do this, write
\[\{\varepsilon_1,\dots,\varepsilon_{n-2}\}:=(C_1,C_2)\]\[\{\varepsilon_{n-2},\dots,\varepsilon_1\}:=(D_1,D_2)\]so we'd like to show that
\[2(C_1+7C_2)+3(c_1+7c_2)=7d_1+23d_2\implies C_1+7C_2=2d_1+d_2.\]More brainstorming now (I put it already above but it's useful right now) by inductive hypothesis we want
\[C_1+7C_2=D_1+7D_2=2d_1+d_2.\]Now consider a sequence $(2,1)$ which is extended with the rules outlined in the problem for sequence $a$ with set $\{\varepsilon_{n-1},\dots,\varepsilon_1\}$. As the third term is $7$ always (from $2\cdot 2+3=3\cdot 2+1$, which I think is kind of the reason this problem ticks), the final term corresponds to both $D_1+7D_2$ and $2d_1+d_2$, so they are equal.
Case 2: $\varepsilon_n=1$. For the most part, it is the same. The desired common value turns out to be $7d_1+10d_2$, and we get
\[3(C_1+7C_2)+(c_1+7c_2)=7d_1+10d_2\implies C_1+7C_2=2d_1+d_2\]and the rest is the same. good stuff man ! learned a decent amount about brainstorming from this i guess and also some about bashing as it is quite bashy and a little about backtracking too i guess as i failed on the direct bash approach where you just write in terms of multivar poly in $\varepsilon_i$ which sucks lmao so cool beans gonna keep going i guess or look at egmo/mont and try to lock in or smt here goes guh guh guh yoink $\blacksquare$
Z K Y
The post below has been deleted. Click to close.
This post has been deleted. Click here to see post.
zuat.e
41 posts
#27
Y by
We prove by induction on $n$ with base case $n=3$, which is easily basheable.
Suppose it has always been true until $k=n$ and write $b_i=x_ib_1+y_ib_0$ for all $i$
Claim: $a_{n-1}=x_n+2y_n$
Proof: We previously had $a_{n-1}=b_{n-1}$ (when $k=n-1$), but including $\epsilon_{n-1}$ doesn't alter $a_i$ and if $b_n=m_nb_2+l_nb_1$, then $b_{n-1}=m_nb_1+l_nb_0$ (when $k=n-1$), so:
(i) $\epsilon_{n-1}=0$ yields $x_nb_1+y_nb_0=b_n=m_nb_2+l_nb_1=(3m_n+l_n)b_1+2m_n$, hence \[\left\{\begin{array}{ll}
             x_n=3m_n+l_n  \\
             y_n=2m_n
            \end{array}\right.\]from where $a_{n-1}=7m_n+l_n=x_n+2y_n$.
(ii) $\epsilon_{n-1}=1$ yields $x_nb_1+y_nb_0=b_n=m_nb_2+l_nb_1=(m_n+l_n)b_1+3m_n$, hence \[\left\{\begin{array}{ll}
             x_n=m_n+l_n  \\
             y_n=3m_n
            \end{array}\right.\]from where $a_{n-1}=7m_n+l_n=x_n+2y_n$.

It is now easy to finish: add $\epsilon_{n}$, therefore:
(i) $\epsilon_{n}=0$ forces $a_{n+1}=3a_n+2a_{n-1}=3b_n+2(x_n+2y_n)=23x_n+7y_n$ and $b_{n+1}=x_nb_2+y_nb_1=23x_n+7y_n=a_{n+1}$
(ii) $\epsilon_{n}=1$ forces $a_{n+1}=a_n+3a_{n-1}=b_n+3(x_n+2y_n)=10x_n+7y_n$ and $b_{n+1}=x_nb_2+y_nb_1=10x_n+7y_n=a_{n+1}$
Z K Y
N Quick Reply
G
H
=
a