グラフで見える数列

Clear[a]

a[1] = 1;

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

Clear[plotdata1]

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

ListPlot[plotdata1];

suma[n_] := Sum[a[k], {k, 1, n}]

Clear[plotdata2]

plotdata2 = Table[suma[n], {n, 1, 10}]

ListPlot[plotdata2, PlotJoined  ->  True];

練習問題

Clear[b]

b[1] = 11;

b[n_] := b[n - 1] - 2

Clear[pdata1]

pdata1 = Table[b[n], {n, 1, 10}]

Clear[lp1]

lp1 = ListPlot[pdata1];

sumb[n_] := Sum[b[k], {k, 1, n}]

Clear[pdata2]

pdata2 = Table[sumb[n], {n, 1, 10}]

lp2 = ListPlot[pdata2];

Show[lp1, lp2];