login

Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.

Square array read by upwards antidiagonals: T(n,k) = k-th binary digit after the radix point of 1/n, for n >= 1 and k >= 1.
2

%I #15 Jun 24 2022 19:53:17

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

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

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

%N Square array read by upwards antidiagonals: T(n,k) = k-th binary digit after the radix point of 1/n, for n >= 1 and k >= 1.

%C First row is all zeros since n=1 has all zeros after the radix point in binary base 2.

%C Period of n-th row = A007733(n).

%F T(n,k) = 1 iff 2 * (2^(k-1) mod n) >= n.

%e Array begins:

%e k=1 2 3 4 5 6 7 8

%e n=1: 0, 0, 0, 0, 0, 0, 0, 0,

%e n=2: 1, 0, 0, 0, 0, 0, 0, 0,

%e n=3: 0, 1, 0, 1, 0, 1, 0, 1,

%e n=4: 0, 1, 0, 0, 0, 0, 0, 0,

%e n=5: 0, 0, 1, 1, 0, 0, 1, 1,

%e n=6: 0, 0, 1, 0, 1, 0, 1, 0,

%e n=7: 0, 0, 1, 0, 0, 1, 0, 0,

%e n=8: 0, 0, 1, 0, 0, 0, 0, 0,

%e Row n=7 is 1/7 = .001001001001..., whose digits after the radix point are 0,0,1,0,0,1,0,0, ...

%o (PARI) T(n, k) = my(r=lift(Mod(2, n)^(k-1))); 2*r>=n;

%o (Python) def T(n, k): return (2*pow(2, k-1, n)//n)

%Y Cf. A007733, A355068 (decimal digits).

%K base,easy,nonn,tabl

%O 1

%A _Chittaranjan Pardeshi_, Jun 23 2022