Does the function $f(x,y) = ((x-1) \mod y)+1$ have an existing name?
f(1,5) = 1
f(2,5) = 2
f(3,5) = 3
f(4,5) = 4
f(5,5) = 5
f(6,5) = 1
f(7,5) = 2
MathOverflow is a question and answer site for professional mathematicians. It only takes a minute to sign up.
Sign up to join this communityDoes the function $f(x,y) = ((x-1) \mod y)+1$ have an existing name?
f(1,5) = 1
f(2,5) = 2
f(3,5) = 3
f(4,5) = 4
f(5,5) = 5
f(6,5) = 1
f(7,5) = 2
In math, as opposed to in computer science, when you apply "mod y" you land in the integers modulo y, denoted Z/yZ, not back in the integers. This means that mod 7, the symbols 1 and 8 denote the same thing, i.e. the equivalence class {...,-13,-6,1,8,15,...}.
A more computer-y way to say this is that for mathematicians, "integer mod 7" is a different kind of data class than "integer."
All this is just a long way of saying that this is probably the wrong place to ask your question.
If I were defining this function in a math paper I'd say something like "Let f(x,y) denote the unique number in {1,2,...,y} which is congruent to x modulo y" or "By the division algorithm there exists a unique number in {1,2,...,y} which is congruent to x modulo y, we denote this number f(x,y)."
Well, it's the quotient map from $\mathbb{Z}$ into $\mathbb{Z}/5\mathbb{Z}$, with the slightly unconventional relabelling of 0 as 5. Nothing much more interesting than that.
You could conceivably describe this as the "least positive residue" modulo y (as opposed to the "least non-negative residue" modulo y).
I think that my yesterday silly question implicitly gives a name to your function -- the feng shui function. To be more specific, for applying some knowledge from the feng shui system, one needs to start with his house number, say $n$, compute its sum of decimal digits, then do this again with the resulted number, and so on. The final result is a decimal digit in the range $\lbrace 1,2,\dots,9\rbrace$, namely $f(n,9)$, as you may check. If one does a similar computation in base $b$, the result is always $f(n,b-1)$. Isn't this a good reason for the name?!