
A Fast Algorithm to Calculate Power Sum of Natural Numbers Yuyang Zhu Department of Mathematics & Physics, Hefei University, Hefei 230601, P. R. China E-mail: [email protected] Abstract: Permutations can be represented as linear combinations of natural numbers with different powers. In this paper, its coefficient matrix and inverse matrix is derived, and the results show the coefficient matrix is a lower triangular matrix while the inverse matrix is upper triangular. Permutations of nth order are used to generate the inverse matrix. The generation function of natural numbers’ power sum is derived to calculate the power sum. Keywords: sum of natural numbers; generation matrix; generation function; Permutations MR(2000) Subject Classification 11B75, 05A15 1. Introduction The power sum of natural numbers has its applications in number theory and combinatorial mathematics. The existing algorithms of computing power sum includes recursive method, calculus of finite difference, methods of undetermined coefficients and mathematical analysis (see [1-7]). This paper proposes a new algorithm by representing permutation as the linear combinatorial of natural numbers with various powers, and deriving its related coefficient matrix. The matrix is proved to be lower triangular, and its inverse matrix is used to derive the generation function of the power sum. Finally the power sum is computed from the generation function. 2. Results n+1 The permutation Pnm+ = m( m + 1) ( m + n ) is a n +1 -th order polynomial of m with integer n+1 nn+1 coefficients, i.e. Pnm+ =m + a1 m + + an m (,,,)a12 a an Z . By denoting with Pmn+1(), the following result is straightforward to obtain: Lemma 2.1 There exists an n -th (n 1) order matrix An such that nn−1 ((),(),P12 m P m ,())( Pnn m= m , m , ,) m A . Proof Since polynomials x,,, x2 xn are linearly independent in polynomial ring P , and P12( x ), P ( x ), , Pn ( x ) are 1, 2, , n-th order polynomials of x , are also linearly independent in polynomial ring . Obviously both are maximally linear independent sets so they can mutually linear expressed, i.e. there exists an -th order matrix such that nn−1 ((),P12 x P (), x , Pnn ()) x= (, x x , ,) x A . Let xm= and the lemma is proved. Definition 2.2 Define the -th order matrix as -th order permutation generation matrix. Lemma 2.3 Let A = a be an -th order permutation generation matrix, then n ( ij )nn (i) If i++ j n 1, then aij = 0 ; (ii) If i+ j = n +1, then aij =1; (iii) If i+ j n +1 and in , then aij=( j − 1) a i j−1 + a i + 1 j −1 ; (iv) If in= , then an i=−( i 1) a n i−1 . Foundation item: Natural Science Foundation Project of Hefei University (14RC12, 12KY04ZD,2014xk08). 1 Proof According to lemma 2.1, , thus nn−1 m= P1( m ) = a 11 m + a 21 m + + an 1 m , m( m+ 1) = P ( m ) = a mnn + a m−1 + + a m , 2 12 22n 2 (2.1) nn−1 mm(+ 1) ( mn + − 1) = Pmamamn ( ) =12 n + n + + am nn . According to (2.1), if , then , (i) holds. If i+ j = n +1, then aij is an element on the secondary diagonal. According to (2.1), an1=1, a ( n− 1)2 = 1, , a 1 n = 1, then (ii) holds as well. (iii) and (iv) are proved as follows. According to (i) and (ii), since Pjj( m )= P−1 ( x )( m + j − 1) , n n−1 n − ( j − 2) n − ( j − 1) Pmamamj−1()= 1( j − 1) + 2( j − 1) + + am ( i − 1)( j − 1) + am i ( j − 1) + + am n ( j − 1) jj−−12 =a(n+ 2 − j )( j − 1) m + a ( n + 3 − j )( j − 1) m + + a n ( j − 1) m , Where a(n+ 2 − j )( j − 1) =1. Consider jj−−12 PmPmmjj( )= j−1 ( )( + − 1) = [ a ( n + 2 − j )( j − 1) ma + ( n + 3 − j )( j − 1) m + + ammj n ( j − 1) ]( + − 1) jj−1 =a(njj+−− 2 )( 1) m +[( j − 1) a ( njj +−− 2 )( 1) + a ( njj +−− 3 )( 1) ] m + [( j − 1) a ( njj +−− 3 )( 1) j−22 +a(n+ 4 − j )( j − 1)] m + + [( j − 1) a ( n − 1)( j − 1) + a n ( j − 1) ] m + ( j − 1) a n ( j − 1) m (2.2) and jj−12 Pj() m= a( njj+ 1 − ) m + a ( njj + 2 − ) m + + a ( nj − 1) m + a nj m . (2.3) nn−1 By comparing (2.2) and (2.3)((),(), P12 m P m ,())( Pnn m= m , m , ,) m A a(n+− 1 j ) j =1, a(n+− 2 j ) j =(j − 1) a(n+ 2 − j )( j − 1) + a ( n + 3 − j )( j − 1) , a(n+− 3 j ) j =(j − 1) a(n+ 3 − j )( j − 1) + a ( n + 4 − j )( j − 1) , , a(nj− 1) = (j−+ 1) a(n− 1)( j − 1) a n ( j − 1) , anj=−( j 1) a n( j− 1) . Thus (iii) and (iv) hold too. The lemma is proved. 001 01 It is straightforward to find that A = and according to lemma 2.3, A = 0 1 3 . Then 2 3 11 1 1 2 it is trivial to compute the rest: 0 0 0 0 1 0 0 0 0 0 1 0 0 0 1 0 0 0 0 1 15 0 0 0 1 10 0 0 1 6 0 0 0 1 10 85 A4 = , A5 = 0 0 1 6 35 , A = , 0i++ 1 j 3 n 111 a = 0 6 ij 0 0 1 6 35 225 0 1 3 11 50 1 1 2 6 0 1 3 11 50 274 1 1 2 6 24 1 1 2 6 24 120 + Note 1 According to lemma 2.3, n N,2 n , An−1 is a lower left submatrix of An . The first row of is a11= a 12 = = a 1(nn− 1) =0, a 1 = 1, and annn =−( 1)!. Thus from known to compute all 2 we need to compute are n − 2elements: a2n,,, a 3 n a ( n− 1) n . They are trivial to compute according to (iii) in lemma 2.3. Similar to the proof of lemma 2.3, we can prove the following theorem: −1 Theorem 2.4 Let An = ()bij n n be the inverse of -th order permutation generating matrix, then the following conclusions hold: (i) if i+ j n +1, then bij = 0 ; (ii) if , then bij =1; (iii) if ij+ ≤ n and i 1, then bij= − ib i j+1 + b i − 1 j +1; jn+ (iv) if i =1, then b1 j =−( 1) . −1 −1 Note 2 According to theorem 2.4, , An−1 is a upper right submatrix of An . The −1 n -th row of An is b2n= b 3 n = = b nn =0, b 1 n = 1. 1+n −1 −1 Since b1 1 =−( 1) , to compute An from a known An−1 , all we need to find are elements b21,,, b 31 b (n− 1)1 which are straightforward to get from (iii) of theorem 2.4. [8] ()i ()()()i i i Lemma 2.5 Let Ga{}n be the generation function of number sequence {,,,,}a01 a an (ik= 1,2, , ) .Then for any constants c12,,, c ck , kk ()()ii G{}{} ci a n= c i G a n . ii==11 nn−−11 Lemma 2.6 If (m , m , ,)((),(), m= P12 m P m ,()) Pnn m A , then nn−−11n (GmGm { }, { }, , Gm { })= ( GPmGPm {12 ( )}, { ( )}, , GPmA {nn ( )}) . b11 b 12 b 1n −1 b21 b 22 b 2n i Proof Let A = , and m= b1i P 1()()() m + b 2 i P 2 m + + b ni P n m n bn12 b n b nn n i (in= 1,2, , ) , then according to theorem 2.4, G{ m }= bji G { P j ( m )}, and j=1 n n n nn−1 (GmGm { }, { }, , Gm { })= ( bGPmj12 { j ( )}, bGPm j { j ( )}, , bGPm jn { j ( )}) j=1 j = 1 j = 1 b11 b 12 b 1n b21 b 22 b 2n = (G { P12 ( m )}, G { P ( m )}, , G { Pn ( m )}) bn12 b n b nn −1 i+= j =(G n { + P121 ( m )}, G { P ( m )}, , G { Pnn ( m )}) A . n Theorem 2.7 Let G{ Pn ( m )} be the generation function of Pnm+−1 = m( m + 1) ( m + n − 1) , then + nx! nG { PN ( m,2 n )} = . n (1− x )n+1 Proof In the case of n =1, 3 1 x G{ P ( m )}= G { m } = mxmm−1 = x x = x = . 1 2 mm==111−−xx (1 ) The theorem holds. Assuming that in the case of nk=−1 the theorem also holds, i.e. G{ Pk−1 ( m )} (kx− 1)! = , then (1− x )k xx tGPmdtk−22{ ( )}= mm ( + 1) ( mk + − 1) t m + k − dt 00k m=1 (kx− 1)! = m( m+ 1) ( m + k − 2) xm+ k −1 = x k − 1 G { P ( m )} = x k − 1 , k−1 k m=1 (1− x ) Take derivatives to both sides of the equation: k−1 kk−−21(k− 1)! x k ! x . x G{ Pk ( m )} == x kk+1 (1−−xx ) (1 ) kx! Namely G{ P ( m )} = , so the theorem also holds in the case of nk= . According to the principle k (1− x )k+1 of mathematical induction, the theorem is proved. k [8] Ga{}k Lemma 2.8 If baki= , then Gb{}k = . i=0 1− x 3. The algorithm to compute power sum of natural numbers −1 To compute the power sum, the first step is to compute the inverse matrix An of n -th order permutation generating matrix An , according to theorem 2.4 and mathematical software.
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages6 Page
-
File Size-