OFFSET
0,7
COMMENTS
Equivalently, A(n,k) = the sum of differences of digits in matching positions of the factorial base representations (A007623) of n and k.
LINKS
Antti Karttunen, The first 121 antidiagonals of the table, flattened
FORMULA
EXAMPLE
The top left corner array is:
0, 1, 1, 2, 2, 3, 1, 2, 2, 3, 3, ...
-1, 0, 0, 1, 1, 2, 0, 1, 1, 2, 2, ...
-1, 0, 0, 1, 1, 2, 0, 1, 1, 2, 2, ...
-2, -1, -1, 0, 0, 1, -1, 0, 0, 1, 1, ...
-2, -1, -1, 0, 0, 1, -1, 0, 0, 1, 1, ...
-3, -2, -2, -1, -1, 0, -2, -1, -1, 0, 0, ...
-1, 0, 0, 1, 1, 2, 0, 1, 1, 2, 2, ...
-2, -1, -1, 0, 0, 1, -1, 0, 0, 1, 1, ...
-2, -1, -1, 0, 0, 1, -1, 0, 0, 1, 1, ...
-3, -2, -2, -1, -1, 0, -2, -1, -1, 0, 0, ...
-3, -2, -2, -1, -1, 0, -2, -1, -1, 0, 0, ...
...
PROG
(Scheme, two alternative versions)
;; A "stand-alone" version:
(define (A230419bi 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 (- (modulo x i) (modulo y i))))))))
CROSSREFS
KEYWORD
AUTHOR
Antti Karttunen, Nov 10 2013
STATUS
approved