login
Triangle read by rows: each row is an initial segment of the terms of A000123 followed by its reflection.
1

%I #12 Mar 14 2017 05:42:02

%S 1,1,1,1,2,1,1,2,2,1,1,2,4,2,1,1,2,4,4,2,1,1,2,4,6,4,2,1,1,2,4,6,6,4,

%T 2,1,1,2,4,6,10,6,4,2,1,1,2,4,6,10,10,6,4,2,1,1,2,4,6,10,14,10,6,4,2,

%U 1,1,2,4,6,10,14,14,10,6,4,2,1,1,2,4,6,10,14,20,14,10,6,4,2,1

%N Triangle read by rows: each row is an initial segment of the terms of A000123 followed by its reflection.

%C Triangle read by rows: each row is an initial segment of the terms of A000123 followed by its reflection.

%H Indranil Ghosh, <a href="/A238392/b238392.txt">Rows 0..125, flattened</a>

%F T(n,k) = A000123(min(k,n-k)).

%F Sum_{k=0..n} T(n,k) = A000123(n).

%F T(2*n,n) = A000123(n).

%e Triangle begins:

%e 1;

%e 1, 1;

%e 1, 2, 1;

%e 1, 2, 2, 1;

%e 1, 2, 4, 2, 1;

%e 1, 2, 4, 4, 2, 1;

%e 1, 2, 4, 6, 4, 2, 1;

%e 1, 2, 4, 6, 6, 4, 2, 1;

%e 1, 2, 4, 6, 10, 6, 4, 2, 1;

%e 1, 2, 4, 6, 10, 10, 6, 4, 2, 1;

%e 1, 2, 4, 6, 10, 14, 10, 6, 4, 2, 1;

%e 1, 2, 4, 6, 10, 14, 14, 10, 6, 4, 2, 1;

%e 1, 2, 4, 6, 10, 14, 20, 14, 10, 6, 4, 2, 1;

%e 1, 2, 4, 6, 10, 14, 20, 20, 14, 10, 6, 4, 2, 1;

%t a[n_] := If[n==0, 1, a[n - 1] + a[Floor[n/2]]]; Flatten[Table[a[Min[k, n - k]], {n, 0, 13}, {k, 0, n}]] (* _Indranil Ghosh_, Mar 14 2017 *)

%o (PARI) a(n) = if(n==0, 1, a(n-1) + a(floor(n/2)));

%o tabl(nn) = {for(n=0, nn, for(k=0, n, print1(a(min(k, n - k)),", ");); print(););};

%o tabl(13); \\ _Indranil Ghosh_, Mar 14 2017

%o (Python)

%o def a(n): return 1 if n==0 else a(n - 1) + a(n/2)

%o i=0

%o for n in range(0,126):

%o ....for k in range(0, n+1):

%o ........print str(i)+" "+str(a(min(k, n - k)))

%o ........i+=1 # _Indranil Ghosh_, Mar 14 2017

%Y Cf. A000123, A004197.

%K easy,nonn,tabl

%O 0,5

%A _Philippe Deléham_, Feb 26 2014