(A+xB)/C = y
An algorithm to find x, when A, B, C and y are integers.
+1
–
Is there an already is such an algorithm out there, to generically and efficiently find a place where an integer summation series such as A+B+B+B+... becomes exactly divisible by some other integer C.
子カテゴリはありません。
+[概念]
+[発想]
+[企画]
Halfbakeryの[正確に]ポイントがあると思います。
「問題の説明を誤解しない限り、これは最小公倍数の問題の些細な変形のように見えます。これはいくつかのアルゴリズムで解決できます[リンク]。(A xB)/ C=yはyと同等のようです。 = LCM(A-C、B)。 "
おそらく解決策は簡単ですが、私はまだこれを検証していませんでした(後でTBD)。
I think, [notexactly] from Halfbakery has a point:
"Unless I'm misunderstanding the problem statement, this seems like a trivial variant of the least common multiple problem, which can be solved by several algorithms [link]. (A+xB)/C = y seems to me to be equivalent to y = LCM(A - C, B)."
Perhaps the solution is simple, but I had not yet verified this (TBD later).