I need to have an result of 36 to 47 from from an input of 0 to 127 - all using the same equation.

44 Views Asked by At

Using a formula, I need to have a result between 36 and 47 - depending on the input:

the input will be an integer between 0 and 127 as follows...

  • 0, 12, 24, 36, etc MUST = 36
  • 1, 13, 25, 37, etc MUST = 37;
  • 2, 14, 26, 38, etc MUST = 38;
  • 3, 15, 27, 39, etc MUST = 39;
  • 4, 16, 28, 40, etc MUST = 40;
  • 5, 17, 29, 41, etc MUST = 41;
  • 6, 18, 30, 42, etc MUST = 42;
  • 7, 19, 31, 43, etc MUST = 43;
  • 8, 20, 32, 44, etc MUST = 44;
  • 9, 21, 33, 45, etc MUST = 45;
  • 10, 22, 34, 46, etc MUST = 46;
  • 11, 23, 35, 47, etc MUST = 47.

What is the equation?

1

There are 1 best solutions below

4
On BEST ANSWER

for an input $n$, take the remainder (residue) after reducing mod $12$, call that number $m$. Then your equation is just $36+m$