def sum_diagnonals_spiral(N):
    """
    Problem 28, method 2 , serial:  1:1, 3:45, 5:101
    spiral 5X5 has 1+4*2+4*4 25 element, max element is 25, ele size N*N
    the upper right corner number must the N*N, the other 3 corners counter-clockwise by -(N-1)
    """
    # 
    s=1 # spiral 1
    for l in range(3,N+2,2):
        s=s+l*l  
        s=s+l*l-(l-1)
        s=s+l*l-2*(l-1)
        s=s+l*l-3*(l-1)
    print("sum of the all diag number of spriral", N, "is: ", s)
    return s