数学题 1.fg=gf 2.fff=gg
start=int(input())
count1=0
count2=1
count3=2
m=1000000007
start1=start%m
start2=(4*start1+3)%m
start3=(4*start2+3)%m
while count1<100000 and start1!=0:
start1=(8*start1+7)%m
count1+=1
while count2<100000 and start2!=0:
start2=(8*start2+7)%m
count2+=1
while count3<100000 and start3!=0:
start3=(8*start3+7)%m
count3+=1
count=min(count1,count2,count3)
count=-1 if count==100000 else count
print(count)

本文探讨了一个涉及数学循环计算的问题,通过编程实现了一系列的数学运算,包括取模、乘法和加法,以此来寻找特定数值变化规律。通过对起始值进行多次迭代,观察其在特定次数内的变化趋势。

被折叠的 条评论
为什么被折叠?



