A108872 Sums of ordinal references for a triangular table read by columns, top to bottom.
2, 3, 4, 4, 5, 6, 5, 6, 7, 8, 6, 7, 8, 9, 10, 7, 8, 9, 10, 11, 12, 8, 9, 10, 11, 12, 13, 14, 9, 10, 11, 12, 13, 14, 15, 16, 10, 11, 12, 13, 14, 15, 16, 17, 18, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22
Offset: 1
Examples
a(1) = (1,1) = 1 + 1 = 2 a(2) = (2,1) = 2 + 1 = 3 a(3) = (2,2) = 2 + 2 = 4 a(4) = (3,1) = 3 + 1 = 4, etc. Triangle begins: 2 3, 4 4, 5, 6 5, 6, 7, 8 6, 7, 8, 9, 10 7, 8, 9, 10, 11, 12 8, 9, 10, 11, 12, 13, 14 9, 10, 11, 12, 13, 14, 15, 16 ... - _Philippe Deléham_, Mar 26 2013
Links
- Reinhard Zumkeller, Rows n = 1..125 of triangle, flattened
- NRICH discussion thread, Floor Function Identity. [Via Wayback Machine]
Crossrefs
Programs
-
Haskell
a108872 n k = a108872_tabl !! (n-1) !! (k-1) a108872_row n = a108872_tabl !! (n-1) a108872_tabl = map (\x -> [x + 1 .. 2 * x]) [1..] -- Reinhard Zumkeller, Oct 01 2014
-
Mathematica
Flatten[ Table[i + j, {j, 1, 12}, {i, 1, j}]] (* Jean-François Alcover, Oct 07 2011 *)
-
Python
from math import isqrt def A108872(n): return n+((r:=(m:=isqrt(k:=n<<1))+(k>m*(m+1)))*(3-r)>>1) # Chai Wah Wu, Nov 08 2024
Formula
a(n) = a(i, j) = i + j
a(n) = A002024(n) + A002260(n) = floor(1/2 + sqrt(2n)) + n - (m(m+1)/2) + 1, where m = floor((sqrt(8n+1) - 1) / 2 ). The floor function may be computed directly by using the expression floor(x) = x + (arctan(cot(Pi*x)) / Pi) - 1/2 (equation from nrich.maths.org, see links).
Sum_{k=0..n} T(n,k) = A005449(n+1). - Philippe Deléham, Mar 26 2013
Extensions
Offset changed by Reinhard Zumkeller, Oct 01 2014
Comments