All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars    
perplexus dot info

Home > Just Math
A peculiar function! (Posted on 2020-09-03) Difficulty: 4 of 5
f(n)=max{f(j)+f(n−j)+j}

Let f be a function from the set of positive integers to the set of non-negative integers such that f(1)=0 and f(n) is defined as of above for n≥2. Determine the value of f(2020).

Note: The maximum in the definition of f(n) is considered over all j such that 1≤j≤n−1, i.e for all j for which f(n) and f(n−j) are defined.

No Solution Yet Submitted by Danish Ahmed Khan    
No Rating

Comments: ( Back to comment list | You must be logged in to post comments.)
Solution computer solution and a fitted polynomial | Comment 3 of 5 |
The program at bottom calculated the values in the teble below. Before modification with the theories as to the direct formula, it produced only the first two columns n and f(n) from the definition. The quadratic was added later.  The first row was manually inserted.

The finite differences f(n) - f(n-1) are all equal to n-1. 

In the range where the quadratic is valid, it's f(n) = (n^2-n)/2.

 n f(n)    (n^2-n)/2
 1  0          0
 2  1          1
 3  3          3
 4  6          6
 5 10         10
 6 15         15
 7 21         21
 8 28         28
 9 36         36
10 45         45


f(2020) = 2039190  (computed from definition)

(2020^2 - 2020)/2 = 2039190  (valid quadratic, verified)



Dim f(2022)

 f(1) = 0
 For n = 2 To 2020
    mx = 0
    For j = 1 To n - 1
      If f(j) + f(n - j) + j > mx Then mx = f(j) + f(n - j) + j
     DoEvents
    Next
    f(n) = mx
    If n <= 10 Then Text1.Text = Text1.Text & n & Str(f(n)) & "     " _
        & (n * n - n) / 2 & vbCrLf
 Next
 
 Text1.Text = Text1.Text & vbCrLf & vbCrLf & f(2020) & vbCrLf
 
 n = 2020
 Text1.Text = Text1.Text & (n * n - n) / 2 & vbCrLf

  Posted by Charlie on 2020-09-03 12:11:10
Please log in:
Login:
Password:
Remember me:
Sign up! | Forgot password


Search:
Search body:
Forums (0)
Newest Problems
Random Problem
FAQ | About This Site
Site Statistics
New Comments (13)
Unsolved Problems
Top Rated Problems
This month's top
Most Commented On

Chatterbox:
Copyright © 2002 - 2024 by Animus Pactum Consulting. All rights reserved. Privacy Information