Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).
%I #31 Nov 05 2024 09:13:43
%S 1,2,3,4,5,3,4,5,6,7,8,9,10,11,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,
%T 19,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,
%U 28,29,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41
%N For each n, append to the sequence n^2 consecutive integers, starting from n.
%C 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.
%H Paolo Xausa, <a href="/A345018/b345018.txt">Table of n, a(n) for n = 1..10416</a> (rows 1..31 of the triangle, flattened)
%F T(n,k) = n + k - 1, with n >= 1 and 1 <= k <= n^2.
%e Written as an irregular triangle T(n,k) the sequence begins:
%e n\k| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 ...
%e ---+---------------------------------------------------------------
%e 1 | 1;
%e 2 | 2, 3, 4, 5;
%e 3 | 3, 4, 5, 6, 7, 8, 9, 10, 11;
%e 4 | 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19;
%e ...
%p T:= n-> (t-> seq(n+i, i=0..t-1))(n^2):
%p seq(T(n), n=1..6); # _Alois P. Heinz_, Nov 05 2024
%t Table[Range[n,n^2+n-1],{n,6}] (* _Paolo Xausa_, Sep 05 2023 *)
%o (PARI) row(n) = vector(n^2, k, n+k-1); \\ _Michel Marcus_, Jun 08 2021
%o (Python)
%o from sympy import integer_nthroot
%o 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
%Y Column 1: A000027.
%Y Right border: A028387.
%Y Row lengths: A000290.
%Y Row sums: A255499.
%Y Cf. A064866, A074279.
%K nonn,tabf
%O 1,2
%A _Paolo Xausa_, Jun 05 2021