yjsx86
发表于 2018-2-3 10:42:13
import itertools
from functools import reduce
it = itertools.count(1,2)
L =
while True:
if reduce(lambda x,y: x*y, L) == 135135:
print(L)
print('the minimum number is %d' % min(L))
break
L.append(next(it))
L.pop(0)
铁棍阿童木
发表于 2018-2-3 10:55:28
odd =
start = 0
end = 6
result = 1
while True:
new_odd = odd
start += 1
end += 1
for per_odd in new_odd:
result *= per_odd
if result == 135135:
print(new_odd)
print("以上连续6个奇数乘积 = " + str(result))
print("最小奇数为:" + str(min(new_odd)))
break
else:
result = 1
continue
Tannidy
发表于 2018-2-3 11:24:30
import math as m
a=135135
a=a**(1/6)
a=m.ceil(a)
if a%2==0:
a=a+1
while (a-2)*(a-4)*(a-6)*a*(a+2)*(a+4)<=135135:
if (a-2)*(a-4)*(a-6)*a*(a+2)*(a+4)==135135:
print(a-6)
break
foxiangzun
发表于 2018-2-3 14:40:11
i = 1
while i > 0 :
if i * (i + 2) * (i + 4) * (i + 6) * (i + 8) * (i + 10) == 135135 :
print(i)
break
else :
i += 2
°蓝鲤歌蓝
发表于 2018-2-3 15:07:55
x = 1
while x:
sum = 1
for i in range(x,x+6):
num = 2*i - 1
sum = sum * num
if sum == 135135:
print(2*x-1)
break
else:
# sum = 1
x = x + 1
dinyz
发表于 2018-2-3 18:33:58
本帖最后由 dinyz 于 2018-2-3 18:37 编辑
3
程序:
k = 1
a = 1
while(a):
mu=1
for i in range(k,k+12,2):
mu=mu*i
if mu == 135135:
break
k += 2
print(k)
被翻红浪
发表于 2018-2-3 23:11:34
n = 1
product = 1
while product != 135135:
product = n * (n + 2) * (n + 4) * (n + 6) * (n + 8) * (n + 10)
n += 2
print(n - 2)
4everhyhy
发表于 2018-2-4 00:17:45
学习
4everhyhy
发表于 2018-2-4 00:18:16
回复
4everhyhy
发表于 2018-2-4 00:19:04
最佳答案
cgiss
发表于 2018-2-4 09:12:33
怎么看其他鱼友的解答啊?
simplerjiang
发表于 2018-2-4 15:48:01
def math(num=135135):
for i in range(1,num):
if i % 2 == 0:
continue
all_i = i
for i2 in range(1,7):
all_i = all_i * (i+2*i2)
if all_i == num:
return i
南城顾她
发表于 2018-2-4 17:50:56
我不会想知道答案
qwe1231069
发表于 2018-2-4 19:57:06
for j in range(1,10,2):
i = j * (j+2) *(j+4) *(j+6) *(j+8) *(j+10)
if i == 135135:
print(j)
break
怎么看其他人的?
kwty
发表于 2018-2-4 20:50:38
for i in range(1,10,2):
t=1
for i in range(i,i+12,2):
t=t*i
if(t==135135):
print(i-12)
塔利班
发表于 2018-2-4 22:38:42
代码一
def cal(x):
temp=int(x**(1/6))
while temp*(temp-2)*(temp-4)*(temp-6)*(temp-8)*(temp-10)!=x:
temp+=1
return temp-10
print(cal(135135))
代码二
def Cal(n):
t=int(n**(1/6))
a=list(filter(lambda x: x*(x+2)*(x+4)*(x+6)*(x+8)*(x+10)==n,range(t-5,t)))
print(a)
Cal(135135)
Python小百
发表于 2018-2-5 10:42:09
啊,不会写,求教
shigure_takimi
发表于 2018-2-5 11:17:15
i=1
while True:
if i*(i+2)*(i+4)*(i+6)*(i+8)*(i+10)==135135:
print(i)
break
else:
i+=2
#结果:3
gkj111111
发表于 2018-2-5 12:51:15
x=0
while x<135135:
if x%2==1:
if x*(x+2)*(x+4)*(x+6)*(x+8)*(x+10)==135135:
print(x)
break
x+=1
nononoyes
发表于 2018-2-5 14:42:50
num = pow(135135,1/6)
r= int(num)
result = r
flag = True
while(flag):
for i in range(1,6):
result = result*(r+i*2)
print('result',result)
if(result==135135):
print('6个连续的奇数乘积为135135中最小的数字为:%d'%(r))
flag = False
break
if(result>135135):
r=r-2
if(result<135135):
r = r+2
result = r
result 2297295
result 675675
result 135135
6个连续的奇数乘积为135135中最小的数字为:3