Self-Counting Sequence

Author

Eric W. Weisstein
December 24, 2008

This notebook downloaded from http://mathworld.wolfram.com/notebooks/IntegerSequences/Self-CountingSequence.nb.

For more information, see Eric's MathWorld entry http://mathworld.wolfram.com/Self-CountingSequence.html.

©2008 Wolfram Research, Inc. except for portions noted otherwise

Sequence

Flatten[Table[Table[n,{n}],{n,6}]]

Table[Floor[1/2+Sqrt[2n]],{n,21}]

Table[Ceiling[(Sqrt[1+8n]-1)/2],{n,21}]

f[1]:=1
f[n_]:=f[n]=1+f[n-f[n-1]]

Table[f[n],{n,22}]

v4.2

RSolve[{f[n]==1+f[n-f[n-1]],f[n]==1},f[n],n]

v5.0

RSolve[{f[n]==1+f[n-f[n-1]],f[n]==1},f[n],n]

V7

RSolve[{f[n]==1+f[n-f[n-1]],f[n]==1},f[n],n]

Graphic

FilledListPlot[Table[Floor[1/2+Sqrt[2n]],{n,200}],
AxesLabel->TraditionalForm/@{n,a[n]}]