Friday, August 10, 2012

quick follow up to my posts on prime numbers and cosine waves

just wanted to post a quick follow-up to the entry I had about cosine waves...  taking the cosine value to a higher power just helps in math terms to guarantee the values are in an acceptable range...

when actually trying to program these functions, it is best to make use of the "floor" function to scrap any values that are between 0 and 1... this helps retain only the 1 values from the waves in the SUM, and is less taxing on the computation.

so rather than SUM(Cosine(pi*n/k)^(2^n), for k = {1,n}), utilizing SUM(FLOOR(Cosine(pi*n/k))) will yield the same results as the sigma/divisor functions.

that's all, just wanted to throw that out there in case anyone has read this and actually wants to implement it!


more details on the FLOOR function and its applications can be found here:  http://en.wikipedia.org/wiki/Floor_and_ceiling_functions

No comments:

Post a Comment