Given a number n, write a program to find the sum of the largest prime factors of each of nine consecutive numbers starting from n. g(n) = f(n) + f(n+1) + f(n+2) + f(n+3) + f(n+4) + f(n+5) + f(n+6) + f(n+7) + f(n+8) where, g(n) is the sum and f(n) is the largest prime factor of n For example, g(10)=f(10)+f(11)+f(12)+f(13)+f(14)+f(15)+f(16)+f(17)+f(18)=5 + 11 + 3 + 13 + 7 + 5 + 2 + 17 + 3 =66

Given a number n, write a program to find the sum of the largest prime factors of each of nine consecutive numbers starting from n.
g(n) = f(n) + f(n+1) + f(n+2) + f(n+3) + f(n+4) + f(n+5) + f(n+6) + f(n+7) + f(n+8)
where, g(n) is the sum and f(n) is the largest prime factor of n

For example,
g(10)=f(10)+f(11)+f(12)+f(13)+f(14)+f(15)+f(16)+f(17)+f(18) 
        =5 + 11 + 3 + 13 + 7 + 5 + 2 + 17 + 3 
        =66 
 Source Code:-

No comments:

Post a Comment

Write a python function, find_correct() which accepts a dictionary and returns a list as per the rules mentioned below. The input dictionary will contain correct spelling of a word as key and the spelling provided by a contestant as the value.

Write a python function,  find_correct()  which accepts a dictionary and returns a list as per the rules mentioned below. The input diction...