P591
projecteuler.net

Best Approximations by Quadratic Integers

ℹ️Published on Saturday, 18th February 2017, 01:00 pm; Solved by 218;
Difficulty rating: 95%

Given a non-square integer d, any real x can be approximated arbitrarily close by quadratic integers a+bd, where a,b are integers. For example, the following inequalities approximate π with precision 1013:
437563619152026188084046055<π<72113331558221019836515172
We call BQAd(x,n) the quadratic integer closest to x with the absolute values of a,b not exceeding n.
We also define the integral part of a quadratic integer as Id(a+bd)=a.

You are given that:

  • BQA2(π,10)=622
  • BQA5(π,100)=26555
  • BQA7(π,106)=5603232117817
  • I2(BQA2(π,1013))=6188084046055

Find the sum of |Id(BQAd(π,1013))| for all non-square positive integers less than 100.



Soluzione

Last modified: June 14, 2025. Website built with Franklin.jl and the lovely Julia programming language.