n is a positive integer base from 2 to 36 inclusively.
Each of α and β is a
nonzero digit of base n from 1 to n-1 inclusively.
Determine all possible triplets (α, β, n) such that:
(α*β)base n
----------- is a positive integer.
(α.β)base n
### For example, in base ten corresponding to (α, β) = (4, 5), we observe that:
(4*5)/(4.5) = 40/9, which is NOT a positive integer.
I found 77 such triplets, sorted here by base.
I am showing not only the triplet but also the integer, N, that the expression evaluates to.
α β base N
1 3 6 2
2 4 6 3
2 5 10 4
3 6 10 5
1 4 12 3
1 6 12 4
2 8 12 6
6 9 12 8
3 7 14 6
4 8 14 7
1 A 15 6
2 6 15 5
4 C 15 10
6 A 15 9
1 9 18 6
2 C 18 9
4 9 18 8
5 A 18 9
1 5 20 4
2 A 20 8
3 C 20 10
3 F 20 12
C G 20 15
2 7 21 6
3 I 21 14
4 E 21 12
A F 21 14
5 B 22 10
6 C 22 11
1 8 24 6
1 C 24 8
2 G 24 12
3 9 24 8
6 I 24 16
A G 24 15
6 D 26 12
7 E 26 13
1 L 28 12
2 8 28 7
3 E 28 12
4 G 28 14
6 O 28 21
F L 28 20
1 6 30 5
1 F 30 10
1 K 30 12
2 C 30 10
2 F 30 12
2 K 30 15
3 A 30 9
3 I 30 15
4 O 30 20
6 K 30 18
7 F 30 14
8 G 30 15
E L 30 20
K P 30 24
3 M 33 18
4 C 33 11
8 O 33 22
E M 33 21
8 H 34 16
9 I 34 17
1 E 35 10
2 S 35 20
2 U 35 21
6 F 35 14
C L 35 20
C U 35 28
1 C 36 9
1 I 36 12
2 9 36 8
2 O 36 18
4 I 36 16
5 K 36 18
6 R 36 24
L S 36 27
------- code
result = []
print('α β base N')
digits = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ'
for base in range(2,37):
digs = digits[:base]
for a in digs[1:]:
a10 = int(base2base(a,base,10))
for b in digs[1:]:
b10 = int(base2base(b,base,10))
prod = a10 * b10
frac = a10 + b10/base
test = prod/frac
if abs(test - round(test)) < 10**(-10):
result.append([a,b,base,round(test)])
print(a,b,' ',base,' ',round(test))
|
Posted by Larry
on 2022-07-27 10:17:21 |