Posts: 4,698
Threads: 222
Joined: Apr 2022
Reputation:
322
08-05-2024, 04:58 PM
(This post was last modified: 08-05-2024, 05:00 PM by bplus.)
Quote:See if this holds up. These guys may eat a few less than you think:
Testing 51
51 / 3 = 17 R 0 fail need Remainder 1 to give to Donkey
'52 / 3 = 17 R 1 52 - 17 - 1 = 34
'34 / 3 = 11 R 1 34 - 11 - 1 = 22
'22 / 3 = 7 R 1 so 7 for each
'26 + 7 = 33 1st
'17 + 7 = 24 2nd
'11 + 7 = 18 3rd
' +4 Donkey
====================
= 79 It works alright
(08-05-2024, 04:29 PM)Pete Wrote: When I need answers to difficult programming approaches, I consult Clippy... then do the opposite. Works every time! Clippy, the Anti-Maze.
Pete 
This reminds me of Seinfeld when George started succeeding in Life by doing the opposite of his first instinct.
724 855 599 923 575 468 400 206 147 564 878 823 652 556 bxor cross forever
Posts: 3,448
Threads: 376
Joined: Apr 2022
Reputation:
345
Ah! I didn't count it as 3 and remainder of 1. I counted it as eat 1/3, feed the donkey 1 of the remaining. 2/3.
Posts: 2,910
Threads: 305
Joined: Apr 2022
Reputation:
167
08-05-2024, 06:15 PM
(This post was last modified: 08-05-2024, 06:21 PM by Pete.)
I remember that episode. I had a friend, in high school, who was pretty close to George. In 1975 and 1976 he was rooting for the Oakland Raiders to make it to and win the Superbowl. Well, both those years Oakland didn't make it, and the Stealers won. So in 1977 he switched to the Stealers and as soon as I heard that, I called him a fool and said that this is the year Oakland will win it all. He was so pissed he bet me $5.00, on the spot, and I took that bet. Congrats to the 1977 Superbowl champion Oakland Raiders! They have their rings, and I have my $5.00 framed and hanging in my mancave.
Edit: It's not Steve's fault. I don't think he grows apples. He could. Amazingly enough, they do quite well in Virginia climate and soil, and unlike Washington state apples, they don't roll to the left.
Pete
Shoot first and shoot people who ask questions, later.
Posts: 4,698
Threads: 222
Joined: Apr 2022
Reputation:
322
sweet!
724 855 599 923 575 468 400 206 147 564 878 823 652 556 bxor cross forever
Posts: 4,698
Threads: 222
Joined: Apr 2022
Reputation:
322
So testing what we've learned:
How many apples do you need at minimum if you don't give the donkey an apple in the morning?
Hint: considerably less!
724 855 599 923 575 468 400 206 147 564 878 823 652 556 bxor cross forever
Posts: 4,698
Threads: 222
Joined: Apr 2022
Reputation:
322
08-06-2024, 12:27 PM
(This post was last modified: 08-06-2024, 01:43 PM by bplus.)
OK then 3 Friends, Apples and Steve who needs no apples, just a music festival roll into the neighborhood once or twice a summer.
Update:
Oh wow! Look at all the apples needed if you aren't giving an apple to a donkey at each divy!
Unless I miscalculated, its more than 79. ??
724 855 599 923 575 468 400 206 147 564 878 823 652 556 bxor cross forever
Posts: 4,698
Threads: 222
Joined: Apr 2022
Reputation:
322
08-08-2024, 03:07 PM
(This post was last modified: 08-08-2024, 03:08 PM by bplus.)
Yes
Just got Internet back from Tues 4:30PM storm, here are my calcs for the 2 followup questions:
Code: (Select All)
' Charlies orig problem solution
'For i = 1 To 4000
' If i Mod 3 = 1 Then
' i2 = i - Int(i / 3) - 1 '1st
' If i2 Mod 3 = 1 Then
' i3 = i2 - Int(i2 / 3) - 1 '2nd
' If i3 Mod 3 = 1 Then
' i4 = i3 - Int(i3 / 3) - 1 ' 3rd
' If i4 Mod 3 = 1 Then
' i5 = i4 - Int(i4 / 3) - 1 '4th
' 'If i5 Mod 3 = 0 Then
' Print i; "="; i2 / 2 + i5 / 2; "+"; i3 / 2 + i5 / 2; "+"; i4 / 2 + i5 / 2; "+"; 4
' Exit For
' 'End If
' End If
' End If
' End If
' End If
'Next
Print " What if donkey does not get apple in am? "
For i = 1 To 4000
If i Mod 3 = 1 Then
i2 = i - Int(i / 3) - 1 '1st
If i2 Mod 3 = 1 Then
i3 = i2 - Int(i2 / 3) - 1 '2nd
If i3 Mod 3 = 1 Then
i4 = i3 - Int(i3 / 3) - 1 ' 3rd
If i4 Mod 3 = 0 Then
i5 = i4 - Int(i4 / 3) '4th
'If i5 Mod 3 = 0 Then
Print i; "="; i2 / 2 + i5 / 2; "+"; i3 / 2 + i5 / 2; "+"; i4 / 2 + i5 / 2; "+"; 3
Exit For
'End If
End If
End If
End If
End If
Next
Print " What if donkey doesn't get any apples?"
For i = 1 To 4000
If i Mod 3 = 0 Then
i2 = i - Int(i / 3) '1st
If i2 Mod 3 = 0 Then
i3 = i2 - Int(i2 / 3) '2nd
If i3 Mod 3 = 0 Then
i4 = i3 - Int(i3 / 3) ' 3rd
If i4 Mod 3 = 0 Then
i5 = i4 - Int(i4 / 3) '4th
'If i5 Mod 3 = 0 Then
Print i; "="; i2 / 2 + i5 / 2; "+"; i3 / 2 + i5 / 2; "+"; i4 / 2 + i5 / 2; "+"; 0
' debug check Print "Divisions:"; i2; i3; i4; i5
Exit For
'End If
End If
End If
End If
End If
Next
724 855 599 923 575 468 400 206 147 564 878 823 652 556 bxor cross forever