login
Square array A(n,k) = difference of digit sums in factorial base representations (A007623) of n and k, n>=0, k>=0, read by antidiagonals; A(n,k) = A034968(n)-A034968(k).
3

%I #13 Nov 17 2013 17:36:48

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

%T 0,2,0,0,-2,0,-2,2,1,0,1,0,-1,0,-1,-2,3,1,1,-1,1,-1,1,-1,-1,-3,3,2,1,

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

%N Square array A(n,k) = difference of digit sums in factorial base representations (A007623) of n and k, n>=0, k>=0, read by antidiagonals; A(n,k) = A034968(n)-A034968(k).

%C Equivalently, A(n,k) = the sum of differences of digits in matching positions of the factorial base representations (A007623) of n and k.

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

%F A(col,row) = A034968(col)-A034968(row). [Where col is the column and row the row index of entry A(col,row)]

%F Equally, as a sequence, a(n) = A034968(A025581(n)) - A034968(A002262(n)).

%F For each entry, A(j,i) = -A(i,j), or as a sequence, a(A061579(n)) = -a(n). [The array is symmetric up to the sign of entries]

%F Also, for each entry A(i,j), abs(A(i,j)) <= A231713(i,j).

%e The top left corner array is:

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

%e -1, 0, 0, 1, 1, 2, 0, 1, 1, 2, 2, ...

%e -1, 0, 0, 1, 1, 2, 0, 1, 1, 2, 2, ...

%e -2, -1, -1, 0, 0, 1, -1, 0, 0, 1, 1, ...

%e -2, -1, -1, 0, 0, 1, -1, 0, 0, 1, 1, ...

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

%e -1, 0, 0, 1, 1, 2, 0, 1, 1, 2, 2, ...

%e -2, -1, -1, 0, 0, 1, -1, 0, 0, 1, 1, ...

%e -2, -1, -1, 0, 0, 1, -1, 0, 0, 1, 1, ...

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

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

%e ...

%o (Scheme, two alternative versions)

%o (define (A230419 n) (- (A034968 (A025581 n)) (A034968 (A002262 n))))

%o ;; A "stand-alone" version:

%o (define (A230419 n) (A230419bi (A025581 n) (A002262 n)))

%o (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))))))))

%Y The topmost row: A034968 (and also the leftmost column negated).

%Y Cf. A230415 (similar array which gives the number of differing digits).

%Y Cf. A231713 (similar array which gives the sum of absolute differences).

%K sign,base,tabl

%O 0,7

%A _Antti Karttunen_, Nov 10 2013