#toyprogrammingchallenge #python #lisp #c #c++ #cpp #coding #programming
Ready for the next challenge?
"5 Guys and a Bunch of Coconuts"
Here is a link to the text description of the problem.
https://git.qoto.org/Absinthe/coconuts/blob/master/coconuts.txt
That link is to the repo, and my solution is in it as well.
I decided to take a stand at finding this solution mathematically without the brute Force approach applied in the source. I want to solve for the answer (the most efficient answer).
So far I framed the question mathematically and reduced. All I need to do is find the smallest value of T_R that produces Integer solutions for the following 5 equations and I will have a solution... I'll be finished soon hopefully.
How about something like this:
def func(x):
if x % 5 == 1:
return (x - 1) / 5 * 4
return 0
x = 6
while True:
if func(func(func(func(func(x))))):
break
x += 5
print(x)
@zingbretsen @freemo did you post it somewhere?