login
A141675
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
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, 4, 3, 2, 1, 9, 24, 7, 6, 5, 4, 3, 2, 1, 50, 9, 8, 14, 6, 5, 4, 3, 2, 1
OFFSET
1,2
FORMULA
T(n, k) = n*(n-k+1)/(k+1) if n mod k+1 = 0, otherwise T(n, k) = n-k+1.
EXAMPLE
Triangle begins as:
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, 4, 3, 2, 1;
9, 24, 7, 6, 5, 4, 3, 2, 1;
50, 9, 8, 14, 6, 5, 4, 3, 2, 1;
MATHEMATICA
T[n_, k_]:= (n-k+1)*If[Mod[n, k+1]==0, n/(k+1), 1];
Table[T[n, k], {n, 12}, {k, n}]//Flatten
PROG
(Magma)
A141675:= func< n, k | (n mod (k+1)) eq 0 select n*(n-k+1)/(k+1) else n-k+1 >;
[A141675(n, k): k in [1..n], n in [1..12]]; // G. C. Greubel, Apr 06 2024
(SageMath)
def A141675(n, k): return n*(n-k+1)/(k+1) if n%(k+1)==0 else n-k+1
flatten([[A141675(n, k) for k in range(1, n+1)] for n in range(1, 13)]) # G. C. Greubel, Apr 06 2024
CROSSREFS
Cf. A126988.
Sequence in context: A162387 A107880 A102228 * A248809 A021473 A266756
KEYWORD
nonn
AUTHOR
EXTENSIONS
Edited by G. C. Greubel, Apr 06 2024
STATUS
approved