24小时热门版块排行榜    

CyRhmU.jpeg
查看: 3424  |  回复: 23
本帖产生 7 个 程序强帖 ,点击这里进行查看
当前只显示满足指定条件的回帖,点击这里查看本话题的所有回帖

libralibra

至尊木虫 (著名写手)

骠骑将军

[交流] Euler Project Q12 欧拉工程第十二题已有9人参与

Question 12:
The sequence of triangle numbers is generated by adding the natural numbers. So the 7th triangle number would be 1 + 2 + 3 + 4 + 5 + 6 + 7 = 28. The first ten terms would be:

1, 3, 6, 10, 15, 21, 28, 36, 45, 55, ...

Let us list the factors of the first seven triangle numbers:

     1: 1
     3: 1,3
     6: 1,2,3,6
    10: 1,2,5,10
    15: 1,3,5,15
    21: 1,3,7,21
    28: 1,2,4,7,14,28

We can see that 28 is the first triangle number to have over five divisors.

What is the value of the first triangle number to have over five hundred divisors?

翻译:

自然数求和可生成三角数列.第七个三角数是1 + 2 + 3 + 4 + 5 + 6 + 7 = 28.前10个三角数列元素是:
1, 3, 6, 10, 15, 21, 28, 36, 45, 55, ...

下面列出前7个三角数及其整除数:
     1: 1
     3: 1,3
     6: 1,2,3,6
    10: 1,2,5,10
    15: 1,3,5,15
    21: 1,3,7,21
    28: 1,2,4,7,14,28
可以看出,28是第一个有超过5个整除数的三角数.

那么,第一个有超过500个整除数的三角数是多少?

[ Last edited by libralibra on 2011-5-17 at 05:41 ]
回复此楼

» 猜你喜欢

» 本主题相关价值贴推荐,对您同样有帮助:

matlab/VB/python/c++/Java写程序请发QQ邮件:790404545@qq.com
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

rzhabl

新虫 (初入文坛)


小木虫: 金币+0.5, 给个红包,谢谢回帖
引用回帖:
1238961楼: Originally posted by huycwork at 2011-05-17 11:10:45
你又遍历!...

我觉得肯定是要设置算法的,如果穷举欧拉就没意思了。一分钟原则吧
22楼2012-08-03 13:47:50
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

rzhabl

新虫 (初入文坛)


小木虫: 金币+0.5, 给个红包,谢谢回帖
感谢楼上的算法,呵呵   我的程序如下
tic;
c=cumsum(1:15000);
for i=1:length(c)
    z=factor(c(i));
    s=prod(hist(z,unique(z))+1);
    if s>=500
        break;
    end
end
disp(c(i))
toc;
23楼2012-08-03 14:23:18
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
相关版块跳转 我要订阅楼主 libralibra 的主题更新
普通表情 高级回复(可上传附件)
信息提示
请填处理意见