login

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”).

Triangle, T(n, k) = n*(n-k+1)/(k+1) if n mod k+1 = 0, otherwise T(n, k) = n-k+1, read by rows.
1

%I #16 Apr 08 2024 09:14:30

%S 1,2,1,3,2,1,8,3,2,1,5,4,3,2,1,18,10,4,3,2,1,7,6,5,4,3,2,1,32,7,12,5,

%T 4,3,2,1,9,24,7,6,5,4,3,2,1,50,9,8,14,6,5,4,3,2,1

%N Triangle, T(n, k) = n*(n-k+1)/(k+1) if n mod k+1 = 0, otherwise T(n, k) = n-k+1, read by rows.

%H G. C. Greubel, <a href="/A141675/b141675.txt">Rows n=1..100 of triangle, flattened</a>

%F T(n, k) = n*(n-k+1)/(k+1) if n mod k+1 = 0, otherwise T(n, k) = n-k+1.

%e Triangle begins as:

%e 1;

%e 2, 1;

%e 3, 2, 1;

%e 8, 3, 2, 1;

%e 5, 4, 3, 2, 1;

%e 18, 10, 4, 3, 2, 1;

%e 7, 6, 5, 4, 3, 2, 1;

%e 32, 7, 12, 5, 4, 3, 2, 1;

%e 9, 24, 7, 6, 5, 4, 3, 2, 1;

%e 50, 9, 8, 14, 6, 5, 4, 3, 2, 1;

%t T[n_,k_]:= (n-k+1)*If[Mod[n,k+1]==0,n/(k+1),1];

%t Table[T[n,k], {n,12}, {k,n}]//Flatten

%o (Magma)

%o A141675:= func< n,k | (n mod (k+1)) eq 0 select n*(n-k+1)/(k+1) else n-k+1 >;

%o [A141675(n,k): k in [1..n], n in [1..12]]; // _G. C. Greubel_, Apr 06 2024

%o (SageMath)

%o def A141675(n,k): return n*(n-k+1)/(k+1) if n%(k+1)==0 else n-k+1

%o flatten([[A141675(n,k) for k in range(1,n+1)] for n in range(1,13)]) # _G. C. Greubel_, Apr 06 2024

%Y Cf. A126988.

%K nonn

%O 1,2

%A _Roger L. Bagula_ and _Gary W. Adamson_, Sep 06 2008

%E Edited by _G. C. Greubel_, Apr 06 2024