Posts

Showing posts from March, 2022

Solution to Ramanujan equations

RamanujanEqn Solution to Ramanujan equations ( x ) + y = 7 and x + ( y ) = 11 with Python Observation : both x and y are perfect squares below 121(11*11). ​ x 1 import math 2 sq = [ x * x for x in range ( 1 , 12 )] 3 4 for x in sq : 5 for y in sq : 6 if math . sqrt ( x ) + y == 7 and x + math . sqrt ( y ) == 11 : 7 print ( x , "," , y ) 8 #9,4 9 #https://ideone.com/2XMNUh It can be seen that x = 9 and y = 4 are the solutions.