1. 等差数列

a[1] = 5;

a[n_] := a[n - 1] + 3

Table[a[k], {k, 1, 10}]

a[16]

TableForm[Transpose[Table[{k, a[k]}, {k, 1, 10}]]]

TableForm[Table[{n, a[n]}, {n, 1, 6}]]

練習問題

Table[{k, a[k]}, {k, 1, 12}]

Table[{k, b[k]}, {k, 1, 12}]

数列の和

Sum[a[n], {n, 1, 10}]

Range[15]

Range[-5, 4]

Range[-5, 4, 2]

練習問題

Range[8, -4, -2]

練習問題

kazu = Range[100]

2 kazu  +  1

Apply[Plus, kazu]

Apply[Plus, Map[1/#&, kazu]]  // N

data = Table[a[n], {n, 1, 10}]

ListPlot[data]

<< Graphics`Graphics`

BarChart[data];

Clear[a]

a[n_] := a1 + (n - 1) d

Clear[data]

data = Solve[{a[100] == 3477, a[350] == 5227}, {a1, d}]

Table[a[n], {n, 5, 10}]  /. Flatten[data]

Clear[data]

data = {1, 2, 8, 22, 47, 86}

lp = ListPlot[data];

fn2 = Fit[data, {1, n, n^2}, n]

Plot[fn2, {n, 1, 6}];

Show[lp, %]

fn3 = Fit[data, {1, n, n^2, n^3}, n] // Rationalize

Plot[fn3, {n, 1, 6}];

Show[lp, %];

Table[fn3, {n, 1, 6}]