login
Table a(i,j) = product prime[k]^(Ei[k] AND Ej[k]) where Ei and Ej are the vectors of exponents in the prime factorizations of i and j; AND is the bitwise operation on binary representation of the exponents.
17

%I #20 Jul 07 2018 16:22:43

%S 1,1,1,1,2,1,1,1,1,1,1,1,3,1,1,1,1,1,1,1,1,1,2,1,4,1,2,1,1,1,3,1,1,3,

%T 1,1,1,2,1,1,5,1,1,2,1,1,1,1,1,1,1,1,1,1,1,1,2,1,4,1,6,1,4,1,2,1,1,1,

%U 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,7,2,1,1,1,1,1,1,1,3,1,5,1,1,1,1,5,1,3,1,1,1,2,1,4,1,2,1,8,1,2,1,4,1,2,1

%N Table a(i,j) = product prime[k]^(Ei[k] AND Ej[k]) where Ei and Ej are the vectors of exponents in the prime factorizations of i and j; AND is the bitwise operation on binary representation of the exponents.

%C Analogous to GCD, with AND replacing MIN.

%H Antti Karttunen, <a href="/A059895/b059895.txt">Table of n, a(n) for n = 1..10440; the first 144 antidiagonals of the array</a>

%F From _Antti Karttunen_, Apr 11 2017: (Start)

%F A(x,y) = A059896(x,y) / A059897(x,y).

%F A(x,y) * A059896(x,y) = A(x,y)^2 * A059897(x,y) = x*y.

%F (End)

%e The top left 18 X 18 corner of the array:

%e 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1

%e 1, 2, 1, 1, 1, 2, 1, 2, 1, 2, 1, 1, 1, 2, 1, 1, 1, 2

%e 1, 1, 3, 1, 1, 3, 1, 1, 1, 1, 1, 3, 1, 1, 3, 1, 1, 1

%e 1, 1, 1, 4, 1, 1, 1, 4, 1, 1, 1, 4, 1, 1, 1, 1, 1, 1

%e 1, 1, 1, 1, 5, 1, 1, 1, 1, 5, 1, 1, 1, 1, 5, 1, 1, 1

%e 1, 2, 3, 1, 1, 6, 1, 2, 1, 2, 1, 3, 1, 2, 3, 1, 1, 2

%e 1, 1, 1, 1, 1, 1, 7, 1, 1, 1, 1, 1, 1, 7, 1, 1, 1, 1

%e 1, 2, 1, 4, 1, 2, 1, 8, 1, 2, 1, 4, 1, 2, 1, 1, 1, 2

%e 1, 1, 1, 1, 1, 1, 1, 1, 9, 1, 1, 1, 1, 1, 1, 1, 1, 9

%e 1, 2, 1, 1, 5, 2, 1, 2, 1, 10, 1, 1, 1, 2, 5, 1, 1, 2

%e 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 11, 1, 1, 1, 1, 1, 1, 1

%e 1, 1, 3, 4, 1, 3, 1, 4, 1, 1, 1, 12, 1, 1, 3, 1, 1, 1

%e 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 13, 1, 1, 1, 1, 1

%e 1, 2, 1, 1, 1, 2, 7, 2, 1, 2, 1, 1, 1, 14, 1, 1, 1, 2

%e 1, 1, 3, 1, 5, 3, 1, 1, 1, 5, 1, 3, 1, 1, 15, 1, 1, 1

%e 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 16, 1, 1

%e 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 17, 1

%e 1, 2, 1, 1, 1, 2, 1, 2, 9, 2, 1, 1, 1, 2, 1, 1, 1, 18

%e A(864,1944) = A(2^5*3^3,2^3*3^5) = 2^(5 AND 3)* 3^(3 AND 5) = 2^1*3^1 = 6.

%t a[i_, i_] := i;

%t a[i_, j_] := Module[{f1 = FactorInteger[i], f2 = FactorInteger[j], e1, e2}, Scan[(e1[#[[1]]] = #[[2]])&, f1]; Scan[(e2[#[[1]]] = #[[2]])&, f2]; Times @@ (#^BitAnd[e1[#], e2[#]]& /@ Intersection[f1[[All, 1]], f2[[All, 1]]]) ];

%t Table[a[i - j + 1, j], {i, 1, 15}, {j, 1, i}] // Flatten (* _Jean-François Alcover_, Jun 19 2018 *)

%o (Scheme)

%o (define (A059895 n) (A059895bi (A002260 n) (A004736 n)))

%o (define (A059895bi a b) (let loop ((a a) (b b) (m 1)) (cond ((= 1 a) m) ((= 1 b) m) ((equal? (A020639 a) (A020639 b)) (loop (A028234 a) (A028234 b) (* m (expt (A020639 a) (A004198bi (A067029 a) (A067029 b)))))) ((< (A020639 a) (A020639 b)) (loop (A028234 a) b m)) (else (loop a (A028234 b) m)))))

%o ;; _Antti Karttunen_, Apr 11 2017

%Y Cf. A003985 (A004198), A003989, A028234, A059896, A059897, A067029, A267115, A284578.

%K base,easy,nonn,tabl

%O 1,5

%A _Marc LeBrun_, Feb 06 2001

%E Data section extended to 120 terms by _Antti Karttunen_, Apr 11 2017