Birthday special!!!

Algebra Level 3

Find

k = 1 1995 1 f ( k ) , \displaystyle\sum_{k=1}^{1995}\dfrac 1{f(k)},

where f ( n ) f(n) is the integer closest to n 4 . \sqrt[4]{n}.


The answer is 400.

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

8 solutions

Parth Lohomi
Feb 6, 2015

When ( k 1 2 ) 4 < n < ( k + 1 2 ) 4 \left(k - \frac {1}{2}\right)^4 < n < \left(k + \frac {1}{2}\right)^4 , then f(n) = k. Thus there are ( k + 1 2 ) 4 ( k 1 2 ) 4 \left \lfloor \left(k + \frac {1}{2}\right)^4 - \left(k - \frac {1}{2}\right)^4 \right\rfloor values of n for which f(n) = k. Expanding using the binomial theorem, ( k + 1 2 ) 4 ( k 1 2 ) 4 \left(k + \frac {1}{2}\right)^4 - \left(k - \frac {1}{2}\right)^4 = 4 k 3 + k 4k^3+k

Thus, 1 k \frac{1}{k} appears in the summation 4 k 3 + k 4k^3 + k times, and the sum for each k is then ( 4 k 3 + k ) 1 k = 4 k 2 + 1 (4k^3 + k) \cdot \frac{1}{k} = 4k^2 + 1 . From k = 1 k = 6 , k = 1 \to\ k = 6, we get k = 1 6 4 k 2 + 1 = 364 + 6 = 370 \sum_{k=1}^{6} 4k^2 + 1 = 364 + 6 = 370 (either adding or using the sum of consecutive squares formula). But this only accounts for k = 1 6 ( 4 k 3 + k ) = 4 ( 6 ( 6 + 1 ) 2 ) 2 + 6 ( 6 + 1 ) 2 = 1764 + 21 = 1785 \sum_{k = 1}^{6} (4k^3 + k) = 4\left(\frac{6(6+1)}{2}\right)^2 + \frac{6(6+1)}{2} = 1764 + 21 = 1785 terms, so we still have 1995 - 1785 = 210 terms with f(n) = 7. This adds 210 1 7 = 30 210 \cdot \frac {1}{7} = 30 to our summation, giving 400 . \boxed{400}.

Thanks!

By understanding what f ( n ) f(n) really is, this question is much easier to tackle. As expressed by @Chew-Seong Cheong , he computed the number of values where f ( n ) = k f(n) = k using a spreadsheet, while you provided the mathematical reasoning behind it.

Calvin Lin Staff - 6 years, 4 months ago

Log in to reply

Thanks sir!!

Parth Lohomi - 6 years, 4 months ago

Great solution. Though I saw the first step almost immediately, I couldn't pursue it analytically and so calculated all terms by hand till k = 7 k=7 . How did you imagine this problem Parth?

Snehal Shekatkar - 6 years, 4 months ago

Log in to reply

Was just doodling with the pen. . . . . When this struck!!

Parth Lohomi - 6 years, 4 months ago

@Parth Lohomi Great solution! However, I am not sure about the use of the floor function to get the number of integers in the interval. It works in this special case, but it may not work in general - try the formula on 2 3 < n < 4 3 \frac{2}{3}<n<\frac{4}{3}

If I'm not mistaken, it misses the only solution...

Carsten Meyer - 1 year, 9 months ago

Log in to reply

Indeed. To count the number of integers a < b < n a < b < n , we could use b a \lfloor b \rfloor - \lceil a \rceil .

Calvin Lin Staff - 1 year, 9 months ago

Log in to reply

Is that right? In the example above, your formula would yield b = 4 / 3 a = 2 / 3 = 0 \lfloor b=4/3\rfloor-\lceil a=2/3\rceil =0 soulutions... The idea is to calculate an integer interval inside the real interval, right? If so, I'd say we need to add one: # integers in [ a ; b ] = ? b a + 1 \#\text{ integers in }[a;\:b]\overset{?}{=}\lfloor b\rfloor - \lceil a\rceil +1

Carsten Meyer - 1 year, 9 months ago

Log in to reply

@Carsten Meyer ( I think this should be right now. The part that tripped me up was dealing with endpoints.)

For a < n < b a < n < b , we should use b a 1 \lceil b \rceil - \lfloor a \rfloor - 1 , with the condition that a b a \neq b .
For a n b a \leq n \leq b , we should use b a + 1 \lfloor b \rfloor - \lceil a \rceil +1 .

The strict / non-strict inequality determines if we should use ceiling or floor function, so that we exclude/include that value. After that, it's counting the number of integers in the interval with open/closed ends.

Calvin Lin Staff - 1 year, 9 months ago

Log in to reply

@Calvin Lin "Off-by-one errors", hard to find as always... I agree on both formulae, the symmetry is especially pleasing. Thank you for your effort!

Carsten Meyer - 1 year, 9 months ago

Have an idea, still spreadsheet

Figel Ilham - 6 years, 4 months ago

Log in to reply

Being lazy ftw! :P

Prasun Biswas - 6 years, 3 months ago

I can only come up with a numerical method, using a spreadsheet.

We note that the largest f ( n ) f(n) in this case f ( 1995 ) = 7 f(1995) = 7 , since 1995 4 = 6.6832 \sqrt [4] {1995} = 6.6832 .

Let f ( n ) = i f(n) = i , then the largest n n for an i i is given by: n i = ( i + 0.5 ) 4 n_i = \lfloor (i + 0.5)^4 \rfloor , where x \lfloor x \rfloor is the greatest integer function. Then the number of n n , which f ( n ) = i f(n) = i is n i n i 1 n_i - n_{i-1} , where n 0 = 0 n_0 = 0 and n 7 = 1995 n_7 = 1995 .

Then, we have:

k = 1 1995 1 f ( k ) = i = 1 7 n i n i 1 i \sum _{k=1} ^{1995} {\frac {1}{f(k)}} = \sum _{i=1} ^7 {\frac {n_i-n_{i-1}}{i}}

The following table shows the computation of k = 1 1995 1 f ( k ) \displaystyle \sum _{k=1} ^{1995} {\frac {1}{f(k)}} .

i n i n i n i 1 × 1 i = n i n i 1 i 1 5 5 × 1 1 = 5 2 39 34 × 1 2 = 17 3 150 111 × 1 3 = 37 4 410 260 × 1 4 = 65 5 915 505 × 1 5 = 101 6 1785 870 × 1 6 = 145 7 1995 210 × 1 7 = 30 k = 1 1995 1 f ( k ) = 400 \begin{array} {rrrcr} i & n_i & n_i-n_{i-1} & \times \frac {1}{i} = & \frac {n_i-n_{i-1}}{i} \\ \hline \\ 1 & 5 & 5 & \times \frac{1}{1} = & 5 \\ 2 & 39 & 34 & \times \frac{1}{2} = & 17 \\ 3 & 150 & 111 & \times \frac{1}{3} = & 37 \\ 4 & 410 & 260 & \times \frac{1}{4} = & 65 \\ 5 & 915 & 505 & \times \frac{1}{5} = & 101 \\ 6 & 1785 & 870 & \times \frac{1}{6} = & 145 \\ 7 & 1995 & 210 & \times \frac{1}{7} = & 30 \\ & & & \sum _{k=1} ^{1995} {\frac {1}{f(k)}} = & \boxed {400} \end{array}

You are actually really close to the "algebraic solution". As you can see from Parth's solution, you have all of the parts needed

Unfortunately, the temptation of merely throwing this into a spreadsheet is extremely high...

Calvin Lin Staff - 6 years, 4 months ago

I used the same approach sir, but taking help from Graph of y = x 1 4 y=x^{\frac{1}{4}} instead of spreadsheets, but yours is better !!

A Former Brilliant Member - 6 years, 4 months ago
Prakhar Gupta
Feb 6, 2015

Here is my J A V A JAVA code for the problem:-

I always appreciate Java solutions !!!

A Former Brilliant Member - 6 years, 4 months ago

Log in to reply

Thank you..!

Prakhar Gupta - 6 years, 4 months ago

Did it returned exact 400? My C++ code gave me 399.857143.

Edit: Sorry, I calculated till i<1995. So one extra term was missing. 😛

Pranjal Jain - 6 years, 4 months ago

Hi, I got this question wrong so I tried your coding, but it says "inner classes cannot have static declarations".

Please help !!

Kudou Shinichi - 6 years, 4 months ago

Log in to reply

Try a java thread on some site for detailed info on inner classes. Yet a classic Run program with main, with the function in the same class will work.

Parth Singh - 3 months ago
Brock Brown
Feb 9, 2015

Python:

1
2
3
4
5
6
7
from fractions import Fraction as frac
def f(n):
    return int(round(n**(1/4.0)))
total = 0
for k in xrange(1,1996):
    total += frac(1, f(k))
print "Answer:", float(total)

And I'm a little late, but happy birthday!

No no.... My birthday is on 15 may, its satvik Golechha's birthday @Brock Brown

Parth Lohomi - 6 years, 3 months ago

Log in to reply

Oh... Whoops. :p

Happy belated birthday, Satvik Golechha .

Brock Brown - 6 years, 3 months ago

Log in to reply

Pranjal Jain
Feb 6, 2015
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#include<iostream.h>
#include<conio.h>
#include<math.h>
int main()
{
clrscr();
double a,b,c,s;
int i;
s=0;
for (i=1;i<1996;++i)
{
b=pow(i,0.25);
c=floor(b)+0.5;
if (b<c)
{
b=floor(b);
}
else
{
b=ceil(b);
}
a=1/b;
s=s+a;
}
cout<<s;
getch();
}

Here's C++ program

@Parth Lohomi Waiting for your mathematical solution, its an algebra question, right?

Pranjal Jain - 6 years, 4 months ago

Log in to reply

Challenge accepted

When ( k 1 2 ) 4 < n < ( k + 1 2 ) 4 \left(k - \frac {1}{2}\right)^4 < n < \left(k + \frac {1}{2}\right)^4 , then f(n) = k. Thus there are ( k + 1 2 ) 4 ( k 1 2 ) 4 \left \lfloor \left(k + \frac {1}{2}\right)^4 - \left(k - \frac {1}{2}\right)^4 \right\rfloor values of n for which f(n) = k. Expanding using the binomial theorem, ( k + 1 2 ) 4 ( k 1 2 ) 4 \left(k + \frac {1}{2}\right)^4 - \left(k - \frac {1}{2}\right)^4 = 4 k 3 + k 4k^3+k

Thus, 1 k \frac{1}{k} appears in the summation 4 k 3 + k 4k^3 + k times, and the sum for each k is then ( 4 k 3 + k ) 1 k = 4 k 2 + 1 (4k^3 + k) \cdot \frac{1}{k} = 4k^2 + 1 . From k = 1 k = 6 , k = 1 \to\ k = 6, we get k = 1 6 4 k 2 + 1 = 364 + 6 = 370 \sum_{k=1}^{6} 4k^2 + 1 = 364 + 6 = 370 (either adding or using the sum of consecutive squares formula). But this only accounts for k = 1 6 ( 4 k 3 + k ) = 4 ( 6 ( 6 + 1 ) 2 ) 2 + 6 ( 6 + 1 ) 2 = 1764 + 21 = 1785 \sum_{k = 1}^{6} (4k^3 + k) = 4\left(\frac{6(6+1)}{2}\right)^2 + \frac{6(6+1)}{2} = 1764 + 21 = 1785 terms, so we still have 1995 - 1785 = 210 terms with f(n) = 7. This adds 210 1 7 = 30 210 \cdot \frac {1}{7} = 30 to our summation, giving 400 . \boxed{400}.

Was anyone saying something

Huh.

@Pranjal Jain

Parth Lohomi - 6 years, 4 months ago

Log in to reply

can you post this as a separate solution? Thanks

Calvin Lin Staff - 6 years, 4 months ago

Log in to reply

@Calvin Lin No problem sir! !!! :)

Parth Lohomi - 6 years, 4 months ago

Indeed a nice solution! Can you post solutions to all questions? -_-

Pranjal Jain - 6 years, 4 months ago
Shiva Kannan
Jul 31, 2020

define a function $g(x)$ and let $ \int g(x) dx = 6$

Carsten Meyer
Sep 10, 2019

Here is an integer solution without floor/ceil-functions! First, collect all integers n n such that f ( n ) = k f(n)=k . f ( n ) = k k 1 2 < n 4 < k + 1 2 ( k 1 2 ) 4 < n < ( k + 1 2 ) 4 \begin{aligned} f(n)&=k&\Leftrightarrow&&k-\frac{1}{2}<\sqrt[4]{n}&<k+\frac{1}{2}&\Leftrightarrow&&\left(k-\frac{1}{2}\right)^4<n&<\left(k+\frac{1}{2}\right)^4 \end{aligned} Now we need integer estimates for the left and right borders. Taking just the floor between upper and lower bound generally does not determine the number of integers in that interval (see remark below). Let a k : = ( k 1 2 ) 4 + 15 16 = k 4 2 k 3 + k ( 3 k 1 ) 2 + 1 N for any k N \begin{aligned} a_k&:=\left(k-\frac{1}{2}\right)^4+\frac{15}{16}=k^4-2k^3+\frac{k(3k-1)}{2}+1\in\mathbb{N}\quad\text{for any }k\in\mathbb{N} \end{aligned} We only need the expanded form of a k a_k to show that it really is an integer. With the factorized form, we notice that for n N n\in\mathbb{N} : ( k 1 2 ) 4 < n < ( k + 1 2 ) 4 a k n < a k + 1 for any k N \begin{aligned} \left(k-\frac{1}{2}\right)^4<n&<\left(k+\frac{1}{2}\right)^4&\Leftrightarrow&&a_k\leq n&< a_{k+1}&&\text{for any }k\in\mathbb{N} \end{aligned}


We know that f ( n ) = k = c o n s t f(n)=k=const if and only if a k n < a k + 1 a_k\leq n < a_{k+1} and split the sum accordingly: n = 1 1995 1 f ( n ) = k = 1 6 a k + 1 a k k + n = a 7 1995 1 7 = k = 1 6 k ( 4 k 2 + 1 ) k + n = a 7 1995 1 7 = ( ) 4 6 7 13 6 + 6 + 1995 1786 + 1 7 = 400 \begin{aligned} \sum_{n=1}^{1995}\frac{1}{f(n)}&=\sum_{k=1}^6\frac{a_{k+1}-a_k}{k}+\sum_{n=a_7}^{1995}\frac{1}{7}=\sum_{k=1}^6\frac{\cancel{k}(4k^2+1)}{\cancel{k}}+\sum_{n=a_7}^{1995}\frac{1}{7}\\[2em] &\underset{(*)}{=}4\cdot\frac{6\cdot 7\cdot 13}{6}+6+\frac{1995-1786+1}{7}=\boxed{400} \end{aligned} Rem.: In the last step ( ) (*) , we use the formula for the sum of squares.


Rem.: The floor function between upper and lower border of an interval generally does not return the number of integers in that interval. Let n Z n\in{\mathbb{Z}} and look at the following examples 1 3 < n < 5 3 n = 1 , 5 3 1 3 = 1 2 3 < n < 4 3 n = 1 , 4 3 2 3 = 0 \begin{aligned} \frac{1}{3}<n&<\frac{5}{3}&\Rightarrow &&n&=1,&\left\lfloor\frac{5}{3}-\frac{1}{3}\right\rfloor=1\\ \frac{2}{3}<n&<\frac{4}{3}&\Rightarrow &&n&=1,&\left\lfloor\frac{4}{3}-\frac{2}{3}\right\rfloor=\red{0} \end{aligned} In the second example, the floor function would miss the integer solution! In general, the floor function between upper and lower bound can either return the number of integers in that interval, or it is off by one, making it rather useless here!

Lu Chee Ket
Feb 7, 2015

f (n) in this question equals to {1, 2, 3, 4, 5, 6 and 7.} only.

Sum of certain number of {1, 1/ 2, 1/ 3, 1/ 4, 1/ 5, 1/ 6 and 1/ 7.} = 400

Using Excel, this question is easy. Round (Power (x, 0.25), 0) is for nearest values.

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...