Too gruesome for me

( n + 3 ) n = k = 3 n + 2 k n \Large \displaystyle (n+3)^n = \sum_{k=3}^{n+2} k^n

How many natural numbers of n < 500 n < 500 satisfy the equation above?


The answer is 2.

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.

4 solutions

Brock Brown
Jun 27, 2015

Let r r be the number of roots that exist.

( n + 3 ) n = k = 3 n + 2 k n 0 = ( n + 3 ) n k = 3 n + 2 k n (n + 3)^{n} = \sum^{n+2}_{k=3} k^{n} \implies 0 = (n + 3)^{n} - \sum^{n+2}_{k=3} k^{n}

Let f ( n ) = ( n + 3 ) n k = 3 n + 2 k n f(n) = (n + 3)^{n} - \sum^{n+2}_{k=3} k^{n}

1
2
3
4
5
6
7
def f(n):
    return (n + 3)**n - sum((k**n for k in range(3,n+3)))
roots = 0
for n in range(501):
    if f(n) == 0:
        roots += 1
print("r =", roots)

r = 2 \implies r = 2

Note: range(501) includes 0 0 in the search too but n N n\in N .

Arulx Z - 5 years, 9 months ago
Bill Bell
Jun 3, 2015

Moderator note:

A no-frills solution. Clear and to the point.

Note, you can format code directly using the markup system, check out code markup

Thanks for the tip. I gave up on formatting code at one point. However, there is one advantage of using images and that is that it's a simple matter to display output along with the code.

Bill Bell - 5 years, 11 months ago
Dheeman Kuaner
Mar 20, 2018

Here is a C program code for the problem.

Arulx Z
Aug 23, 2015
1
2
3
4
5
>>> count = 0
>>> for n in xrange (1, 500):
        count += (n + 3) ** n == sum (k ** n for k in xrange (3, n + 3))
>>> count
2

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...