[go: up one dir, main page]

TOPICS
Search

Self-Counting Sequence


The sequence 1, 2, 2, 3, 3, 3, 4, 4, 4, 4, ... (OEIS A002024) consisting of 1 copy of 1, 2 copies of 2, 3 copies of 3, and so on. Surprisingly, there exist simple formulas for the nth term a(n),

a(n)=|_1/2+sqrt(2n)_|
(1)
=[1/2(sqrt(8n+1)-1)],
(2)

where |_x_| is the floor function and [x] is the ceiling function (Graham et al. 1994, p. 97). The sequence is also given by the recursive sequence

 a(n)=1+a(n-a(n-1))
(3)

(Wolfram 2002, p. 129).


Explore with Wolfram|Alpha

References

Gould, H. W. "Solution to Problem 571." Math. Mag. 38, 185-187, 1965.Graham, R. L.; Knuth, D. E.; and Patashnik, O. Exercise 3.23 in Concrete Mathematics: A Foundation for Computer Science, 2nd ed. Reading, MA: Addison-Wesley, p. 97, 1994.Sloane, N. J. A. Sequence A002024/M0250 in "The On-Line Encyclopedia of Integer Sequences."Knuth, D. E. The Art of Computer Programming, Vol. 1: Fundamental Algorithms, 3rd ed. Reading, MA: Addison-Wesley, p. 43, 1997.Wolfram, S. A New Kind of Science. Champaign, IL: Wolfram Media, 129, 2002.

Referenced on Wolfram|Alpha

Self-Counting Sequence

Cite this as:

Weisstein, Eric W. "Self-Counting Sequence." From MathWorld--A Wolfram Web Resource. https://mathworld.wolfram.com/Self-CountingSequence.html

Subject classifications