[Help] Count number of integers from 1 to n can be represented as ax + by with given positive integers n,a,b and x,y must be natural numbers

Правка en2, от Libraion, 2021-12-14 12:38:57

Given $$$n, a, b$$$ are all positive numbers $$$(1 \le a, b, n \le 10^{18})$$$.

Count how many numbers from $$$1$$$ to $$$n$$$ that can be represented as $$$a\times x + b\times y$$$ with $$$x,y \ge 0$$$ are arbitrarily non-negative integers.

I only know a $$$O(\sqrt{n})$$$ algorithm.

Thanks.

Теги diophante, number theory

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en2 Английский Libraion 2021-12-14 12:38:57 1
en1 Английский Libraion 2021-12-14 12:35:54 413 Initial revision (published)