%I #64 Jul 07 2022 02:30:22
%S 1,2,6,3,12,12,4,18,24,18,5,24,36,36,24,6,30,48,54,48,30,7,36,60,72,
%T 72,60,36,8,42,72,90,96,90,72,42,9,48,84,108,120,120,108,84,48,10,54,
%U 96,126,144,150,144,126,96,54
%N Triangle read by rows: T(n,k) = 6*k*(n + 1 - k) for 0 < k <= n; for k = 0, T(n,0) = n + 1.
%C The row sums of the triangle provide the positive terms of A000578.
%C Similar triangles can be generated by the formula P(n,k,m) = (Q(k+1,m)-Q(k,m))*(n+1-k), where Q(i,r) = i^r-(i-1)^r, 0 < k <= n, and P(n,0,m) = n+1. T(n,k) is the case m=3, that is T(n,k) = P(n,k,3).
%C T(9,k) for 0 <= k <= 9 provides the indegrees of the 10 non-leaf nodes of the network graph of the Kaprekar Process on 3 digits when the nodes are listed in numerical order. Namely, nodes 000, 099, 198, 297, 396, 495, 594, 693, 792, and 891 have indegrees 10, 54, 96, 126, 144, 150, 144, 126, 96, 54, respectively. Result derived empirically. See "Kaprekar Network Graph for 3 Digits". - _Norman Whitehead_, May 16 2022
%H Norman Whitehead, <a href="/A276158/a276158.png">Kaprekar Network Graph for 3 Digits</a>
%H Norman Whitehead, <a href="/A276158/a276158.py.txt">Kaprekar Network Graph Node Count Verification</a>
%F Sum_{k=0..n} T(n,k) = T(n,0)^3 = A000578(n+1).
%F G.f. as triangle: (1+4*x*y + x^2*y^2)/((1-x)^2*(1-x*y)^2). - _Robert Israel_, Aug 31 2016
%F T(n,n-h) = (h+1)*A008458(n-h) for 0 <= h <= n. Therefore, the main diagonal of the triangle is A008458. - _Bruno Berselli_, Aug 31 2016
%e Triangle starts:
%e ----------------------------------------------
%e n \ k | 0 1 2 3 4 5 6 7
%e ----------------------------------------------
%e 0 | 1;
%e 1 | 2, 6;
%e 2 | 3, 12, 12;
%e 3 | 4, 18, 24, 18;
%e 4 | 5, 24, 36, 36, 24;
%e 5 | 6, 30, 48, 54, 48, 30;
%e 6 | 7, 36, 60, 72, 72, 60, 36;
%e 7 | 8, 42, 72, 90, 96, 90, 72, 42;
%e ...
%p T:= (n, k) -> `if`(k=0, n+1, 6*k*(n+1-k)):
%p seq(seq(T(n, k), k=0..n), n=0..30); # _Robert Israel_, Aug 31 2016
%t Table[If[k == 0, n + 1, 6 k (n + 1 - k)], {n, 0, 10}, {k, 0, n}] // Flatten (* _Michael De Vlieger_, Aug 25 2016 *)
%o (PARI) T(n, k) = if (k==0, n+1, 6*k*(n+1-k));
%o tabl(nn) = for (n=0, nn, for (k=0, n, print1(T(n, k), ", ")); print); \\ _Michel Marcus_, Aug 25 2016
%o (Magma) [IsZero(k) select n+1 else 6*k*(n+1-k): k in [0..n], n in [0..10]]; // _Bruno Berselli_, Aug 31 2016
%o (Magma) /* As triangle (see the second comment): */ m:=3; Q:=func<i, r | i^r-(i-1)^r>; P:=func<n, k, m | IsZero(k) select n+1 else (Q(k+1, m)-Q(k, m))*(n+1-k)>; [[P(n, k, m): k in [0..n]]: n in [0..10]]; // _Bruno Berselli_, Aug 31 2016
%Y Cf. A000578, A008458, A276189.
%K nonn,tabl
%O 0,2
%A _Stefano Maruelli_, Aug 22 2016
%E Corrected and rewritten by _Bruno Berselli_, Sep 01 2016