예제 #1
0
def S(x, n):
    s = 0
    for i in range(1, n + 1):
        s += Power(x, 2 * i)
    return s
예제 #2
0
def S(x, n):
    s = 0
    for i in range(1, n + 1):
        s += Power(x, n) / Factorial(n)
    return s
예제 #3
0
def IsSquare_2(n):
    return Power(n, 1/2) == int(Power(n, 1/2))
예제 #4
0
def S(x, n):
    s = 0
    for i in range(0, n):
        s += Power(x, 2 * i + 1)
    return s
예제 #5
0
def IsSquare(n):
    for i in range(1, int(math.sqrt(n))+1):
        if Power(i, 2) == n:
            return True
    return False