Just FYI, in computing 20 mod 50 = 20, not 70. Not sure if it's different in mathematics.
Yields:
Still not your solution, but it will produce non-scaled range of numbers.
PHP Code:
<?php
for($i=0;$i<10;$i++)
{
$out = ($i % 5) + 1;
echo $i . " | " . $out . "\n";
}
Yields:
Code:
0 | 1
1 | 2
2 | 3
3 | 4
4 | 5
5 | 1
6 | 2
7 | 3
8 | 4
9 | 5
Still not your solution, but it will produce non-scaled range of numbers.