Found problems: 14842
2008 China Northern MO, 7
Given an equilateral triangle lattice composed of $\frac{n(n+1)}{2}$ points (as shown in the figure), record the number of equilateral triangles with three points in the lattice as vertices as $f(n)$. Find an expression for $f(n)$.
[img]https://cdn.artofproblemsolving.com/attachments/7/f/1de27231e8ef9c1c6a3dfd590a7c71adc508d6.png[/img]
1994 Miklós Schweitzer, 7
Prove that there exist $0 < \alpha< \beta<1$ numbers have the following properties.
(i) for any sufficiently large n, n points can be specified in $\Bbb R^3$ , so that each point is equidistant from at least $n^\alpha$ other points.
(ii) the above statement is no longer true with $n^\beta$ instead of $n^\alpha$
2024 Indonesia Regional, 2
Given an $n \times n$ board which is divided into $n^2$ squares of size $1 \times 1$, all of which are white. Then, Aqua selects several squares from this board and colors them black. Ruby then places exactly one $1\times 2$ domino on the board, so that the domino covers exactly two squares on the board. Ruby can rotate the domino into a $2\times 1$ domino.
After Aqua colors, it turns out there are exactly $2024$ ways for Ruby to place a domino on the board so that it covers exactly $1$ black square and $1$ white square.
Determine the smallest possible value of $n$ so that Aqua and Ruby can do this.
[i]Proposed by Muhammad Afifurrahman, Indonesia [/i]
MMPC Part II 1996 - 2019, 2007
[b]p1.[/b] Let $A$ be the point $(-1, 0)$, $B$ be the point $(0, 1)$ and $C$ be the point $(1, 0)$ on the $xy$-plane. Assume that $P(x, y)$ is a point on the $xy$-plane that satisfies the following condition $$d_1 \cdot d_2 = (d_3)^2,$$
where $d_1$ is the distance from $P$ to the line $AB$, $d_2$ is the distance from $P$ to the line $BC$, and $d_3$ is the distance from $P$ to the line $AC$. Find the equation(s) that must be satisfied by the point $P(x, y)$.
[b]p2.[/b] On Day $1$, Peter sends an email to a female friend and a male friend with the following instructions:
$\bullet$ If you’re a male, send this email to $2$ female friends tomorrow, including the instructions.
$\bullet$ If you’re a female, send this email to $1$ male friend tomorrow, including the instructions.
Assuming that everyone checks their email daily and follows the instructions, how many emails will be sent from Day $1$ to Day $365$ (inclusive)?
[b]p3.[/b] For every rational number $\frac{a}{b}$ in the interval $(0, 1]$, consider the interval of length $\frac{1}{2b^2}$ with $\frac{a}{b}$ as the center, that is, the interval $\left( \frac{a}{b}- \frac{1}{2b^2}, \frac{a}{b}+\frac{1}{2b^2}\right)$ . Show that $\frac{\sqrt2}{2}$ is not contained in any of these intervals.
[b]p4.[/b] Let $a$ and $b$ be real numbers such that $0 < b < a < 1$ with the property that
$$\log_a x + \log_b x = 4 \log_{ab} x - \left(\log_b (ab^{-1} - 1)\right)\left(\log_a (ab^{-1} - 1) + 2 log_a ab^{-1} \right)$$
for some positive real number $x \ne 1$. Find the value of $\frac{a}{b}$.
[b]p5.[/b] Find the largest positive constant $\lambda$ such that $$\lambda a^2 b^2 (a - b)^2 \le (a^2 - ab + b^2)^3$$ is true for all real numbers $a$ and $b$.
PS. You should use hide for answers. Collected [url=https://artofproblemsolving.com/community/c5h2760506p24143309]here[/url].
2021/2022 Tournament of Towns, P6
The king assembled 300 wizards and gave them the following challenge. For this challenge, 25 colors can be used, and they are known to the wizards. Each of the wizards receives a hat of one of those 25 colors. If for each color the number of used hats would be written down then all these number would be different, and the wizards know this. Each wizard sees what hat was given to each other wizard but does not see his own hat. Simultaneously each wizard reports the color of his own hat. Is it possible for the wizards to coordinate their actions beforehand so that at least 150 of them would report correctly?
2025 Belarusian National Olympiad, 9.8
In some galaxy there are $1000000$ planets and on each of them there are at least $101$ portals. Each portal allows to teleport between some two planets, no two planets are connected by more than one portal. It is known that starting from any planet using portals you can get to any other planet, while it is impossible to return to that planet using once at most 5 different portals.
Prove that starting from any planet you can get to any other planet within a year, using at most one portal daily (a year consists of 365 days).
[i]M. Zorka[/i]
2021 Israel Olympic Revenge, 2
In a foreign island $5781$ sheep are sacrificed every year for the two deities of the island, Alice and Bob. Every deity wants as many sheep as he can to be sacrificed for him, and not for the other deity. Initially all $5781$ sheep are arranged around a circle with equal distances. At the first step, Alice puts one magic stone between several pairs of neighboring sheep, so that the total number of magic stones is odd. After that, Bob sacrifices one of the sheep for himself and replaces it by a food bucket. At the third step, Alice chooses a pair of neighboring sheep (not including the two which are separated by the bucket) and puts a border between them (the border may be at the same place as a magic stone). After that, all remaining sheep walk through an arc of the circle to the food bucket without crossing the border (so that there is only one possible route). Every sheep which walks on an odd number of magic stones is sacrificed for Alice, and every other sheep is for Bob. What is the maximal number of sheep which Alice can sacrifice for herself in a certain year, regardless of Bob's action?
2015 Junior Balkan Team Selection Tests - Romania, 4
We have $n$ integers $a_1, a_2,. . . , a_n$, not necessarily distinct, with sum $2S.$ An integer $k$ is called [i]separator[/i] if $k$ of the numbers can be chosen with sum equal to $S.$ What is the maximum possible number of separators?
1966 IMO Longlists, 51
Consider $n$ students with numbers $1, 2, \ldots, n$ standing in the order $1, 2, \ldots, n.$ Upon a command, any of the students either remains on his place or switches his place with another student. (Actually, if student $A$ switches his place with student $B,$ then $B$ cannot switch his place with any other student $C$ any more until the next command comes.)
Is it possible to arrange the students in the order $n,1, 2, \ldots, n-1$ after two commands ?
2025 India STEMS Category A, 1
Alice and Bob play a game. Initially, they write the pair $(1012,1012)$ on the board. They alternate their turns with Alice going first. In each turn the player can turn the pair $(a,b)$ to either $(a-2, b+1), (a+1, b-2)$ or $(a-1, b)$ as long as the resulting pair has only nonnegative values. The game terminates, when there is no legal move possible. Alice wins if the game terminates at $(0,0)$ and Bob wins if the game terminates at $(0,1)$. Determine who has the winning strategy?
[i]Proposed by Shashank Ingalagavi and Krutarth Shah[/i]
2010 All-Russian Olympiad Regional Round, 10.1
Nine skiers left the start line in turn and covered the distance, each at their own constant speed. Could it turn out that each skier participated in exactly four overtakes? (In each overtaking, exactly two skiers participate - the one
who is overtaking, and the one who is being overtaken.)
2023 Costa Rica - Final Round, 3.4
A teacher wants her $N$ students to know each other, so she creates various clubs of three people, so that each student can participate in several clubs. The clubs are formed in such a way that if $A$ and $B$ are two people, then there is a single club such that $A$ and $B$ are two of its three members.
[b](1)[/b] Show that there is no way for the teacher to form the clubs if $N = 11$.
[b](2)[/b] Show that the teacher can do it if $N = 9$.
1993 Tournament Of Towns, (376) 4
Positive integers are written on the blackboard one after another. The next integer $a_{n+1}$ (to be written after $a_1$,$a_2$,$...$,$a_n$) is an arbitrary integer not representable as a sum of several previous integers taken one or more times (i.e. $a_{n+1}$ is not of the form $k_1 *a_i + k_2 *a_2 + ... + k_n *a_n$ where$ k_1$, $k_2$,$..$, $k_n$ are non-negative integers). Prove that the process of writing cannot be infinite.
(A Belov)
2014 Bosnia And Herzegovina - Regional Olympiad, 4
At the beginning of school year in one of the first grade classes:
$i)$ every student had exatly $20$ acquaintances
$ii)$ every two students knowing each other had exactly $13$ mutual acquaintances
$iii)$ every two students not knowing each other had exactly $12$ mutual acquaintances
Find number of students in this class
2006 Germany Team Selection Test, 3
Suppose that $ a_1$, $ a_2$, $ \ldots$, $ a_n$ are integers such that $ n\mid a_1 \plus{} a_2 \plus{} \ldots \plus{} a_n$.
Prove that there exist two permutations $ \left(b_1,b_2,\ldots,b_n\right)$ and $ \left(c_1,c_2,\ldots,c_n\right)$ of $ \left(1,2,\ldots,n\right)$ such that for each integer $ i$ with $ 1\leq i\leq n$, we have
\[ n\mid a_i \minus{} b_i \minus{} c_i
\]
[i]Proposed by Ricky Liu & Zuming Feng, USA[/i]
2016 Singapore MO Open, 5
A total of $731$ objects are put into $n$ nonempty bags where $n$ is a positive integer. These bags can be distributed into $17$ red boxes and also into $43$ blue boxes so that each red and each blue box contain $43$ and $17$ objects, respectively. Find the minimum value of $n$.
2021 Peru MO (ONEM), 2
The numbers $1$ to $25$ will be written in a table $5 \times 5$. First, Ana chooses $k$ of these numbers($1$ to $25$), and write in some cells. Then, Enrique writes the remaining numbers with the following goal: The product of the numbers in some column/row is a perfect square.
[b]a)[/b] Prove that if $k=5$, Ana can [b]avoid[/b] Enrique to reach his goal.
[b]b)[/b] Prove that if $k=4$, Enrique can reach his goal.
MBMT Guts Rounds, 2023
[hide=B stands for Bernoulli, G stands for Germain]they had two problem sets under those two names[/hide]
[u]Set 4[/u]
[b]B16 / G11[/b] Let triangle $ABC$ be an equilateral triangle with side length $6$. If point $D$ is on $AB$ and point $E$ is on $BC$, find the minimum possible value of $AD + DE + CE$.
[b]B17 / G12[/b] Find the smallest positive integer $n$ with at least seven divisors.
[b]B18 / G13[/b] Square $A$ is inscribed in a circle. The circle is inscribed in Square $B$. If the circle has a radius of $10$, what is the ratio between a side length of Square $A$ and a side length of Square $B$?
[b]B19 / G14[/b] Billy Bob has $5$ distinguishable books that he wants to place on a shelf. How many ways can he order them if he does not want his two math books to be next to each other?
[b]B20 / G15[/b] Six people make statements as follows:
Person $1$ says “At least one of us is lying.”
Person $2$ says “At least two of us are lying.”
Person $3$ says “At least three of us are lying.”
Person $4$ says “At least four of us are lying.”
Person $5$ says “At least five of us are lying.”
Person $6$ says “At least six of us are lying.”
How many are lying?
[u]Set 5[/u]
[b]B21 / G16[/b] If $x$ and $y$ are between $0$ and $1$, find the ordered pair $(x, y)$ which maximizes $(xy)^2(x^2 - y^2)$.
[b]B22 / G17[/b] If I take all my money and divide it into $12$ piles, I have $10$ dollars left. If I take all my money and divide it into $13$ piles, I have $11$ dollars left. If I take all my money and divide it into $14$ piles, I have $12$ dollars left. What’s the least amount of money I could have?
[b]B23 / G18[/b] A quadratic equation has two distinct prime number solutions and its coefficients are integers that sum to a prime number. Find the sum of the solutions to this equation.
[b]B24 / G20[/b] A regular $12$-sided polygon is inscribed in a circle. Gaz then chooses $3$ vertices of the polygon at random and connects them to form a triangle. What is the probability that this triangle is right?
[b]B25 / G22[/b] A book has at most $7$ chapters, and each chapter is either $3$ pages long or has a length that is a power of $2$ (including $1$). What is the least positive integer $n$ for which the book cannot have $n$ pages?
[u]Set 6[/u]
[b]B26 / G26[/b] What percent of the problems on the individual, team, and guts rounds for both divisions have integer answers?
[b]B27 / G27[/b] Estimate $12345^{\frac{1}{123}}$.
[b]B28 / G28[/b] Let $O$ be the center of a circle $\omega$ with radius $3$. Let $A, B, C$ be randomly selected on $\omega$. Let $M$, $N$ be the midpoints of sides $BC$, $CA$, and let $AM$, $BN$ intersect at $G$. What is the probability that $OG \le 1$?
[b]B29 / G29[/b] Let $r(a, b)$ be the remainder when $a$ is divided by $b$. What is $\sum^{100}_{i=1} r(2^i , i)$?
[b]B30 / G30[/b] Bongo flips $2023$ coins. Call a run of heads a sequence of consecutive heads. Say a run is maximal if it isn’t contained in another run of heads. For example, if he gets $HHHT T HT T HHHHT H$, he’d have maximal runs of length $3, 1, 4, 1$. Bongo squares the lengths of all his maximal runs and adds them to get a number $M$. What is the expected value of $M$?
- - - - - -
[b]G19[/b] Let $ABCD$ be a square of side length $2$. Let $M$ be the midpoint of $AB$ and $N$ be the midpoint of $AD$. Let the intersection of $BN$ and $CM$ be $E$. Find the area of quadrilateral $NECD$.
[b]G21[/b] Quadrilateral $ABCD$ has $\angle A = \angle D = 60^o$. If $AB = 8$, $CD = 10$, and $BC = 3$, what is length $AD$?
[b]G23[/b] $\vartriangle ABC$ is an equilateral triangle of side length $x$. Three unit circles $\omega_A$, $\omega_B$, and $\omega_C$ lie in the plane such that $\omega_A$ passes through $A$ while $\omega_B$ and $\omega_C$ are centered at $B$ and $C$, respectively. Given that $\omega_A$ is externally tangent to both $\omega_B$ and $\omega_C$, and the center of $\omega_A$ is between point $A$ and line $\overline{BC}$, find $x$.
[b]G24[/b] For some integers $n$, the quadratic function $f(x) = x^2 - (6n - 6)x - (n^2 - 12n + 12)$ has two distinct positive integer roots, exactly one out of which is a prime and at least one of which is in the form $2^k$ for some nonnegative integer $k$. What is the sum of all possible values of $n$?
[b]G25[/b] In a triangle, let the altitudes concur at $H$. Given that $AH = 30$, $BH = 14$, and the circumradius is $25$, calculate $CH$
PS. You should use hide for answers. Rest problems have been posted [url=https://artofproblemsolving.com/community/c3h3132167p28376626]here[/url]. Collected [url=https://artofproblemsolving.com/community/c5h2760506p24143309]here[/url].
MBMT Team Rounds, 2023
[hide=B stands for Bernoulli, G stands for Germain]they had two problem sets under those two names[/hide]
[b]B1[/b] What is the sum of the first $5$ positive integers?
[b]B2[/b] Bread picks a number $n$. He finds out that if he multiplies $n$ by $23$ and then subtracts $20$, he gets $46279$. What is $n$?
[b]B3[/b] A [i]Harshad [/i] Number is a number that is divisible by the sum of its digits. For example, $27$ is divisible by $2 + 7 = 9$. Only one two-digit multiple of $9$ is not a [i]Harshad [/i] Number. What is this number?
[b]B4 / G1[/b] There are $5$ red balls and 3 blue balls in a bag. Alice randomly picks a ball out of the bag and then puts it back in the bag. Bob then randomly picks a ball out of the bag. What is the probability that Alice gets a red ball and Bob gets a blue ball, assuming each ball is equally likely to be chosen?
[b]B5[/b] Let $a$ be a $1$-digit positive integer and $b$ be a $3$-digit positive integer. If the product of $a$ and $b$ is a$ 4$-digit integer, what is the minimum possible value of the sum of $a$ and $b$?
[b]B6 / G2[/b] A circle has radius $6$. A smaller circle with the same center has radius $5$. What is the probability that a dart randomly placed inside the outer circle is outside the inner circle?
[b]B7[/b] Call a two-digit integer “sus” if its digits sum to $10$. How many two-digit primes are sus?
[b]B8 / G3[/b] Alex and Jeff are playing against Max and Alan in a game of tractor with $2$ standard decks of $52$ cards. They take turns taking (and keeping) cards from the combined decks. At the end of the game, the $5$s are worth $5$ points, the $10$s are worth $10$ points, and the kings are worth 10 points. Given that a team needs $50$ percent more points than the other to win, what is the minimal score Alan and Max need to win?
[b]B9 / G4[/b] Bob has a sandwich in the shape of a rectangular prism. It has side lengths $10$, $5$, and $5$. He cuts the sandwich along the two diagonals of a face, resulting in four pieces. What is the volume of the largest piece?
[b]B10 / G5[/b] Aven makes a rectangular fence of area $96$ with side lengths $x$ and $y$. John makesva larger rectangular fence of area 186 with side lengths $x + 3$ and $y + 3$. What is the value of $x + y$?
[b]B11 / G6[/b] A number is prime if it is only divisible by itself and $1$. What is the largest prime number $n$ smaller than $1000$ such that $n + 2$ and $n - 2$ are also prime?
Note: $1$ is not prime.
[b]B12 / G7[/b] Sally has $3$ red socks, $1$ green sock, $2$ blue socks, and $4$ purple socks. What is the probability she will choose a pair of matching socks when only choosing $2$ socks without replacement?
[b]B13 / G8[/b] A triangle with vertices at $(0, 0)$,$ (3, 0)$, $(0, 6)$ is filled with as many $1 \times 1$ lattice squares as possible. How much of the triangle’s area is not filled in by the squares?
[b]B14 / G10[/b] A series of concentric circles $w_1, w_2, w_3, ...$ satisfy that the radius of $w_1 = 1$ and the radius of $w_n =\frac34$ times the radius of $w_{n-1}$. The regions enclosed in $w_{2n-1}$ but not in $w_{2n}$ are shaded for all integers $n > 0$. What is the total area of the shaded regions?
[b]B15 / G12[/b] $10$ cards labeled 1 through $10$ lie on a table. Kevin randomly takes $3$ cards and Patrick randomly takes 2 of the remaining $7$ cards. What is the probability that Kevin’s largest card is smaller than Patrick’s largest card, and that Kevin’s second-largest card is smaller than Patrick’s smallest card?
[b]G9[/b] Let $A$ and $B$ be digits. If $125A^2 + B161^2 = 11566946$. What is $A + B$?
[b]G11[/b] How many ordered pairs of integers $(x, y)$ satisfy $y^2 - xy + x = 0$?
[b]G13[/b] $N$ consecutive integers add to $27$. How many possible values are there for $N$?
[b]G14[/b] A circle with center O and radius $7$ is tangent to a pair of parallel lines $\ell_1$ and $\ell_2$. Let a third line tangent to circle $O$ intersect $\ell_1$ and $\ell_2$ at points $A$ and $B$. If $AB = 18$, find $OA + OB$.
[b]G15[/b] Let $$ M =\prod ^{42}_{i=0}(i^2 - 5).$$ Given that $43$ doesn’t divide $M$, what is the remainder when M is divided by $43$?
PS. You should use hide for answers. Collected [url=https://artofproblemsolving.com/community/c5h2760506p24143309]here[/url].
2002 HKIMO Preliminary Selection Contest, 6
Points $A$ and $B$ lie on a plane. A straight line passing through $A$ will divide the plane into 2 regions. A further straight line through $B$ will altogether divide the plane into 4 regions, and so on. If 1002 and 1000 straight lines are drawn passing through $A$ and $B$ respectively, what is the maximum number of regions formed?
2023 CMIMC Combo/CS, 5
A BWM tree is defined recursively:
[list]
[*] An empty tree is a BWM tree of height 0 and size 0.
[*] A nonempty BWM tree consists of a root node and three subtrees, each of which is itself a (possibly empty) BWM tree. The height of the tallest of the subtrees must be at most 2 more than the height of the shortest.
[*] The height of a nonempty BWM tree is one more than the height of its tallest subtree, and the size of a nonempty BWM tree is one more than the sum of the sizes of the subtrees.
[/list]
What is the minimum size of a height-10 BWM tree?
[i]Proposed by Jacob Weiner[/i]
2022 Kosovo Team Selection Test, 4
On a board, Ana writes $a$ different integers, while Ben writes $b$ different integers. Then, Ana adds each of her numbers with with each of Ben’s numbers and she obtains $c$ different integers. On the other hand, Ben substracts each of his numbers from each of Ana’s numbers and he gets $d$ different integers.
For each integer $n$ , let $f(n)$ be the number of ways that $n$ may be written as sum of one number of Ana and one number of Ben.
[i]a)[/i] Show that there exist an integer $n$ such that,
$$f(n)\geq\frac{ab}{c}.$$
[i]b)[/i] Does there exist an integer $n$ such that,
$$f(n)\geq\frac{ab}{d}?$$
[i]Proposed by Besfort Shala, Kosovo[/i]
2005 Cono Sur Olympiad, 3
On the cartesian plane we draw circunferences of radii 1/20 centred in each lattice point. Show that any circunference of radii 100 in the cartesian plane intersect at least one of the small circunferences.
2023 Abelkonkurransen Finale, 2a
The sides of an equilateral triangle with sides of length $n$ have been divided into equal parts, each of length $1$, and lines have been drawn through the points of division parallel to the sides of the triangle, thus dividing the large triangle into many small triangles. Nils has a pile of rhombic tiles, each of side $1$ and angles $60^\circ$ and $120^\circ$, and wants to tile most of the triangle using these, so that each tile covers two small triangles with no overlap. In the picture, three tiles are placed somewhat arbitrarily as an illustration. How many tiles can Nils fit inside the triangle?
[asy]
/* original code by fedja: https://artofproblemsolving.com/community/c68h207503p1220868
modified by Klaus-Anton: https://artofproblemsolving.com/community/c2083h3267391_draw_me_a_grid_of_regular_triangles
*/
size(5cm);
int n=6;
pair A=(1,0), B=dir(60);
path P=A--B--(0,0)--cycle;
path Pp=A--shift(A)*B--B--cycle;
/*
label("$A$",A,S);
label("$B$",B,dir(120));
label("$(0,0)$",(0,0),dir(210));
fill(shift(2*A-1+2*B-1)*P,yellow+white);
fill(shift(2*A-1+2*B-0)*P,yellow+white);
fill(shift(2*A-1+2*B+1)*P,yellow+white);
fill(shift(2*A-1+2*B+2)*P,yellow+white);
fill(shift(1*A-1+1*B)*P,blue+white);
fill(shift(2*A-1+1*B)*P,blue+white);
fill(shift(3*A-1+1*B)*P,blue+white);
fill(shift(4*A-1+1*B)*P,blue+white);
fill(shift(5*A-1+1*B)*P,blue+white);
fill(shift(0*A+0*B)*P,green+white);
fill(shift(0*A+1+0*B)*P,green+white);
fill(shift(0*A+2+0*B)*P,green+white);
fill(shift(0*A+3+0*B)*P,green+white);
fill(shift(0*A+4+0*B)*P,green+white);
fill(shift(0*A+5+0*B)*P,green+white);
fill(shift(2*A-1+3*B-1)*P,magenta+white);
fill(shift(3*A-1+3*B-1)*P,magenta+white);
fill(shift(4*A-1+3*B-1)*P,magenta+white);
fill(shift(5*A+5*B-5)*P,heavyred+white);
fill(shift(4*A+4*B-4)*P,palered+white);
fill(shift(4*A+4*B-3)*P,palered+white);
fill(shift(0*A+0*B)*Pp,gray);
fill(shift(0*A+1+0*B)*Pp,gray);
fill(shift(0*A+2+0*B)*Pp,gray);
fill(shift(0*A+3+0*B)*Pp,gray);
fill(shift(0*A+4+0*B)*Pp,gray);
fill(shift(1*A+1*B-1)*Pp,lightgray);
fill(shift(1*A+1*B-0)*Pp,lightgray);
fill(shift(1*A+1*B+1)*Pp,lightgray);
fill(shift(1*A+1*B+2)*Pp,lightgray);
fill(shift(2*A+2*B-2)*Pp,red);
fill(shift(2*A+2*B-1)*Pp,red);
fill(shift(2*A+2*B-0)*Pp,red);
fill(shift(3*A+3*B-2)*Pp,blue);
fill(shift(3*A+3*B-3)*Pp,blue);
fill(shift(4*A+4*B-4)*Pp,cyan);
fill(shift(0*A+1+0*B)*Pp,gray);
fill(shift(0*A+2+0*B)*Pp,gray);
fill(shift(0*A+3+0*B)*Pp,gray);
fill(shift(0*A+4+0*B)*Pp,gray);
*/
fill(Pp, rgb(244, 215, 158));
fill(shift(dir(60))*P, rgb(244, 215, 158));
fill(shift(1.5,(-sqrt(3)/2))*shift(2*dir(60))*Pp, rgb(244, 215, 158));
fill(shift(1.5,(-sqrt(3)/2))*shift(2*dir(60))*P, rgb(244, 215, 158));
fill(shift(-.5,(-sqrt(3)/2))*shift(4*dir(60))*Pp, rgb(244, 215, 158));
fill(shift(.5,(-sqrt(3)/2))*shift(4*dir(60))*P, rgb(244, 215, 158));
for(int i=0;i<n;++i){
for(int j;j<n-i;++j)
{draw(shift(i*A+j*B)*P);}}
shipout(bbox(2mm,Fill(white)));
[/asy]
2012 Federal Competition For Advanced Students, Part 1, 3
Consider a stripe of $n$ fieds, numbered from left to right with the integers $1$ to $n$ in ascending order. Each of the fields is colored with one of the colors $1$, $2$ or $3$. Even-numbered fields can be colored with any color. Odd-numbered fields are only allowed to be colored with the odd colors $1$ and $3$.
How many such colorings are there such that any two neighboring fields have different colors?