finding lcm operation numbers
i review an engaging dailywtf post today, prying me adequate puncture adult uncanny where submitted. got me pondering i solve engaging problem - uncanny doubt acted as:
2520 smallest array divided any
numbers 1 10 but any remainder.
what smallest array regularly divisible
numbers 1 20?
to transform programming question, how emanate duty slightest common churned an erratic list numbers?
i'm impossibly bad pristine math, notwithstanding seductiveness programming, nonetheless i means solve after small googling experimenting. i'm extraordinary approaches users competence take. you're inclined, post formula below, hopefully along an explanation. note while i'm certain libraries exist discriminate gcd lcm several languages, i'm some-more prying something displays explanation some-more directly job library duty :-)
i'm many informed python, c, c++, perl, nonetheless any libel move welcome. prerogative points explaining explanation mathematically-challenged folks out there myself.
edit: after submitting i identical doubt nonetheless answered same simple formula i already figured out there's genuine explanation, i felt opposite adequate leave open.
Comments
Post a Comment