初学编程的必做数学题目

初学编程时,这些一定是[color=red][b]必做[/b][/color]的数学题目!

[b](1) 数字[/b]

[color=red]奇数(Odd)偶数(Even)[/color]
奇数就是不能被2整除的整数。偶数就是能被2整除的整数。

[color=red]闰年(Leap year)[/color]
能被4整除但不能被100整除,或能被400整除的年份即为闰年。

[color=red]质数(Prime Number)[/color] 也叫素数,除了1和本身以外不再有其他因数的整数。如:2、3、5、7、11、13、17、19
https://en.wikipedia.org/wiki/Prime_number
http://mathworld.wolfram.com/PrimeNumber.html

[color=red]合数(Composite number)[/color] 与质数相反,除了能被1和本身整除外,还能被其他数整除的数。如:4、6、8、9、10
https://en.wikipedia.org/wiki/Composite_number
http://mathworld.wolfram.com/CompositeNumber.html

[color=red]完美数(Perfect number)[/color] 一个数恰好等于它的因子之和。如:6=1+2+3
https://en.wikipedia.org/wiki/Perfect_number
http://mathworld.wolfram.com/PerfectNumber.html

[color=red]亲和数(Amicable number)[/color] 如果两个数,你的所有真因数之和等于我,我的所有真因数之和等于你,则我们是一对亲和数。如:(220, 284), (1184, 1210)
https://en.wikipedia.org/wiki/Amicable_numbers
http://mathworld.wolfram.com/AmicablePair.html

[color=red]回文数(Palindrome number)[/color] 一个数正读和反读是相同的整数。如:16461
https://en.wikipedia.org/wiki/Palindromic_number
http://mathworld.wolfram.com/PalindromicNumber.html

[color=red]水仙花数(Narcissistic number) [/color]一个三位数等于每个数字的n次幂之和。如:153=1^3+5^3+3^3。水仙花数共有4个,分别为:153、370、371、407。
[color=red]阿姆斯特朗数(Armstrong number)[/color] 比水仙花数范围大,不局限于三位数。
https://en.wikipedia.org/wiki/Narcissistic_number
http://mathworld.wolfram.com/NarcissisticNumber.html

[color=red]斐波那契数列(Fibonacci number)[/color] 每一个数都是它前面两个数的和。 F(n)=F(n-1)+F(n-2) 具体数列为:1,1,2,3,5,8,13,21,34,55,89,144,...
[color=red]泰波那契数列(Tribonacci number)[/color] 把斐波那契数列的概念推广至三个数。 T(n)=T(n-1)+T(n-2)+T(n-3)
https://en.wikipedia.org/wiki/Fibonacci_number
http://mathworld.wolfram.com/FibonacciNumber.html

[color=red]勾股数(Pythagorean Triple)[/color] a^2+b^2=c^2
https://en.wikipedia.org/wiki/Pythagorean_triple
http://mathworld.wolfram.com/PythagoreanTriple.html

[color=red]π[/color] PI=4*(1-1/3+1/5-1/7+1/9-1/11+1/13-1/15+...)
https://en.wikipedia.org/wiki/Pi
http://mathworld.wolfram.com/Pi.html

[color=red]调和级数(Harmonic series) [/color]H(n)=1+1/2+1/3+1/4+...+1/n
https://en.wikipedia.org/wiki/Harmonic_series_(mathematics)
http://mathworld.wolfram.com/HarmonicSeries.html

[b](2) 运算[/b]

[color=red]求和(Sum)[/color] 1+2+3+...+n
https://en.wikipedia.org/wiki/Summation
http://mathworld.wolfram.com/Sum.html

[color=red]阶乘(Factorial)[/color] n!=n*(n-1)...2*1
https://en.wikipedia.org/wiki/Factorial
http://mathworld.wolfram.com/Factorial.html

[color=red]约数(Factor/Divisor)[/color]
https://en.wikipedia.org/wiki/Divisor
http://mathworld.wolfram.com/Divisor.html

[color=red]最大公约数(GCD:Greatest Common Divisor)[/color]
https://en.wikipedia.org/wiki/Greatest_common_divisor
http://mathworld.wolfram.com/GreatestCommonDivisor.html

[color=red]最小公倍数(LCM:Lowest Common Multipl)[/color]
https://en.wikipedia.org/wiki/Least_common_multiple
http://mathworld.wolfram.com/LeastCommonMultiple.html

[b](3) 打印图形[/b]

[color=red]金字塔Pyramid、菱形Diamond[/color]
[img]http://dl2.iteye.com/upload/attachment/0126/4844/1dca8831-717e-3e00-838e-299ca0699cea.png[/img]

[color=red]箭头[/color]
[img]http://dl2.iteye.com/upload/attachment/0126/4846/6866cec8-c895-333b-9fd6-a1ced83fbf8c.png[/img]

[color=red]其他形状[/color]
[img]http://dl2.iteye.com/upload/attachment/0126/4848/d5b829eb-cd8b-3684-8973-77930edeec58.png[/img]

[color=red]帕斯卡三角(Pascal Triangle)[/color] 也叫杨辉三角
[img]http://dl2.iteye.com/upload/attachment/0126/4850/d596efa2-9d60-3eb4-8e11-069443ddc9eb.png[/img]

[color=red]九九乘法表(Multiplication Table)[/color]
[img]http://dl2.iteye.com/upload/attachment/0126/4852/65bacdb3-df29-3bff-ae96-dbb4e569637f.png[/img]
[img]http://dl2.iteye.com/upload/attachment/0126/4854/713c36e7-d3e2-3b32-b4ac-732272eba669.png[/img]

[b](4) 汉诺塔(Hanoi Tower)[/b]

有A、B和C 3跟柱子,在A上从下往上按照从小到大的顺序放着64个圆盘,以B为中介,把盘子全部移动到C上。移动过程中,要求任意盘子的下面要么没有盘子,要么只能有比它大的盘子。

https://en.wikipedia.org/wiki/Tower_of_Hanoi
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值