返回题库

AIME 2021 II · 第 15 题

AIME 2021 II — Problem 15

专题
Contest Math
难度
L4
来源
AIME

题目详情

Problem

Let f(n)f(n) and g(n)g(n) be functions satisfying

f(n)={n if n is an integer1+f(n+1) otherwisef(n) = \begin{cases}\sqrt{n} & \text{ if } \sqrt{n} \text{ is an integer}\\ 1 + f(n+1) & \text{ otherwise} \end{cases} and

g(n)={n if n is an integer2+g(n+2) otherwiseg(n) = \begin{cases}\sqrt{n} & \text{ if } \sqrt{n} \text{ is an integer}\\ 2 + g(n+2) & \text{ otherwise} \end{cases} for positive integers nn. Find the least positive integer nn such that f(n)g(n)=47\tfrac{f(n)}{g(n)} = \tfrac{4}{7}.

解析

Solution 1

Consider what happens when we try to calculate f(n)f(n) where n is not a square. If k2for(positive)integerk,recursivelycalculatingthevalueofthefunctiongivesusk^2 for (positive) integer k, recursively calculating the value of the function gives usf(n)=(k+1)^2-n+f((k+1)^2)=k^2+3k+2-n.Notethatthisformulaalsoreturnsthecorrectvaluewhen. Note that this formula also returns the correct value whenn=(k+1)^2,butnotwhen, but not whenn=k^2.Thus. Thusf(n)=k^2+3k+2-nforfork^2.

If 2(k+1)2n2 \mid (k+1)^2-n, g(n)g(n) returns the same value as f(n)f(n). This is because the recursion once again stops at (k+1)2(k+1)^2. We seek a case in which f(n),soobviouslythisisnotwhatwewant.Wewantf(n), so obviously this is not what we want. We want(k+1)^2,ntohaveadifferentparity,orto have a different parity, orn, khavethesameparity.Whenthisisthecase,have the same parity. When this is the case,g(n)insteadreturnsinstead returns(k+2)^2-n+g((k+2)^2)=k^2+5k+6-n$.

Write 7f(n)=4g(n)7f(n)=4g(n), which simplifies to 3k2+k10=3n3k^2+k-10=3n. Notice that we want the LHS expression to be divisible by 3; as a result, k1(mod3)k \equiv 1 \pmod{3}. We also want n to be strictly greater than k2k^2, so k10>0,k>10k-10>0, k>10. The LHS expression is always even (since 3k2+k103k^2+k-10 factors to k(3k+1)10k(3k+1)-10, and one of kk and 3k+13k+1 will be even), so to ensure that kk and nn share the same parity, kk should be even. Then the least kk that satisfies these requirements is k=16k=16, giving n=258n=258.

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

-Ross Gao

Solution 2 (Four Variables)

We consider f(n)f(n) and g(n)g(n) separately:

  • f(n)\boldsymbol{f(n)}

    We restrict nn in which k2forsomepositiveintegerk^2 for some positive integerk,$ or

n=(k+1)2p(1)n=(k+1)^2-p\hspace{40mm}(1) for some integer pp such that 0p<2k+1.0\leq p<2k+1. By recursion, we get

f((k+1)2)=k+1,f((k+1)21)=k+2,f((k+1)22)=k+3, f((k+1)2pn)=k+p+1.(2)\begin{aligned} 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, \\ & \ \vdots \\ f\bigl(\phantom{ }\underbrace{(k+1)^2-p}_{n}\phantom{ }\bigr)&=k+p+1. \hspace{19mm}(2) \\ \end{aligned}
  • g(n)\boldsymbol{g(n)}

    If nn and (k+1)2(k+1)^2 have the same parity, then we get g(n)=f(n)g(n)=f(n) by a similar process from g((k+1)2)=k+1.g\left((k+1)^2\right)=k+1. This contradicts the precondition f(n)g(n)=47.\frac{f(n)}{g(n)} = \frac{4}{7}. Therefore, nn and (k+1)2(k+1)^2 must have different parities, from which nn and (k+2)2(k+2)^2 must have the same parity.

    It follows that $k^2 or

n=(k+2)22q(3)n=(k+2)^2-2q\hspace{38.25mm}(3) for some integer qq such that $0 By recursion, we get

g((k+2)2)=k+2,g((k+2)22)=k+4,g((k+2)24)=k+6, g((k+2)22qn)=k+2q+2.(4)\begin{aligned} g\left((k+2)^2\right)&=k+2, \\ g\left((k+2)^2-2\right)&=k+4, \\ g\left((k+2)^2-4\right)&=k+6, \\ & \ \vdots \\ g\bigl(\phantom{ }\underbrace{(k+2)^2-2q}_{n}\phantom{ }\bigr)&=k+2q+2. \hspace{15.5mm}(4) \\ \end{aligned}
  • Answer

    By (2)(2) and (4),(4), we have

f(n)g(n)=k+p+1k+2q+2=47.(5)\frac{f(n)}{g(n)}=\frac{k+p+1}{k+2q+2}=\frac{4}{7}. \hspace{27mm}(5) From (1)(1) and (3),(3), equating the expressions for nn gives (k+1)2p=(k+2)22q.(k+1)^2-p=(k+2)^2-2q. Solving for kk produces

k=2qp32.(6)k=\frac{2q-p-3}{2}. \hspace{41.25mm}(6) We substitute (6)(6) into (5),(5), then simplify, cross-multiply, and rearrange:

2qp32+p+12qp32+2q+2=47p+2q1p+6q+1=477p+14q7=4p+24q+411p11=10q11(p1)=10q.(7)\begin{aligned} \frac{\tfrac{2q-p-3}{2}+p+1}{\tfrac{2q-p-3}{2}+2q+2}&=\frac{4}{7} \\ \frac{p+2q-1}{-p+6q+1}&=\frac{4}{7} \\ 7p+14q-7&=-4p+24q+4 \\ 11p-11&=10q \\ 11(p-1)&=10q. \hspace{29mm}(7) \end{aligned} Since gcd(11,10)=1,\gcd(11,10)=1, we know that p1p-1 must be divisible by 10,10, and qq must be divisible by 11.11.

Recall that the restrictions on (1)(1) and (2)(2) are 0p<2k+10\leq p<2k+1 and 0respectively.Substituting0 respectively. Substituting(6)intoeitherinequalitygivesinto either inequality givesp+1 Combining all these results produces 

0<p+1<q<2k+2.(8)0<p+1<q<2k+2. \hspace{28mm}(8) To minimize nn in either (1)(1) or (3),(3), we minimize k,k, so we minimize pp and qq in (8).(8). From (6)(6) and (7),(7), we construct the following table:

AIME diagram

Finally, we have (p,q,k)=(31,33,16).(p,q,k)=(31,33,16). Substituting this result into either (1)(1) or (3)(3) generates n=258.n=\boxed{258}.

  • Remark

    We can verify that

f(258)g(258)=131+f(258+131)233+g(258+233)=31+f(289)1766+g(324)18=4884=47.\frac{f(258)}{g(258)}=\frac{1\cdot31+f(258+1\cdot31)}{2\cdot33+g(258+2\cdot33)}=\frac{31+\overbrace{f(289)}^{17}}{66+\underbrace{g(324)}_{18}}=\frac{48}{84}=\frac47. ~MRENTHUSIASM

Solution 3

Since nn isn't a perfect square, let n=m2+kn=m^2+k with 0.If0. Ifkisodd,thenis odd, thenf(n)=g(n).If. Ifk$ is even, then

f(n)=(m+1)2(m2+k)+(m+1)=3m+2k,g(n)=(m+2)2(m2+k)+(m+2)=5m+6k,\begin{aligned} f(n)&=(m+1)^2-(m^2+k)+(m+1)=3m+2-k, \\ g(n)&=(m+2)^2-(m^2+k)+(m+2)=5m+6-k, \end{aligned} from which

7(3m+2k)=4(5m+6k)m=3k+10.\begin{aligned} 7(3m+2-k)&=4(5m+6-k) \\ m&=3k+10. \end{aligned} Since kk is even, mm is even. Since k0k\neq 0, the smallest kk is 22 which produces the smallest nn:

k=2    m=16    n=162+2=258.k=2 \implies m=16 \implies n=16^2+2=\boxed{258}. ~Afo

Solution 4 (Quadratics With Two Variables)

To begin, note that if nn is a perfect square, f(n)=g(n)f(n)=g(n), so f(n)/g(n)=1f(n)/g(n)=1, so we must look at values of nn that are not perfect squares (what a surprise). First, let the distance between nn and the first perfect square greater than or equal to it be kk, making the values of f(n+k)f(n+k) and g(n+k)g(n+k) integers. Using this notation, we see that f(n)=k+f(n+k)f(n)=k+f(n+k), giving us a formula for the numerator of our ratio. However, since the function of g(n)g(n) does not add one to the previous inputs in the function until a perfect square is achieved, but adds values of two, we can not achieve the value of n+k\sqrt{n+k} in g(n)g(n) unless kk is an even number. However, this is impossible, since if kk was an even number, f(n)=g(n)f(n)=g(n), giving a ratio of one. Thus, kk must be an odd number.

Thus, since kk must be an odd number, regardless of whether nn is even or odd, to get an integral value in g(n)g(n), we must get to the next perfect square after n+kn+k. To make matters easier, let z2=n+kz^2=n+k. Thus, in g(n)g(n), we want to achieve (z+1)2(z+1)^2.

Expanding (z+1)2(z+1)^2 and substituting in the fact that z=n+kz=\sqrt{n+k} yields:

(z+1)2=z2+2z+1=n+k+2n+k+1(z+1)^2=z^2+2z+1=n+k+2\sqrt{n+k}+1 Thus, we must add the quantity k+2z+1k+2z+1 to nn to achieve a integral value in the function g(n)g(n). Thus.

g(n)=(k+2z+1)+n+k+2n+k+1g(n)=(k+2z+1)+\sqrt{n+k+2\sqrt{n+k}+1} However, note that the quantity within the square root is just (z+1)2(z+1)^2, and so:

g(n)=k+3z+2g(n)=k+3z+2 Thus,

f(n)g(n)=k+zk+3z+2\frac{f(n)}{g(n)}=\frac{k+z}{k+3z+2} Since we want this quantity to equal 47\frac{4}{7}, we can set the above equation equal to this number and collect all the variables to one side to achieve

3k5z=83k-5z=8 Substituting back in that z=n+kz=\sqrt{n+k}, and then separating variables and squaring yields that

9k273k+64=25n9k^2-73k+64=25n Now, if we treat nn as a constant, we can use the quadratic formula in respect to kk to get an equation for kk in terms of nn (without all the squares). Doing so yields

73±3025+900n18=k\frac{73\pm\sqrt{3025+900n}}{18}=k Now, since nn and kk are integers, we want the quantity within the square root to be a perfect square. Note that 552=302555^2=3025. Thus, assume that the quantity within the root is equal to the perfect square, m2m^2. Thus, after using a difference of squares, we have

(m55)(m+55)=900n(m-55)(m+55)=900n Since we want nn to be an integer, we know that the LHSLHS should be divisible by five, so, let's assume that we should have mm divisible by five. If so, the quantity 18k7318k-73 must be divisible by five, meaning that kk leaves a remainder of one when divided by 5 (if the reader knows LaTeX well enough to write this as a modulo argument, please go ahead and do so!).

Thus, we see that to achieve integers nn and kk that could potentially satisfy the problem statement, we must try the values of kk congruent to one modulo five. However, if we recall a statement made earlier in the solution, we see that we can skip all even values of kk produced by this modulo argument.

Also, note that k=1,6k=1,6 won't work, as they are too small, and will give an erroneous value for nn. After trying k=11,21,31k=11,21,31, we see that k=31k=31 will give a value of m=485m=485, which yields n=258n=\boxed{258}, which, if plugged in to for our equations of f(n)f(n) and g(n)g(n), will yield the desired ratio, and we're done.

Side Note: If any part of this solution is not rigorous, or too vague, please label it in the margin with "needs proof". If you can prove it, please add a lemma to the solution doing so :)

-Azeem H. (mathislife52)

Solution 5 (Basic Substitutions)

First of all, if nn is a perfect square, f(n)=g(n)=nf(n)=g(n)=\sqrt{n} and their quotient is 1.1. So, for the rest of this solution, assume nn is not a perfect square.

Let a2a^2 be the smallest perfect square greater than nn and let b2b^2 be the smallest perfect square greater than nn with the same parity as n,n, and note that either b=ab=a or b=a+1.b=a+1. Notice that (a1)2<n<a2.(a-1)^2 < n < a^2.

With a bit of inspection, it becomes clear that f(n)=a+(a2n)f(n) = a+(a^2-n) and g(n)=b+(b2n).g(n) = b+(b^2-n).

If aa and nn have the same parity, we get a=ba=b so f(n)=g(n)f(n) = g(n) and their quotient is 1.1. So, for the rest of this solution, we let aa and nn have opposite parity. We have two cases to consider.

Case 1: nn is odd and aa is even

Here, we get a=2ka=2k for some positive integer k.k. Then, b=2k+1.b = 2k+1. We let n=a2(2m+1)n = a^2-(2m+1) for some positive integer mm so f(n)=2k+2m+1f(n) = 2k+2m+1 and g(n)=2k+1+2m+1+4k+1=6k+2m+3.g(n) = 2k+1+2m+1+4k+1 = 6k+2m+3.

We set 2k+2m+16k+2m+3=47,\frac{2k+2m+1}{6k+2m+3}=\frac{4}{7}, cross multiply, and rearrange to get 6m10k=5.6m-10k=5. Since kk and mm are integers, the LHS will always be even and the RHS will always be odd, and thus, this case yields no solutions.

Case 2: nn is even and aa is odd

Here, we get a=2k+1a=2k+1 for some positive ineger k.k. Then, b=2k+2.b=2k+2. We let n=a2(2m+1)n = a^2-(2m+1) for some positive integer mm so f(n)=2k+1+2m+1=2k+2m+2f(n)=2k+1+2m+1=2k+2m+2 and g(n)=2k+2+2m+1+4k+3=6k+2m+6.g(n)=2k+2+2m+1+4k+3 = 6k+2m+6.

We set 2k+2m+26k+2m+6=47,\frac{2k+2m+2}{6k+2m+6} = \frac{4}{7}, cross multiply, and rearrange to get 5k=3m5,5k=3m-5, or k=35m1.k=\frac{3}{5}m-1. Since kk and mm are integers, mm must be a multiple of 5.5. Some possible solutions for (k,m)(k,m) with the least kk and mm are (2,5),(5,10),(8,15),(2,5), (5,10), (8,15), and (11,20).(11,20).

We wish to minimize kk since a=2k+1.a=2k+1. One thing to keep in mind is the initial assumption (a1)2<n<a2.(a-1)^2 < n < a^2.

The pair (2,5)(2,5) gives a=2(2)+1=5a=2(2)+1=5 and n=52(2(5)+1)=14.n=5^2-(2(5)+1)=14. But 42<14<524^2<14<5^2 is clearly false, so we discard this case.

The pair (5,10)(5,10) gives a=2(5)+1=11a=2(5)+1=11 and n=112(2(10)+1)=100,n=11^2-(2(10)+1)=100, which is a perfect square and therefore can be discarded.

The pair (8,15)(8,15) gives a=2(8)+1=17a=2(8)+1=17 and n=172(2(15)+1)=258,n=17^2-(2(15)+1)=258, which is between 16216^2 and 17217^2 so it is our smallest solution.

So, 258\boxed{258} is the correct answer.

~mc21s

Solution 6 (Short)

Say the answer is in the form n2xn^{2}-x, then xx must be odd or else f(x)=g(x)f(x) = g(x). Say y=n2xy = n^{2}-x. f(y)=x+nf(y) = x+n, g(y)=3n+2+xg(y) = 3n+2+x. Because f(y)/g(y)f(y)/g(y) = 44*(an integer)/77*(an integer), f(y)f(y) is 44*(an integer) so nn must be odd or else f(y)f(y) would be odd. Solving for xx in terms of nn gives integer x=(5/3)n+8/3x = (5/3)n+8/3 which means nn is 22 mod 33, because nn is also odd, nn is 55 mod 66. xx must be less than 2n12n-1 or else the minimum square above yy would be (n1)2(n-1)^{2}. We set an inequality (5/3)n+8/3<2n1=>5n+8<6n3=>n>11(5/3)n+8/3<2n-1 => 5n+8<6n-3 => n>11. Since nn is 55 mod 66, n=17n = 17 and x=31x = 31 giving 1723117^{2}-31 = 258\boxed{258}.

~mathophobia

~LaTeX\LaTeX added by Bread10

Solution 7

Define a nonnegative integer kk such that g(n)f(n)g(n)-f(n) = kk. Since f(n)g(n)=47,\frac{f(n)}{g(n)} = \frac{4}{7}, kk is a positive integer. Now, suppose 3 consecutive integers a1a-1, aa, and a+1a+1, and (a1)2<n<a2(a-1)^2 < n < a^2. When g(n)>f(n)g(n) > f(n), g(n)g(n) must have a different parity than aa, so that f(n)f(n)'s recursive sequence ends on a2a^2, while g(n)g(n) continues to (a+1)2(a+1)^2. If this condition is satisfied, we can figure out the value of kk based on aa. According to the definitions of f(n)f(n) and g(n)g(n), f(n)=a+a2n,f(n) = a+a^2-n, and g(n)=(a+1)+(a+1)2n,g(n) = (a+1)+(a+1)^2-n, which gives k=2a+2k = 2a+2. And because of f(n)+k=g(n)f(n) + k = g(n), kg(n)=37,\frac{k}{g(n)} = \frac{3}{7}, so cross multiplying gives 3g(n)=14a+143g(n) = 14a+14. This means that 14a+1414a+14 is divisible by 3, and thus a2(mod3)a \equiv 2 \pmod{3}. The final thing left is to find the smallest aa such that the corresponding value of g(n)g(n) exist. Simple guess and check should give that the smallest value of aa is a=17a = 17, which yields an answer of n=258n = \boxed{258}.

~ Marchk26

Solution 8 (Fast)

Let n=k2xn=k^2-x, where 0x2k20 \leq x \leq 2k-2. This means that f(n)=k+xf(n)=k+x. For g(x)g(x), note that xx must be odd, otherwise f(n)=g(n)f(n)=g(n). This means that g(n)g(n) must 'skip' one perfect square (being k2k^2), and go to (k+1)2(k+1)^2. This will take (k+1)2k2+x+k+1=3k+x+2(k+1)^2-k^2+x+k+1=3k+x+2. We have k+x3k+x+2=47\frac{k+x}{3k+x+2}=\frac{4}{7}. Cross multiplying and simplifying we get 3x5k=83x-5k=8. Taking mod5mod 5 we have 3x=3mod53x=3 \mod 5 or x=1mod5x = 1 \mod 5. Note that the inequality 0x2k20 \leq x \leq 2k-2 when x=5t+1x=5t+1 and t5t \geq 5. Trying out t=5t=5, we get x=26x=26 which doesn't work as x is even. Trying out t=6t=6, we get x=31x=31 and k=17k=17, which satisfies all conditions, meaning the answer is 17231=258.17^2-31=\boxed{258}.

~E___

Video Solution

https://youtu.be/tRVe2bKwIY8

~Mathematical Dexterity

Video Solution by Interstigation

https://youtu.be/WmEmwt3xwoo

~Interstigation