OFFSET
2
COMMENTS
T(n,k) = 1 if and only if there exists at least one pair of positive integers (x, y) such that n^x = k^y and x+y is odd. Otherwise, T(n,k) = 0.
If n is an element of A007916, then T(n,k) = 1 if and only if k is a perfect power of n^2.
FORMULA
T(d^(2x), d^(2y-1)) = 1 for all positive integers d > 1, x, y.
EXAMPLE
Triangle T(n,k) begins:
n\k 2 3 4 5 6 7 8 9 10 11 ...
2 0
3 0 0
4 1 0 0
5 0 0 0 0
6 0 0 0 0 0
7 0 0 0 0 0 0
8 0 0 1 0 0 0 0
9 0 1 0 0 0 0 0 0
10 0 0 0 0 0 0 0 0 0
11 0 0 0 0 0 0 0 0 0 0
...
If we color all positive integers whose 2-adic order and 3-adic order add up to an even number in color A and the rest in color B, every positive integer will be a different color from its double and triple. Therefore, T(3, 2) = 0.
PROG
(Python)
def T(n, k):
parity_check = [False]
i = 0
while True:
while not n % k:
n /= k
parity_check[i] = not parity_check[i]
if k % n:
return 0
elif n == 1:
x, y = True, not parity_check[0]
for j in range(1, i + 1):
x, y = y, x ^ (y and parity_check[j])
return y + 0
else:
n, k = k, n
parity_check.append(False)
i += 1
print([T(n, k) for n in range(2, 14) for k in range(2, n + 1)])
(Python)
def T(n, k):
nk = n*k
is_odd = 0
while True:
while not n % k:
n /= k
if k % n:
return 0
elif n == 1:
while not nk % k:
nk /= k
is_odd = 0 if is_odd else 1
return is_odd
else:
n, k = k, n
print([T(n, k) for n in range(2, 14) for k in range(2, n + 1)])
CROSSREFS
KEYWORD
nonn,tabl
AUTHOR
M. Eren Kesim, Jul 19 2021
STATUS
approved