login
Irregular triangle T(n, k) read by rows with 1 <= k <= n: T(n, 1) = A020900(n - k + 1) - (n - k + 1) and T(n, k) = max(0, T(n - 1, k - 1) - 1) otherwise.
1

%I #7 Aug 23 2017 09:55:41

%S 1,1,1,2,3,1,3,2,4,2,1,4,3,1,5,3,2,6,4,2,1,7,5,3,1,9,6,4,2,9,8,5,3,1,

%T 9,8,7,4,2,9,8,7,6,3,1,11,8,7,6,5,2,13,10,7,6,5,4,1,12,12,9,6,5,4,3,

%U 13,11,11,8,5,4,3,2,14,12,10,10,7,4,3,2,1

%N Irregular triangle T(n, k) read by rows with 1 <= k <= n: T(n, 1) = A020900(n - k + 1) - (n - k + 1) and T(n, k) = max(0, T(n - 1, k - 1) - 1) otherwise.

%H Michael De Vlieger, <a href="/A289171/b289171.txt">Table of n, a(n) for n = 1..13692</a> (rows 1 <= n <= 250).

%F Row lengths = A107347(n + 1).

%e Triangle begins:

%e n a(n)

%e 1: 0

%e 2: 1

%e 3: 1

%e 4: 2

%e 5: 3 1

%e 6: 3 2

%e 7: 4 2 1

%e 8: 4 3 1

%e 9: 5 3 2

%e 10: 6 4 2 1

%e 11: 7 5 3 1

%e 12: 9 6 4 2

%e 13: 9 8 5 3 1

%e 14: 9 8 7 4 2

%e 15: 9 8 7 6 3 1

%e 16: 11 8 7 6 5 2

%e 17: 13 10 7 6 5 4 1

%e 18: 12 12 9 6 5 4 3

%e 19: 13 11 11 8 5 4 3 2

%e 20: 14 12 10 10 7 4 3 2 1

%e ...

%t T[n_, k_] := T[n, k] = If[k == 1, PrimePi[2 Prime@ #] - # &[n - k + 1], Max[0, T[n - 1, k - 1] - 1]]; Map[DeleteCases[#, 0] &, Table[T[n, k], {n, 20}, {k, n}]] // Flatten (* or *)

%t T[n_, k_] := T[n, k] = If[k == 1, PrimePi[2 Prime@ #] - # &[n - k + 1], Max[0, T[n - 1, k - 1] - 1]]; Table[T[n, k], {n, 60}, {k, Count[Range[# + 1, 2 # - 1] &@ Prime[n + 1], s_ /; PrimeOmega@ s == 2 && EvenQ@ s]}] // Flatten (* _Michael De Vlieger_, Jul 21 2017 *)

%Y Cf. A001221, A002110, A006530, A020900, A053669, A107347, A288813.

%K nonn,tabf,easy

%O 1,4

%A _Michael De Vlieger_, Jul 21 2017