Advertisement
FSZ

Sage MAxQ

FSZ
Jan 22nd, 2020
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. emptwob=[]
  2. def solve_pell(N,numT=100):
  3. cf=continued_fraction(sqrt( N ))
  4. for i in range (numT ):
  5. denom = cf.denominator (i )
  6. numer = cf.numerator (i )
  7. if numer^2-N*denom^2==1:
  8. return numer , denom
  9. return None , None
  10. for v in range(2,10):
  11. for j in range(4,5):
  12. for h in range(1,j-1):
  13. if h==(j-1)/2:
  14. continue
  15. d=squarefree_part((h*(j^(v)-1)/(j-1))^2-1)
  16. g=solve_pell(d)[0]
  17. t=solve_pell(d)[1]
  18. kappaa=log(solve_pell(d)[0]+(solve_pell(d)[1])*sqrt(d),j)
  19. if g+t*sqrt(d)>j:
  20.  
  21. if 6*10^(15)< denominator(continued_fraction(kappaa).convergent(49)):
  22. emptwob.append(denominator(continued_fraction(kappaa).convergent(49)))
  23. else:
  24. print(v,j,h)
  25. else:
  26. continue
  27. print(max(emptwob))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement