Looking for a specific periodic function

  • #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.
 
Mathematics news on Phys.org
  • #2
How about
[tex] [\ [\frac{x}{m}]-\frac{x}{m}\ ]+1[/tex]
where [ ] is floor function ?
 
Last edited:
  • #3
anuttarasammyak said:
How about
[tex] [\ [\frac{x}{m}]-\frac{x}{m}\ ]+1[/tex]
where [ ] is floor function ?
Is it mathematically sound? I generally avoid such functions because im not quite comfortable with them
 
  • #4
You may find Fourier series expression of the floor function e.g., in
https://en.wikipedia.org/wiki/Floor_and_ceiling_functions if it is your favour.

[EDIT] Explicitly our function f_m(x) is
[tex]f_m(x)=g_m(x)+\frac{1}{2}+\frac{1}{\pi}\sum_{j=1}^\infty\frac{\sin 2\pi j g_m(x)}{j}[/tex]
where
[tex]g_m(x)=-\frac{1}{2}+\frac{1}{\pi}\sum_{k=1}^\infty\frac{\sin 2\pi k \frac{x}{m}}{k}[/tex]
 
Last edited:
  • #5
In a computer program, the MOD function, MOD(n,d), will divide one natural number, n, by another natural number, d, and return the remainder. So if n is a multiple of d, it will return a 0. So the formula (MOD(n, d) == 0) should be true (one) when n is a multiple of d and false (zero) otherwise.

If you have a particular computer language in mind, we can be more specific.
 

1. How can I identify a specific periodic function?

To identify a specific periodic function, you can look for patterns in the data that repeat at regular intervals. This could include peaks and valleys, or any other consistent shape or behavior that repeats over time.

2. What tools or techniques can I use to search for a specific periodic function?

There are several tools and techniques you can use to search for a specific periodic function, including Fourier analysis, wavelet analysis, and autocorrelation. These methods can help you identify the frequency and amplitude of the periodic function.

3. How do I determine the period of a periodic function?

To determine the period of a periodic function, you can look for the length of time it takes for the function to repeat itself. This can be done by identifying the distance between peaks or valleys in the data, or by using mathematical techniques to analyze the frequency of the function.

4. Can a periodic function have multiple periods?

Yes, a periodic function can have multiple periods. This means that the function repeats itself at multiple intervals, rather than just one specific period. In this case, the function may have different frequencies and amplitudes for each period.

5. How can I use the information about a periodic function in my research or analysis?

Understanding the periodic behavior of a function can help you make predictions, identify trends, and analyze patterns in your data. This information can be valuable in a wide range of fields, including physics, engineering, finance, and many others.

Similar threads

Replies
4
Views
901
Replies
7
Views
986
  • General Math
Replies
33
Views
2K
Replies
1
Views
1K
Replies
17
Views
2K
Replies
12
Views
1K
  • General Math
Replies
7
Views
2K
  • General Math
Replies
6
Views
2K
Back
Top