mozx

44100Hz - Famous Frequency

44100

This is the sampling rate (frequency) that CD-DA (Compact Disc Digital Audio) adopts.
Scilab has a command "factor" for "Integer factorization".
Here is a command and its result.
factor(44100)
2 2 3 3 5 5 7 7

These numbers are each pair of first 4 prime numbers.
Scilab also has a command "primes" to get the prime numbers.
This command gives you prime numbers not exceeding the argument.
Here is a command and its result.
primes(7)
2 3 5 7

This result is treated as an array with 4 elements.
You can use a Scilab command "prod" to multiply all elements to produce the scalar number.
prod(ans)
210

"ans" in Scilab is a special variable that contains the most recent result.
So, "ans" was containing the array with elements "2 3 5 7", and then is now containing scalar value "210".
You can also square the result by using "^" operator and "2" for exponent.
Now, you are ready to express that most famous number by the following way.
prod(primes(7))^2
44100

Or, you can square each element first by using ".^" operator like:
prod(primes(7).^2)
44100

Finally, this entry has nothing related to iOS programming...