4.2.2 等差数列的前n项和公式】的更多相关文章

一.方法依据: 已知数列\(\{a_n\}\)是等差数列,首项为\(a_1\),公差为\(d\),前\(n\)项和为\(S_n\),则求\(S_n\)的最值常用方法有两种: (1).函数法:由于\(S_n=\cfrac{n(a_1+a_n)}{2}=na_1+\cfrac{n(n-1)}{2}d=\cfrac{d}{2}n^2+(a_1-\cfrac{d}{2})n\), 令\(A=\cfrac{d}{2}\),\(B=a_1-\cfrac{d}{2}\),则\(S_n=An^2+Bn\), 即…
题目: 等差数列 热度指数:1010 时间限制:1秒 空间限制:32768K 题目描述 功能: 对于等差数列 2,5,8,11,14- 输入: 正整数N >0 输出: 求等差数列前N项和 返回: 转换成功返回 0 ,非法输入与异常返回-1 输入描述: 输入一个正整数. 输出描述: 输出一个相加后的整数. 输入例子: 2 输出例子: 7 在线提交网址: http://www.nowcoder.com/practice/f792cb014ed0474fb8f53389e7d9c07f?tpId=37…
相关公式 ①等差数列的\(S_n=\cfrac{n(a_1+a_n)}{2}=na_1+\cfrac{n(n-1)\cdot d}{2}\) ②等比数列的\(S_n=\left\{\begin{array}{l}{na_1,q=1}\\{\cfrac{a_1\cdot (1-q^n)}{1-q}=\cfrac{a_1-a_nq}{1-q},q\neq 1}\end{array}\right.\) ③\(1+2+3+\cdots+ n=\cfrac{n(n+1)}{2}\): ④\(1+3+5+\…
等差数列的第n项 描述 等差数列是指从第二项起,每一项与它的前一项的差等于同一个常数的一种数列,这个常数叫做等差数列的公差.‪‬‪‬‪‬‪‬‪‬‮‬‪‬‭‬‪‬‪‬‪‬‪‬‪‬‮‬‪‬‫‬‪‬‪‬‪‬‪‬‪‬‮‬‫‬‪‬‪‬‪‬‪‬‪‬‪‬‮‬‪‬‪‬‪‬‪‬‪‬‪‬‪‬‮‬‪‬‪‬‪‬‪‬‪‬‪‬‪‬‮‬‭‬‫‬ 例如数列a: 1.4.7.10.13.16.19......公差为3‪‬‪‬‪‬‪‬‪‬‮‬‪‬‭‬‪‬‪‬‪‬‪‬‪‬‮‬‪‬‫‬‪‬‪‬‪‬‪‬‪‬‮‬‫‬‪‬‪‬‪‬‪‬‪‬‪…
等差数列 等比数列 常见的前n项和…
A - Farey Sequence Time Limit:1000MS     Memory Limit:65536KB     64bit IO Format:%I64d & %I64u Submit Status Practice POJ 2478 Description The Farey Sequence Fn for any integer n with n >= 2 is the set of irreducible rational numbers a/b with 0 &l…
求分数序列前N项和 #include <stdio.h> int main() { int i, n; double numerator, denominator, item, sum, swap; while (scanf("%d", &n) != EOF) { numerator = 2; denominator = 1; item = 0; sum = 0; for (i = 1; i <= n; i++) { item = numerator/deno…
求阶乘序列前N项和 #include <stdio.h> double fact(int n); int main() { int i, n; double item, sum; while (scanf("%d", &n) != EOF) { sum = 0; if (n <= 12) { for (i = 1; i <= n; i++) { item = fact(i); sum = sum + item; } } printf("%.0f…
求平方根序列前N项和 #include <stdio.h> #include <math.h> int main() { int i, n; double item, sum; while (scanf("%d", &n) != EOF) { sum = 0; for (i = 1; i <= n; i++) { item = sqrt(i); sum = sum+item; } printf("sum = %.2f\n", s…
求交错序列前N项和 #include <stdio.h> int main() { int numerator, denominator, flag, i, n; double item, sum; while (scanf("%d", &n) != EOF) { flag = 1; numerator = 1; denominator = 1; sum = 0; for (i = 1; i <= n; i++) { item = flag*1.0*numer…