Siteswap is a notation for juggling patterns.
The other siteswap puzzle is great and it explains siteswap in greater detail than here. This puzzle is meant to be a bit simpler! Numberphile recently interviewed Colin Wright which helped develop the notation. The part at ~16min will be useful for this challenge. Another resource which may be useful for wrapping your hear around siteswap if you have not used it before: In your head
Below is the diagram(courtesy of wikipedia) for valid throws with 3 balls and a max height of a throw of 5. A valid siteswap ends at the same position as it started.
A valid siteswap for the case we are interested in is defined as follows: In the diagram above choose a starting node and then follow the arrows and write down the number attached to the arrow. If you end up on the same node as you started then the number you have written down is a valid siteswap, otherwise it is not valid.
Take a number as input and output a truthy value if it is a valid siteswap for juggling with 3 balls with a max height of 5, otherwise output a falsy value. (No multiplex throws are allowed)
Input Output ------------------------ 3 True 3333333333 True 3342 True 441 True 5 False 225225220 False 332 False