about | help | code help+videos | done | prefs |
necklace
Necklace - An interesting problem in number theory called the "necklace problem" begins with two single-digit numbers. The next number is obtained by adding the first two numbers together and saving only the ones-digit from the sum. This new digit and the one previous digit are then added and again keeping only the ones-digit from the sum. This process is repeated until the "necklace" closes to the two original numbers. For example, if the starting numbers are 1 and 8, twelve steps are required to close the necklace: 1 8 9 7 6 3 9 2 1 3 4 7 1 8 == 12 numbers necklace(0, 8) → 20 necklace(0, 0) → 1 necklace(1, 3) → 12 ...Save, Compile, Run (ctrl-enter) |
Progress graphs:
Your progress graph for this problem
Random user progress graph for this problem
Random Epic Progress Graph
Difficulty: 125
Copyright Nick Parlante 2017 - privacy