create account

RE: Computation Contest #6 [2 SBI] by tonimontana

View this thread on: hive.blogpeakd.comecency.com

Viewing a response to: @quantumdeveloper/computation-contest-6-2-sbi

· @tonimontana · (edited)
I am a bit late but here is my solution. The equations can written like x mod 9=-5, x mod 10=-5,
x mod 11=-5...
So we just need to look for the least common multiple of 9 10 ... 128 and subtract 5. That can be done for example by iteratively computing the lcm of 2 numbers I think . My answer is 13353756090997411579403749204440236542538872688049071995
The python code is below
```python
def gcd(x, y): 
  
   while(y): 
       x, y = y, x % y 
  
   return x 
a = []  
for x in range(9,129):
    a.append(x)
lcm=1
for x in a:
    lcm=int(abs(lcm*x))//int(gcd(lcm,x))
    print(lcm%x,lcm)

for x in range(9,129):
    if((lcm-5)%x==x-5):
        pass
    else:
        print("Nope")
print(lcm-5)
👍  ,
properties (23)
authortonimontana
permlinkre-quantumdeveloper-q1p5z3
categoryprogramming
json_metadata{"tags":["programming"],"app":"steempeak/2.2.3"}
created2019-11-28 20:52:15
last_update2019-11-29 18:19:18
depth1
children0
last_payout2019-12-05 20:52:15
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length694
author_reputation4,423,485,388,975
root_title"Computation Contest #6 [2 SBI]"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id92,917,509
net_rshares8,980,847,896
author_curate_reward""
vote details (2)