Problem 59126. Compute the bubble popper fidget spinner sequence

A fidget spinner is a toy made of multiple lobes that pivot on a ball bearing. In some, the lobes hold bubble poppers, or rubber membranes that can be pushed and inverted. Descriptions of such toys say they help the fidgeter concentrate in meetings, classes, and other situations, and some evidence appears to support these claims.
In any case, while fidgeting with a bubble popper fidget spinner (BPFS) with five lobes, I thought of using it to create a sequence in this way: Push all of the poppers in. Then number each popper (say blue = 1, green = 2, orange = 3, pink = 4, and yellow = 5). Start by pushing popper 1 out. Then if the “in” position is called 0 and the “out” position is called 1, the poppers on the BPFS give the binary number 00001, or 1 in decimal.
Get the next numbers in the sequence by adding the next prime number to the position of the popper just touched, counting around the BPFS, inverting the popper, and converting the binary number represented by the poppers to decimal. So, for the next number, add the next prime (2) to the current position (1) to get 3, invert popper 3 (0 to 1), and convert 00101 to 5. The next number is 4 because you would add the next prime (3) to the current position (3) to get 6, count around the 5-lobed spinner to position 1, invert the popper from out to in (i.e., 1 to 0), and convert 00100 to 4.
Write a function to compute the first n terms of the sequence for an m-lobed bubble popper fidget spinner. Start each sequence with all poppers except the first in the zero position.

Solution Stats

100.0% Correct | 0.0% Incorrect
Last Solution submitted on Nov 13, 2023

Problem Comments

Solution Comments

Show comments

Problem Recent Solvers2

Suggested Problems

More from this Author250

Problem Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!