- #1
al4n
- 17
- 0
- TL;DR Summary
- Trying to come up with a function that outputs 1 when input is some multiple of a given number and outputs 0 if otherwise.
Is there a function that outputs a 1 when the input is a multiple of a number of your choice and 0 if otherwise. The input is also restricted to natural numbers.
The only thing I can come up with is something of the form:
f(x) = [sin(ax)+1]/2
but this does not output a 0 when I want it.
The only thing I can come up with is something of the form:
f(x) = [sin(ax)+1]/2
but this does not output a 0 when I want it.