Problem: A multiple of 7 (Sample Programs)

by Jim ⌂ @, Russell, KY, Sunday, May 05, 2013, 21:23 (1603 days ago) @ lrcvs

A bit easier (and faster way to do this).

==========
t = 1 # start at one so we always have one more than (remainder 1)
do
t = t + 2 * 3 * 2 * 5 # LCM of 2,3,4,5, and 6
until t%7 = 0
print t
==========

Jim.


Complete thread:

 RSS Feed of thread

powered by my little forum