OFFSET
1
COMMENTS
First row is all zeros since n=1 has all zeros after the radix point in binary base 2.
Period of n-th row = A007733(n).
FORMULA
T(n,k) = 1 iff 2 * (2^(k-1) mod n) >= n.
EXAMPLE
Array begins:
k=1 2 3 4 5 6 7 8
n=1: 0, 0, 0, 0, 0, 0, 0, 0,
n=2: 1, 0, 0, 0, 0, 0, 0, 0,
n=3: 0, 1, 0, 1, 0, 1, 0, 1,
n=4: 0, 1, 0, 0, 0, 0, 0, 0,
n=5: 0, 0, 1, 1, 0, 0, 1, 1,
n=6: 0, 0, 1, 0, 1, 0, 1, 0,
n=7: 0, 0, 1, 0, 0, 1, 0, 0,
n=8: 0, 0, 1, 0, 0, 0, 0, 0,
Row n=7 is 1/7 = .001001001001..., whose digits after the radix point are 0,0,1,0,0,1,0,0, ...
PROG
(PARI) T(n, k) = my(r=lift(Mod(2, n)^(k-1))); 2*r>=n;
(Python) def T(n, k): return (2*pow(2, k-1, n)//n)
CROSSREFS
KEYWORD
AUTHOR
Chittaranjan Pardeshi, Jun 23 2022
STATUS
approved