login
This site is supported by donations to The OEIS Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A002024 n appears n times; floor(sqrt(2n) + 1/2).
(Formerly M0250 N0089)
164
1, 2, 2, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13, 13, 13 (list; table; graph; refs; listen; history; text; internal format)
OFFSET

1,2

COMMENTS

Integer inverse function of the triangular numbers A000217. The function trinv(n) = floor((1+sqrt(1+8n))/2), n>=0, gives the values 1, 2, 2, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 5, 6, ..., that is, the same sequence with offset 0. - N. J. A. Sloane, Jun 21 2009

Array T(k,n) = n+k-1 read by antidiagonals.

Eigensequence of the triangle = A001563. - Gary W. Adamson, Dec 29 2008

a(A169581(n)) = A038567(n). - Reinhard Zumkeller, Dec 02 2009

Can apparently also be defined via a(n+1)=b(n) for n>=2 where b(0)=b(1)=1 and b(n) = b(n-b(n-2))+1. Tested to be correct at least up to n<=150000. - José María Grau Ribas, Jun 10 2011

For any n >= 0, a(n+1) is the least integer m such that A000217(m)=m(m+1)/2 is larger than n. This is useful when enumerating representations of n as difference of triangular numbers; see also A234813. - M. F. Hasler, Apr 19 2014

REFERENCES

E. S. Barbeau et al., Five Hundred Mathematical Challenges, Prob. 441, pp. 41, 194. MAA 1995.

R. L. Graham, D. E. Knuth and O. Patashnik, Concrete Mathematics. Addison-Wesley, Reading, MA, 1990, p. 97.

K. Hardy & K. S. Williams, The Green Book of Mathematical Problems, p. 59, Solution to Prob. 14, Dover NY, 1985

R. Honsberger, Mathematical Morsels, pp. 133-4, MAA 1978.

J. F. Hurley, Litton's Problematical Recreations, pp. 152; 313-4 Prob. 22, VNR Co. NY 1971

D. E. Knuth, The Art of Computer Programming. Addison-Wesley, Reading, MA, Vol. 1, p. 43.

N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).

N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

S. Wolfram, A New Kind of Science, Wolfram Media, 2002; p. 129.

LINKS

Franklin T. Adams-Watters, Table of n, a(n) for n = 1..5050

Jaegug Bae, Sungjin Choi, A generalization of a subset-sum-distinct sequence, J. Korean Math. Soc. 40 (2003), no. 5, 757--768. MR1996839 (2004d:05198). See b(n).

H. T. Freitag and H. W. Gould, Solution to Problem 571, Math. Mag., 38 (1965), 185-187.

H. T. Freitag (Proposer) and H. W. Gould (Solver), Problem 571: An Ordering of the Rationals, Math. Mag., 38 (1965), 185-187 [Annotated scanned copy]

S. W. Golomb, Discrete chaos: sequences satisfying "strange" recursions, unpublished manuscript, circa 1990 [cached copy, with permission (annotated)]

Abraham Isgur, Vitaly Kuznetsov, and Stephen Tanny, A combinatorial approach for solving certain nested recursions with non-slow solutions, arXiv preprint arXiv:1202.0276, 2012

Boris Putievskiy, Transformations [Of] Integer Sequences And Pairing Functions, arXiv preprint arXiv:1212.2732, 2012.

M. A. Nyblom, Some curious sequences involving floor and ceiling functions, Am. Math. Monthly 109 (#6, 200), 559-564.

N. J. A. Sloane, Handwritten notes on Self-Generating Sequences, 1970 (note that A1148 has now become A005282)

M. Somos, Sequences used for indexing triangular or square arrays

L. J. Upton, Letter to N. J. A. Sloane, May 22 1991

Eric Weisstein's World of Mathematics, Self-Counting Sequence

Index entries for Hofstadter-type sequences

FORMULA

a(n) = floor( 1/2 + sqrt(2n) ). Also a(n) = ceil((sqrt(1+8n)-1)/2).

a((k - 1 ) * k / 2 + i) = k for k > 0 and 0 < i <= k. - Reinhard Zumkeller, Aug 30 2001

a(n) = a(n - a(n-1)) + 1, with a(1)=1. - Ian M. Levitt (ilevitt(AT)duke.poly.edu), Aug 18 2002

a(n) = round(sqrt(2n)). - Antonio G. Astudillo (afg_astudillo(AT)hotmail.com), Nov 01 2002

T(n,k) = A003602(A118413(n,k)); = T(n,k) = A001511(A118416(n,k)). - Reinhard Zumkeller, Apr 27 2006

G.f.: x/(1-x)*Product_{k>0} (1-x^(2*k))/(1-x^(2*k-1)). - Vladeta Jovovic, Oct 06 2003

Equals A127899 * A004736. - Gary W. Adamson, Feb 09 2007

a(n) = sum{i=0..n-1, A010054(i)}. - Paolo P. Lava, Apr 02 2007

Sum(Sum(T(j,i):i<=j<n+i):1<=i<=n) = A000578(n); Sum(T(n,i):1<=i<=n)=A000290(n). - Reinhard Zumkeller, Jun 24 2007

a(n)+n = A014132(n). - Vincenzo Librandi, Jul 08 2010

a(n) = ceiling( -1/2 + sqrt(2n) ). - Branko Curgus, May 12 2009

We know that a(n)=round(sqrt(2n))=round(sqrt(2*n-1)); now exist exactly a and b greater than zero, that: 2n = 2+(a+b)^2 -(a+3*b), we have: a(n)=(a+b-1) in closed formula. - Fabio Civolani (civox(AT)tiscali.it), Feb 23 2010]

A005318(n+1) = 2*A005318(n)-A205744(n), A205744(n) = A005318(A083920(n)), A083920(n) = n - a(n). - N. J. A. Sloane, Feb 11 2012

Expansion of psi(x) * x / (1 - x) in powers of x where psi() is a Ramanujan theta function. - Michael Somos, Mar 19 2014

EXAMPLE

From Clark Kimberling, Sep 16 2008: (Start)

As a rectangular array, a northwest corner:

1 2 3 4 5 6

2 3 4 5 6 7

3 4 5 6 7 8

4 5 6 7 8 9

This is the weight array (cf. A144112) of A107985 (formatted as a rectangular array). (End)

G.f. = x + 2*x^2 + 2*x^3 + 3*x^4 + 3*x^5 + 3*x^6 + 4*x^7 + 4*x^9 + 4*x^9 + 4*x^10+ ...

MAPLE

A002024 := n-> ceil((sqrt(1+8*n)-1)/2); seq(A002024(n), n=1..100);

MATHEMATICA

a[1] = 1; a[n_] := a[n] = a[n - a[n - 1]] + 1 (* Branko Curgus, May 12 2009 *)

Table[n, {n, 13}, {n}] // Flatten (* Robert G. Wilson v, May 11 2010 *)

PROG

/* The PARI functions t1, t2 can be used to read a triangular array T(n, k) (n >= 1, 1 <= k <= n) by rows from left to right: n -> T(t1(n), t2(n)).

* The PARI functions t1, t3 can be used to read a triangular array T(n, k) (n >= 1, 1 <= k <= n) by rows from right to left: n -> T(t1(n), t3(n)).

* The PARI functions t1, t4 can be used to read a triangular array T(n, k) (n >= 1, 0 <= k <= n-1) by rows from left to right: n -> T(t1(n), t4(n)).

- Michael Somos, Aug 23, 2002 */

(PARI) t1(n)=floor(1/2+sqrt(2*n)) /* A002024 = this sequence */

(PARI) t2(n)=n-binomial(floor(1/2+sqrt(2*n)), 2) /* A002260(n-1) */

(PARI) t3(n)=binomial(floor(3/2+sqrt(2*n)), 2)-n+1 /* A004736 */

(PARI) t4(n)=n-1-binomial(floor(1/2+sqrt(2*n)), 2) /* A002260(n-1)-1 */

(PARI) A002024(n)=(sqrtint(n*8)+1)\2 \\ M. F. Hasler, Apr 19 2014

(PARI) a(n)=(sqrtint(8*n-7)+1)\2

(PARI) a(n)={my(k=1); while(binomial(k+1, 2)+1<=n, k++); k} \\ R. J. Cano, Mar 17 2014

(Haskell)

a002024 n k = a002024_tabl !! (n-1) !! (k-1)

a002024_row n = a002024_tabl !! (n-1)

a002024_tabl = iterate (\xs@(x:_) -> map (+ 1) (x : xs)) [1]

a002024_list = concat a002024_tabl

a002024' = round . sqrt . (* 2) . fromIntegral

-- Reinhard Zumkeller, Jul 05 2015, Feb 12 2012, Mar 18 2011

(MAGMA) [Floor(Sqrt(2*n) + 1/2): n in [1..80]]; // Vincenzo Librandi, Nov 19 2014

CROSSREFS

a(n+1) = 1+A003056(n), A022846(n)=a(n^2), a(n+1)=A002260(n)+A025581(n).

Cf. A001462, A002262, A025581, A002260, A004736.

Cf. A003056, A127899, A004736, A107985, A001563.

A123578 is an essentially identical sequence.

Cf. A014132, A000194, A005145, A131507, A093995.

Sequence in context: A087847 A107436 * A123578 A087845 A130146 A113764

Adjacent sequences:  A002021 A002022 A002023 * A002025 A002026 A002027

KEYWORD

nonn,easy,nice,tabl

AUTHOR

N. J. A. Sloane

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Transforms | Superseeker | Recent | More pages
The OEIS Community | Maintained by The OEIS Foundation Inc.

Content is available under The OEIS End-User License Agreement .

Last modified September 10 18:27 EDT 2015. Contains 261502 sequences.