Difference between revisions of "2021 AIME II Problems/Problem 15"

(Added in Sol 2.)
Line 8: Line 8:
 
\end{cases}</cmath>for positive integers <math>n</math>. Find the least positive integer <math>n</math> such that <math>\tfrac{f(n)}{g(n)} = \tfrac{4}{7}</math>.
 
\end{cases}</cmath>for positive integers <math>n</math>. Find the least positive integer <math>n</math> such that <math>\tfrac{f(n)}{g(n)} = \tfrac{4}{7}</math>.
  
==Solution==
+
==Solution 1==
  
 
Consider what happens when we try to calculate <math>f(n)</math> where n is not a square. If <math>k^2<n<(k+1)^2</math> for (positive) integer k, recursively calculating the value of the function gives us <math>f(n)=(k+1)^2-n+f((k+1)^2)=k^2+3k+2-n</math>. Note that this formula also returns the correct value when <math>n=(k+1)^2</math>, but not when <math>n=k^2</math>. Thus <math>f(n)=k^2+3k+2-n</math> for <math>k^2<n \leq (k+1)^2</math>.
 
Consider what happens when we try to calculate <math>f(n)</math> where n is not a square. If <math>k^2<n<(k+1)^2</math> for (positive) integer k, recursively calculating the value of the function gives us <math>f(n)=(k+1)^2-n+f((k+1)^2)=k^2+3k+2-n</math>. Note that this formula also returns the correct value when <math>n=(k+1)^2</math>, but not when <math>n=k^2</math>. Thus <math>f(n)=k^2+3k+2-n</math> for <math>k^2<n \leq (k+1)^2</math>.
Line 16: Line 16:
 
Write <math>7f(n)=4g(n)</math>, which simplifies to <math>3k^2+k-10=3n</math>. Notice that we want the <math>LHS</math> expression to be divisible by 3; as a result, <math>k \equiv 1 \pmod{3}</math>. We also want n to be strictly greater than <math>k^2</math>, so <math>k-10>0, k>10</math>. The LHS expression is always even (why?), so to ensure that k and n share the same parity, k should be even. Then the least k that satisfies these requirements is <math>k=16</math>, giving <math>n=258</math>.
 
Write <math>7f(n)=4g(n)</math>, which simplifies to <math>3k^2+k-10=3n</math>. Notice that we want the <math>LHS</math> expression to be divisible by 3; as a result, <math>k \equiv 1 \pmod{3}</math>. We also want n to be strictly greater than <math>k^2</math>, so <math>k-10>0, k>10</math>. The LHS expression is always even (why?), so to ensure that k and n share the same parity, k should be even. Then the least k that satisfies these requirements is <math>k=16</math>, giving <math>n=258</math>.
  
Indeed - if we check our answer, it works. Therefore, the answer is <math>\boxed{258}</math>
+
Indeed - if we check our answer, it works. Therefore, the answer is <math>\boxed{258}</math>.
  
 
-Ross Gao
 
-Ross Gao
 +
 +
==Solution 2 (More Variables)==
 +
We restrict <math>n</math> in which <math>k^2<n\leq(k+1)^2</math> for some positive integer <math>k,</math> or <cmath>n=(k+1)^2-p\hspace{15mm}(1)</cmath> for some nonnegative integer <math>p.</math> By observations, we get
 +
<cmath>\begin{align*}
 +
f\left((k+1)^2\right)&=k+1, \\
 +
f\left((k+1)^2-1\right)&=k+2, \\
 +
f\left((k+1)^2-2\right)&=k+3, \\
 +
&\cdots \\
 +
f\bigl(\phantom{ }\underbrace{(k+1)^2-p}_{n}\phantom{ }\bigr)&=k+p+1. \\
 +
\end{align*}</cmath>
 +
 +
~MRENTHUSIASM
  
 
==Video Solution==
 
==Video Solution==

Revision as of 02:56, 12 May 2021

Problem

Let $f(n)$ and $g(n)$ be functions satisfying \[f(n) = \begin{cases}\sqrt{n} & \text{ if } \sqrt{n} \text{ is an integer}\\ 1 + f(n+1) & \text{ otherwise} \end{cases}\]and \[g(n) = \begin{cases}\sqrt{n} & \text{ if } \sqrt{n} \text{ is an integer}\\ 2 + g(n+2) & \text{ otherwise} \end{cases}\]for positive integers $n$. Find the least positive integer $n$ such that $\tfrac{f(n)}{g(n)} = \tfrac{4}{7}$.

Solution 1

Consider what happens when we try to calculate $f(n)$ where n is not a square. If $k^2<n<(k+1)^2$ for (positive) integer k, recursively calculating the value of the function gives us $f(n)=(k+1)^2-n+f((k+1)^2)=k^2+3k+2-n$. Note that this formula also returns the correct value when $n=(k+1)^2$, but not when $n=k^2$. Thus $f(n)=k^2+3k+2-n$ for $k^2<n \leq (k+1)^2$.

If $2 \mid (k+1)^2-n$, $g(n)$ returns the same value as $f(n)$. This is because the recursion once again stops at $(k+1)^2$. We seek a case in which $f(n)<g(n)$, so obviously this is not what we want. We want $(k+1)^2,n$ to have a different parity, or $n, k$ have the same parity. When this is the case, $g(n)$ instead returns $(k+2)^2-n+g((k+2)^2)=k^2+5k+6-n$.

Write $7f(n)=4g(n)$, which simplifies to $3k^2+k-10=3n$. Notice that we want the $LHS$ expression to be divisible by 3; as a result, $k \equiv 1 \pmod{3}$. We also want n to be strictly greater than $k^2$, so $k-10>0, k>10$. The LHS expression is always even (why?), so to ensure that k and n share the same parity, k should be even. Then the least k that satisfies these requirements is $k=16$, giving $n=258$.

Indeed - if we check our answer, it works. Therefore, the answer is $\boxed{258}$.

-Ross Gao

Solution 2 (More Variables)

We restrict $n$ in which $k^2<n\leq(k+1)^2$ for some positive integer $k,$ or \[n=(k+1)^2-p\hspace{15mm}(1)\] for some nonnegative integer $p.$ By observations, we get \begin{align*} f\left((k+1)^2\right)&=k+1, \\ f\left((k+1)^2-1\right)&=k+2, \\ f\left((k+1)^2-2\right)&=k+3, \\ &\cdots \\ f\bigl(\phantom{ }\underbrace{(k+1)^2-p}_{n}\phantom{ }\bigr)&=k+p+1. \\ \end{align*}

~MRENTHUSIASM

Video Solution

https://youtu.be/tRVe2bKwIY8

See also

2021 AIME II (ProblemsAnswer KeyResources)
Preceded by
Problem 14
Followed by
Last Question
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
All AIME Problems and Solutions

The problems on this page are copyrighted by the Mathematical Association of America's American Mathematics Competitions. AMC logo.png