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

Home > Numbers
Recursive reaches one million (Posted on 2019-08-15) Difficulty: 4 of 5
Define a function f mapping positive integers to positive integers by f(1)=1, and f(n)=f(n-1)+n if f(n-1)<=n and f(n)=f(n-1)-n if f(n-1)>n

For n≥2,
i) Find the smallest integer n such that f(n) = 1,000,000
ii) Find the smallest integer n such that f(n) = 2,000,000

No Solution Yet Submitted by Danish Ahmed Khan    
No Rating

Comments: ( You must be logged in to post comments.)
  Subject Author Date
imageSteven Lord2019-08-16 06:51:35
re: computer solution with pattern the rest of the outputCharlie2019-08-15 13:27:31
Solutioncomputer solution with patternCharlie2019-08-15 09:18:37
comp solnSteven Lord2019-08-15 07:18:53
Please log in:
Remember me:
Sign up! | Forgot password

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

Copyright © 2002 - 2021 by Animus Pactum Consulting. All rights reserved. Privacy Information