We will use # (1) : sum_(k=1)^n k^2=sumn^2=n/6(n+1)(2n+1),#
# (2) : sum n=n/2(n+1), and, sum a=an," for some const. a."#
Hence, #sum_(k=1)^n (k^2-4k+3),#
#=sum_(k=1)^nk^2-sum_(k=1)^n(4k)+sum_(k=1)^n3,#
#=sum n^2 - 4sum n + 3n,#
#=n/6(n+1)(2n+1)-4*n/2(n+1)+3n,#
#=n/6(n+1)(2n+1)-2n(n+1)+3n,#
#=n/6{(n+1)(2n+1)-12(n+1)+18},#
#=n/6{2n^2+3n+1-12n-12+18},#
#=n/6(2n^2-9n+7)#
#:. sum_(k=1)^n (k^2-4k+3)=n/6(n-1)(2n-7).#
Enjoy Maths.!