login
Square array A(i,j) = the sum of absolute values of digit differences in the matching positions of the factorial base representations of i and j, for i >= 0, j >= 0, read by antidiagonals.
5

%I #15 Jul 10 2015 20:08:35

%S 0,1,1,1,0,1,2,2,2,2,2,1,0,1,2,3,3,1,1,3,3,1,2,1,0,1,2,1,2,2,2,2,2,2,

%T 2,2,2,1,2,1,0,1,2,1,2,3,3,3,3,1,1,3,3,3,3,3,2,1,2,3,0,3,2,1,2,3,4,4,

%U 2,2,4,4,4,4,2,2,4,4,2,3,2,1,2,3,0,3,2,1,2,3,2,3,3,3,3,3,3,1,1,3,3,3,3,3,3,3,2,3,2,1,2,1,0,1,2,1,2,3,2,3

%N Square array A(i,j) = the sum of absolute values of digit differences in the matching positions of the factorial base representations of i and j, for i >= 0, j >= 0, read by antidiagonals.

%C This table relates to the factorial base representation (A007623) in a similar way as A101080 relates to the binary system. See A230415 for another analog.

%H Antti Karttunen, <a href="/A231713/b231713.txt">The first 121 antidiagonals of the table, flattened</a>

%F Each entry A(i,j) >= A230415(i,j) and also each entry A(i,j) >= abs(A230419(i,j)).

%e The top left corner of this square array begins as:

%e 0, 1, 1, 2, 2, 3, 1, 2, 2, 3, 3, ...

%e 1, 0, 2, 1, 3, 2, 2, 1, 3, 2, 4, ...

%e 1, 2, 0, 1, 1, 2, 2, 3, 1, 2, 2, ...

%e 2, 1, 1, 0, 2, 1, 3, 2, 2, 1, 3, ...

%e 2, 3, 1, 2, 0, 1, 3, 4, 2, 3, 1, ...

%e 3, 2, 2, 1, 1, 0, 4, 3, 3, 2, 2, ...

%e 1, 2, 2, 3, 3, 4, 0, 1, 1, 2, 2, ...

%e 2, 1, 3, 2, 4, 3, 1, 0, 2, 1, 3, ...

%e 2, 3, 1, 2, 2, 3, 1, 2, 0, 1, 1, ...

%e 3, 2, 2, 1, 3, 2, 2, 1, 1, 0, 2, ...

%e 3, 4, 2, 3, 1, 2, 2, 3, 1, 2, 0, ...

%e ...

%e For example, A(1,2) = A(2,1) = 2 as 1 has factorial base representation '...0001' and 2 has factorial base representation '...0010', and adding the absolute values of the digit differences, we get 1+1 = 2.

%e On the other hand, A(3,5) = A(5,3) = 1, as 3 has factorial base representation '...0011' and 5 has factorial base representation '...0021', and they differ only by their second rightmost digit, the absolute value of difference being 1.

%e Note that as A007623(6)='100' and A007623(10)='120', we have A(6,10) = A(10,6) = 2.

%o (Scheme)

%o (define (A231713 n) (A231713bi (A025581 n) (A002262 n)))

%o (define (A231713bi x y) (let loop ((x x) (y y) (i 2) (d 0)) (cond ((and (zero? x) (zero? y)) d) (else (loop (floor->exact (/ x i)) (floor->exact (/ y i)) (+ i 1) (+ d (abs (- (modulo x i) (modulo y i)))))))))

%Y The topmost row and the leftmost column: A034968.

%Y Only the lower triangular region: A231714. Related tables: A230415, A230419. Cf. also A101080, A231717.

%K nonn,base,tabl

%O 0,7

%A _Antti Karttunen_, Nov 12 2013