login
A322674
Square array read by antidiagonals: T(n, k) = 1 if the digits of p = n*k in base 2 are exactly the same as the digits of p when considering the base-2 representations of n, k and p as base-10 numbers, otherwise T(n, k) = 0.
1
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
OFFSET
0
COMMENTS
As n * k = k * n, the array is symmetric.
EXAMPLE
In base 2, 1001 * 10100 = 10110100. In base 10, 1001 * 10100 = 10110100. These digits match and therefore the pairs T(9, 20) and T(20, 9) are a 1 in the sequence (at a(444) and a(455)).
In base 2, the product of 11 * 11 = 1001, whereas 11 * 11 in base 10 yields 121. T(3, 3) is the 24th pair in the sequence and the first to fail. a(24) is thus a 0.
The array begins:
1, 1, 1, 1, 1, 1, 1, 1, 1, ...
1, 1, 1, 1, 1, 1, 1, 1, 1, ...
1, 1, 1, 1, 1, 1, 1, 1, 1, ...
1, 1, 1, 0, 1, 1, 0, 0, 1, ...
1, 1, 1, 1, 1, 1, 1, 1, 1, ...
1, 1, 1, 1, 1, 0, 1, 0, 1, ...
1, 1, 1, 0, 1, 1, 0, 0, 1, ...
1, 1, 1, 0, 1, 0, 0, 0, 1, ...
1, 1, 1, 1, 1, 1, 1, 1, 1, ...
PROG
(Python)
def a322674(k):
seq = []
i = 0
while len(seq) <= k:
j = 0
while len(seq) <= k and j < i + 1:
n = i - j
m = j
decn = int(bin(n).replace('0b', ''))
decm = int(bin(m).replace('0b', ''))
binProd = bin(n * m).replace('0b', '')
decProd = str(decn * decm)
seq.append(int(binProd == decProd))
j += 1
i += 1
print(seq)
a322674(100)
(PARI) T(n, k) = fromdigits(binary(n))*fromdigits(binary(k)) == fromdigits(binary(n*k)); \\ Michel Marcus, Apr 03 2019
CROSSREFS
KEYWORD
nonn,easy,base,tabl
AUTHOR
Jan Koornstra, Jan 22 2019
STATUS
approved