OFFSET
1,2
COMMENTS
Irregular triangle read by rows T(n,k) in which row n lists the integers from n to n + n^2 - 1, with n >= 1.
LINKS
Paolo Xausa, Table of n, a(n) for n = 1..10416 (rows 1..31 of the triangle, flattened)
FORMULA
T(n,k) = n + k - 1, with n >= 1 and 1 <= k <= n^2.
EXAMPLE
Written as an irregular triangle T(n,k) the sequence begins:
n\k| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 ...
---+---------------------------------------------------------------
1 | 1;
2 | 2, 3, 4, 5;
3 | 3, 4, 5, 6, 7, 8, 9, 10, 11;
4 | 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19;
...
MAPLE
T:= n-> (t-> seq(n+i, i=0..t-1))(n^2):
seq(T(n), n=1..6); # Alois P. Heinz, Nov 05 2024
MATHEMATICA
Table[Range[n, n^2+n-1], {n, 6}] (* Paolo Xausa, Sep 05 2023 *)
PROG
(PARI) row(n) = vector(n^2, k, n+k-1); \\ Michel Marcus, Jun 08 2021
(Python)
from sympy import integer_nthroot
def A345018(n): return n-1+(k:=(m:=integer_nthroot(3*n, 3)[0])+(6*n>m*(m+1)*((m<<1)+1)))*(k*(3-(k<<1))+5)//6 # Chai Wah Wu, Nov 05 2024
CROSSREFS
KEYWORD
nonn,tabf
AUTHOR
Paolo Xausa, Jun 05 2021
STATUS
approved