Clark Grayclarkgray.hashnode.dev·Dec 26, 2023The Golden SwingIn February 2019, I was first introduced to the problem golf. At what angle should you lift a golf ball into the air such that it has the maximum range during a strike? 45° ? Obviously, to complicate matters more, we should include parameters such as...27 reads#projectile
Varjinth subramaniyanmycodingjourneyy.hashnode.dev·Jun 27, 2023Project Euler Problem#30#python program to sum of all the numbers that can be written as the sum of fifth powers of their digits import unittest def digit_sum(power): if type(power)!=int or power<2: return None list1=[] for i in range(2,1000000): ...100DaysOfCode
Varjinth subramaniyanmycodingjourneyy.hashnode.dev·Jun 27, 2023Project Euler Problem#29#python program to find the no. of distinct terms are in the a power b sequence import unittest def distinct_power(num): if type(num)!=int or num<2: return None list1=[] for a in range(2,num+1): for b in range(2,num+1): ...100DaysOfCode
Varjinth subramaniyanmycodingjourneyy.hashnode.dev·Jun 27, 2023Project Euler Problem#28#python program to find the sum of diagonals of spiral number grid import unittest def spiral_dia(num): if type(num)!=int or num<1: return None list1=[] for i in range(1,num+1,2): list1.append(i*i) for i in range(1,nu...100DaysOfCode
Varjinth subramaniyanmycodingjourneyy.hashnode.dev·Jun 26, 2023Project Euler Problem#27#python program to find the product of co-efficient in quadratic formula whih give max number of primes def is_prime(n): if n <= 1 or n % 2 == 0: return False if n == 2: return True for i in range(3, int(n**(0.5) + 1), 2):...#projectEulerProblem
Varjinth subramaniyanmycodingjourneyy.hashnode.dev·Jun 17, 2023Project Euler Problem#26import unittest def max_reciprocal_cycle(num): if type(num)==float: num=int(num) if type(num)!=int or num<1: return None max_length=0 max_num=1 for i in range(2,num+1): numerator=10 remainders=...100DaysOfCode
Varjinth subramaniyanmycodingjourneyy.hashnode.dev·Jun 15, 2023Project Euler problem #25#python program with test cases to find the index of 1000 digits fibonacci number import unittest def fib_index(n): if type(n)!=int: return 'Type error' if n<1 : return None count=2 length=1 a,b=1,1 while lengt...100DaysOfCode
Varjinth subramaniyanmycodingjourneyy.hashnode.dev·Jun 14, 2023Project Euler Problem#24#python program to find the nth Lexicographic Permutations number from itertools import permutations def permutation(numbers, n): perms_list = list(permutations(numbers)) nth_permutation=(perms_list[n-1]) nth_num='' for i in nth_perm...100DaysOfCode
Varjinth subramaniyanmycodingjourneyy.hashnode.dev·Jun 4, 2023Project Euler Problem #23#Python program to find the sum of non abundant numbers with test cases import unittest def sum_divisor(num): if num<0: num*=-1 divisors_sum = 1 for i in range(2, int(num**0.5) + 1): if num % i == 0: divisors_...100DaysOfCode
Varjinth subramaniyanmycodingjourneyy.hashnode.dev·May 23, 2023Project Euler Problem#22'''pthon prgram to find alphabetical value for each name in a text file and multiply this value by its alphabetical position''' file = open('p022_names.txt', "r") file_contents = file.readlines() file.close() for line in file_contents: a=line[1:...100DaysOfCode