Does someone know how to solve this C# Math Algorithm?
The control number calculates by multiplying each number in a "social security number" with changing 2 and 1 (starting with 2). Then it calculates and adds together.
The control number should be equal divided with 10 to be correct and pass.
Ex, 720310-1212 "Social security number"
7* 2 = 14 --> 1+4 2* 1 = 2 --> 2 0* 2 = 0 --> 0 3* 1 = 3 --> 3 1* 2 = 2 --> 2 0* 1 = 0 --> 0 1* 2 = 2 --> 2 2* 1 = 2 --> 2 1* 2 = 1 --> 2 2* 1 = 2 --> 2
Then add them 1+4+2+0+3+2+0+2+2+2+2 = 20
20/10 = 2 Pass!