题目
写出求1平方+2的平方+……+N的平方>100的最小自然数N的一个算法流程图
提问时间:2020-11-07
答案
自然数平方和是有求和公式的:
公式为:1^2+2^2+……+n^2=1/6*n(n+1)*(2n+1)
因此,只要使 1/6*n(n+1)*(2n+1)>100求解得到
即:n(n+1)*(2n+1)>600
n=6时,n(n+1)*(2n+1)=546600
所以,n的最小取值为7
公式为:1^2+2^2+……+n^2=1/6*n(n+1)*(2n+1)
因此,只要使 1/6*n(n+1)*(2n+1)>100求解得到
即:n(n+1)*(2n+1)>600
n=6时,n(n+1)*(2n+1)=546600
所以,n的最小取值为7
举一反三
我想写一篇关于奥巴马的演讲的文章,写哪一篇好呢?为什么好
奥巴马演讲不用看稿子.为什么中国领导演讲要看?
想找英语初三上学期的首字母填空练习……
英语翻译
1,人们染上烟瘾,最终因吸烟使自己丧命.
最新试题
热门考点
- 13(一)AB卷
- 2有关懒惰的 英语作文 150词
- 3Don it smell the flower
- 4若a>b,a>0,c>0,则a+b/b+c
- 5wishing you a vevy happy day filled with all the things you enioy the most.翻译.
- 6the scientist are to connect the two villages
- 7等差数列中怎样数项数,如2+4+6+.+(2n+2) 这个数列一共有多少项,那么一般的计算项数的公式是什么?XX啊
- 8有趣的推理怎么样
- 9He studied hard so that he could catch up with other(改为同义句)
- 10甲乙丙三人的画片张数比是7:5:3 ,如果甲给乙11张.乙给丙若干张后,甲乙丙三人的张数比是3:3:2,乙给丙