login
Complement to A051731 with the identity matrix A023531 included.
2

%I #10 Mar 07 2021 17:43:32

%S 1,0,1,0,1,1,0,0,1,1,0,1,1,1,1,0,0,0,1,1,1,0,1,1,1,1,1,1,0,0,1,0,1,1,

%T 1,1,0,1,0,1,1,1,1,1,1,0,0,1,1,0,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,0,0,

%U 0,0,1,0,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1

%N Complement to A051731 with the identity matrix A023531 included.

%H G. C. Greubel, <a href="/A155029/b155029.txt">Rows n = 1..30 of the triangle, flattened</a>

%F T(n, k) = 0 if n==0 (mod k) otherwise 1 with T(n, n) = 1 and T(n, 1) = 0. - _G. C. Greubel_, Mar 07 2021

%e Table begins:

%e 1;

%e 0, 1;

%e 0, 1, 1;

%e 0, 0, 1, 1;

%e 0, 1, 1, 1, 1;

%e 0, 0, 0, 1, 1, 1;

%e 0, 1, 1, 1, 1, 1, 1;

%e 0, 0, 1, 0, 1, 1, 1, 1;

%e 0, 1, 0, 1, 1, 1, 1, 1, 1;

%t Table[If[k==n, 1, If[k==0, 0, If[Mod[n, k]==0, 0, 1]]], {n, 20}, {k, n}]//Flatten (* _G. C. Greubel_, Mar 07 2021 *)

%o (Sage) flatten([[1 if k==n else 0 if (k==0 or n%k==0) else 1 for k in [1..n]] for n in [1..20]]) # _G. C. Greubel_, Mar 07 2021

%o (Magma) [k eq n select 1 else (k eq 0 or n mod k eq 0) select 0 else 1: k in [1..n], n in [1..20]]; // _G. C. Greubel_, Mar 07 2021

%Y Cf. A023531, A051731, A155031.

%K nonn,tabl

%O 1,1

%A _Mats Granvik_, Jan 19 2009