Header Ads

Header ADS

pratibha mam

2.find the no of integral solution for a2-b2=N

 from math import *

pf=[]

n=int(input("enter no:"))

x=n

while n%2==0:

    pf.append(2)

    n=n/2

i=3

while i<=sqrt(n):

    while n%i==0:

        n=n/i

    i=i+2

if n>2:

 pf.append(n)

print("prime factors of", x ,'are',pf )

pf1=set(pf)

nf=1

for f in pf1:

      cnt=0

      for f1 in pf:

       if f==f1:

        cnt +=1

        nf*cnt +1

print("no of factors of ",x,"=", nf)

print("no of posssible positive integral solution=",nf/2)

3.find the no of integral solution for equation

N=36

a=9

b=4

print("the value of positive number N is:",N)

print("Factor of N are :",a,b)

x=(a+b)/2

y=(a-b)/2

asqr=x**2

bsqr=y**2

print("the value of a**2 and b**2:",asqr,bsqr)

N=asqr-bsqr

print("asqr-bsqr=",N)



No comments

Powered by Blogger.