(A+xB)/C = y

An algorithm to find x, when A, B, C and y are integers.

YAML ŠALTINIS Kategorija

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.


Nėra sub-kategorijų.

Balsas (nebūtinas) (nesiųsti pranešimų) (nebūtinas)
Prašome prisijungti.

Manau, [tiksliai] iš Halfbakery turi prasmę:

"Nebent aš neteisingai suprantu problemos teiginį, tai atrodo kaip trivialus rečiausiai paplitusios daugybinės problemos variantas, kurį galima išspręsti keliais algoritmais [nuoroda]. (A xB)/C = y man atrodo lygiavertis y = LCM(A–C, B)."

Galbūt sprendimas yra paprastas, bet aš to dar nepatikrinau (TBD vėliau).

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).


Kalba