login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A355202
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
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, 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, 0, 1, 0, 1, 1, 1, 0, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0
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
Cf. A007733, A355068 (decimal digits).
Sequence in context: A162518 A330306 A300477 * A353556 A228495 A356982
KEYWORD
base,easy,nonn,tabl
AUTHOR
STATUS
approved