A003056 n appears n+1 times. Also the array A(n,k) = n+k (n >= 0, k >= 0) read by antidiagonals. Also inverse of triangular numbers.
0, 1, 1, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12
Offset: 0
Examples
G.f. = x + x^2 + 2*x^3 + 2*x^4 + 2*x^5 + 3*x^6 + 3*x^7 + 3*x^8 + 3*x^9 + 4*x^10 + ... As triangle, the sequence starts 0; 1, 1; 2, 2, 2; 3, 3, 3, 3; 4, 4, 4, 4, 4; 5, 5, 5, 5, 5, 5; 6, 6, 6, 6, 6, 6, 6; 7, 7, 7, 7, 7, 7, 7, 7; 8, 8, 8, 8, 8, 8, 8, 8, 8; ...
Links
- Vincenzo Librandi, Table of n, a(n) for n = 0..10000
- Anna R. B. Fan, Harold R. L. Yang, and Rebecca T. Yu, On the Maximum Number of k-Hooks of Partitions of n, arXiv:1212.3505 [math.CO], 2012.
- Michael Somos, Sequences used for indexing triangular or square arrays.
Crossrefs
Programs
-
Haskell
a003056 = floor . (/ 2) . (subtract 1) . sqrt . (+ 1) . (* 8) . fromIntegral a003056_row n = replicate (n + 1) n a003056_tabl = map a003056_row [0..] a003056_list = concat $ a003056_tabl -- Reinhard Zumkeller, Aug 02 2014, Oct 17 2010
-
Magma
[Floor((Sqrt(1+8*n)-1)/2): n in [0..80]]; // Vincenzo Librandi, Oct 23 2011
-
Maple
A003056 := (n,k) -> n: # Peter Luschny, Oct 29 2011 a := [ 0 ]: for i from 1 to 15 do for j from 1 to i+1 do a := [ op(a),i ]; od: od: a; A003056 := proc(n) floor((sqrt(1+8*n)-1)/2) ; end proc: # R. J. Mathar, Jul 10 2015
-
Mathematica
f[n_] := Floor[(Sqrt[1 + 8n] - 1)/2]; Table[ f[n], {n, 0, 87}] (* Robert G. Wilson v, Oct 21 2005 *) Table[x, {x, 0, 13}, {y, 0, x}] // Flatten T[ n_, k_] := If[ n >= k >= 0, n, 0]; (* Michael Somos, Dec 22 2016 *) Flatten[Table[PadRight[{},n+1,n],{n,0,12}]] (* Harvey P. Dale, Jul 03 2021 *)
-
PARI
A003056(n)=(sqrtint(8*n+1)-1)\2 \\ M. F. Hasler, Oct 08 2011
-
PARI
t1(n)=floor(-1/2+sqrt(2+2*n)) /* A003056 */
-
PARI
t2(n)=n-binomial(floor(1/2+sqrt(2+2*n)),2) /* A002262 */
-
Python
from math import isqrt def A003056(n): return (k:=isqrt(m:=n+1<<1))+int((m<<2)>(k<<2)*(k+1)+1)-1 # Chai Wah Wu, Jul 26 2022
Formula
a(n) = floor((sqrt(1+8*n)-1)/2). - Antti Karttunen
a(n) = floor(-1/2 + sqrt(2*n+b)) with 1/4 <= b < 9/4 or a(n) = floor((sqrt(8*n+b)-1)/2) with 1 <= b < 9. - Michael A. Childers (childers_moof(AT)yahoo.com), Nov 11 2001
a(n) = f(n,0) with f(n,k) = k if n <= k, otherwise f(n-k-1, k+1). - Reinhard Zumkeller, May 23 2009
a(n) = k if k*(k+1)/2 <= n < (k+1)*(k+2)/2. - Jonathan Sondow, Dec 17 2012
G.f.: (1-x)^(-1)*Sum_{n>=1} x^(n*(n+1)/2) = (Theta_2(0,x^(1/2)) - 2*x^(1/8))/(2*x^(1/8)*(1-x)) where Theta_2 is a Jacobi Theta function. - Robert Israel, May 21 2015
a(n) = floor((A000196(1+8*n)-1)/2). - Pontus von Brömssen, Dec 10 2018
a(n+1) = a(n-a(n)) + 1, a(0) = 0. - Rok Cestnik, Dec 29 2020
Sum_{n>=1} (-1)^(n+1)/a(n) = log(2)/2 (cf. A016655). - Amiram Eldar, Sep 24 2023
G.f. as array: (x + y - 2*x*y)/((1 - x)^2*(1 - y)^2). - Stefano Spezia, Dec 20 2023 [corrected by Stefano Spezia, Apr 22 2024]
Extensions
Definition clarified by N. J. A. Sloane, Dec 08 2020
Comments