This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#python3 | |
result = 0 | |
i = 1 | |
while i < 1000 : | |
if i % 3 == 0 or i % 5 == 0: | |
result += i | |
i += 1 | |
print(result) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#python3 | |
num1 = 0 | |
num2 = 1 | |
num3 = num1 + num2 | |
result = 0 | |
while num3 <= 4000000 : | |
num3 = num1 + num2 | |
num1 = num2 | |
num2 = num3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#python3 | |
def prime_factor(target) : | |
last_prime = 0 | |
i = 2 | |
while target != 1 : | |
while target % i == 0 : | |
last_prime = i | |
target //= i | |
i += 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#python3 | |
palindrome = [] | |
def get_palindrome(num1, num2) : | |
max_palindrome = 0 | |
num2_org = num2 | |
while num1 > (num1/10) : | |
while num2 > (num2/10) : | |
multipled_num = num1*num2 | |
if is_palindrome(multipled_num) and (max_palindrome < multipled_num): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#python3 | |
def is_devidable(num_todo, num_to_devide): | |
return num_todo % num_to_devide == 0 | |
def is_devidable_at_range(num_todo,range_from, range_to ): | |
result = True | |
for i in range(range_from, range_to): | |
if not is_devidable(num_todo, i): | |
result = False | |
break |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#python3 | |
def sum_square(range_from, range_to) : | |
sum_square = 0 | |
for i in range(range_from, range_to) : | |
sum_square += i**2 | |
return sum_square | |
def square_sum(range_from, range_to) : | |
sum = 0 | |
for i in range(range_from, range_to) : |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#python3 | |
def is_prime_num(num) : | |
for i in range(2, int(num**0.5) + 1): | |
if num % i==0: | |
return False | |
return True | |
def find_prime_num(seq_range_to) : | |
num = 3 | |
prime_seq = 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#python3 | |
def multiple_five_num(five_num) : | |
multiple = 1 | |
for i in range(0, 5) : | |
multiple = multiple * int(five_num[i]) | |
return multiple | |
def pickup_multiple_five_num(num) : | |
range_to = len(num) | |
max_num = 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def find_pita(): | |
for a in range(1, 1000): | |
for b in range(a+1, 1000): | |
c = 1000 - a - b | |
if a*a + b*b == c*c and a < b < c: | |
return a*b*c |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#python3 | |
def is_prime_num(num) : | |
for i in range(2, int(num**0.5) + 1): | |
if num % i==0: | |
return False | |
return True | |
def sum_prime_nums(range_to) : | |
prime_sum = 2+3+5+7 | |
for num in range(7, range_to+1) : |
OlderNewer