## Gem 4: My

Grandfather's Clever Raisins Game

by Moshe Shweiger

I played "The Raisins Game" with my grandfather

when I was a young boy in Israel: Arrange any

number of raisins in a circle, and number them

from one to n (n could be any integer). Then eat the

raisin assigned number one, skip raisin number two,

then eat raisin number three, skip raisin number

four, then eat raisin number five, and so on, until one

last raisin remains. Well, the hard question to solve is:"For any given number n of raisins in a

circle at the start of a game, following

the rule of eating number one and

skipping number two, etc., which raisin

(its number in the circle) will be the

remaining last one?"The solution to this relatively complex problem

bothered me for decades, but lately I solved it.

Fact and Observation One:

The rule of the game states "eat number one,

skip number two, eat number three, etc."

This tells us that all the raisins situated at odd

numbered positions will be eaten. So Fact and

Observation One is "The remaining one must be

at an even numbered position."

Fact and Observation Two:

The rule "eat number one, skip number two, etc."

tells us that the binary number system is

somewhat involved.

Let's find out the remaining raisin number R for

the cases n = 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 15,

and 17 for the number of raisins in the circles:

Let's express all the n values that we picked in the

binary number system mode:

n

(Decimal)Binary mode for n Note R

(Decimal)Binary mode for R 2 ^{4 }2 ^{3 }2 ^{2 }2 ^{1 }2 ^{0 }2 ^{4 }2 ^{3 }2 ^{2 }2 ^{1 }2 ^{0 }16 8 4 2 1 16 8 4 2 1 3 1 1 2 1 0 4 1 0 0 See * 4 1 0 0 5 1 0 1 2 1 0 6 1 1 0 4 1 0 0 7 1 1 1 6 1 1 0 8 1 0 0 0 See * 8 1 0 0 0 9 1 0 0 1 2 1 0 10 1 0 1 0 4 1 0 0 11 1 0 1 1 6 1 1 0 12 1 1 0 0 8 1 0 0 0 15 1 1 1 1 14 1 1 1 0 17 1 0 0 0 1 2 1 0 * When n is 2

^{K}, it is a special case, and it will be

discussed later.

Except for the case of n = 2^{K}, which will be

discussed in details later, the algorithm to take us

from n to R could be looked at in two different

ways that results in the same solution.

Outlook 1: Transfer the 1 at the utmost leftto the

utmost right and then change it tozero.

Of course, the R result must be

converted to an integerOutlook 2: Move the binary n one column to the left,

put a zero on the 2^{0}spot, and delete the

leftmost column.Let's do a few n cases:

n=5 is | 1 | 0 | 1 | Move it one column to the left

and put zero on the 2^{0}spot.

We get |1|0|1|0|, then delete the

first column. We get |0|1|0| = 2.n=17 is |1|0|0|0|1| Move it one column to the left

and put zero on the 2^{0}spot.

We get |1|0|0|0|1|0|, then delete

the first column. We get |1|0| = 2.Let's practice for n=24, 125, 27, 22:

n=24 in binary=11000. Algorithm gives~~10000=16.~~1

n=125 in binary = 1111101. R =~~1111010 = 122.~~1

n=27 in binary = 11011. R =~~10110 = 22.~~1

n=22 in binary = 10110. R =~~01100 = 12.~~1

Let's deal now when n = 2^{K}, like 8 = 2^{3}: Expressing

8 in binary we get 1000. Using our algorithm we get

R =~~0000 = 0000, and converting it to an integer,~~1

we get a big fat ZERO! This result kept me puzzled

for years, and I questioned the validiy of the

algorithm. But here is the interpretation of a zero

for R: A zero is an integer which is always prior to

one, so when we construct the raisins circle, the

integer prior to one is the number of raisins in this

circle before the eating game starts.

So for n = 2^{K}like 8, 16, 32, 64, 128, ..., 1024, ...,

32768, ..., R would be 2^{K}; e.g., for a circle of 2048

raisins, the last remaining raisin would be raisin

number 2048, which is just before number one

because 2048 = 2^{11}.

If you would like to comment on this article,

simply email MosheShweiger@gmail.com.

Digital Photographs and Mathematics Copyright 2023, Moshe Shweiger, all rights reserved.