P Function Algorithm
A page about the p func algorithm.
Some tuple, S, has ℓelements. The ith element is Si.
Find a function
f(λ) that equals
Sλ when evaluated at some integer between
0≥λ≥ℓ.
The bound, a(ℓ)or simply a, on the number of terms for the P function is given by:
a(ℓ)=⌈log2(log2(ℓ)+1)+1⌉ The P function:
P(a,n)=41q=1∏2a−1cos2(2qnπ) When the p function is evaluated it produces a single 1 followed by 2^(2^(a - 1) - 1) - 1 zero then the pattern repeats. This will be used to turn on-and-off terms in S because the number of zeros will always be greater than the number of elements in S.
1-D Case
There exist a function f(λ) that equals Sλ when evaluated at some integer between 0≥λ>ℓ.
f(λ)=41i=0∑ℓSiq=1∏2a−1cos2(2q(λ−i)π) N-Dimensional Generalization
This can be generalized into n-dimensions by summing different variables for each dimension.
The number of dimensions is N. The tuple being represented is labeled Sij..N, where each index corresponds to a different dimension. The tuple γis the representation of a point inside an N-dimensional cube and the value in dimension d is γd.
f(λ1,λ2,..,λN)=i=0∑ℓj=0∑ℓ..N=0∑ℓ4NSij..Nd=1∏Nq=1∏2a−1cos2(2q(λd−γd)π) The N-dimensional f function has N sums each with its own label.
Example
For example the tuple:
S=(0,2,5) f(λ)=2cos(−1/8π+1/8πλ)2cos(−1/4π+1/4πλ)2cos(−1/2π+1/2πλ)2+5cos(−1/4π+1/8πλ)2cos(−1/2π+1/4πλ)2cos(−π+1/2πλ)2 Application
The indefinite integral of this form
∫f(x)ndx={g(x)+c1,h(x)+c2,if n<0.otherwise. Can be rewritten in the form
∫f(x)ndx=α(n)g(x)+β(n)h(x)+c Where α(n) and β(n) are given by the p function with S equal to the tuple of length 2n created by the function:
s(q,n)=q2n−qn This function returns q-1 n times and zero n times when written in base q. The tuple is generated by
Si(q,n)=qis(q,n)modq Set q equal to two and the tuple becomes an on-off switch for mathematical functions. The functions a(n) and b(n) are inverses of each other.
α(n)=i=0∑nSi(2,n)P(a(n),n−i) β(n)=i=0∑nS′P(a(n),n−i) The function S′is the reverse of S. The length is known so simply changing the index of the sequence from Sito S2n−i.