Hardy - Ramanujan Number (Magic Number) Program in Python

Hi Friends,


Here I wrote a program to find ramanujan number though python programming 

Support us to motivate me to write more program


CODE:

inp = 30000


for i in range(1,inp+1):

    count = 0

    for j in range(1,i+1):

        if(pow(j,3) > i):

            break

        for k in range(j,i):

            if(pow(k,3) + pow(j,3) > i):

                break

            if(pow(k,3) + pow(j,3) == i):

                count = count + 1

    

    if(count == 2):

        print(i)


-------

By

PYKAR

Comments

Post a Comment

Popular posts from this blog

FLAMES CODE ON PYTHON

Count Swap for Sorting in Python