cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A230415 Square array T(i,j) giving the number of differing digits in the factorial base representations of i and j, for i >= 0, j >= 0, read by antidiagonals.

This page as a plain text file.
%I A230415 #21 Sep 09 2017 19:33:47
%S A230415 0,1,1,1,0,1,2,2,2,2,1,1,0,1,1,2,2,1,1,2,2,1,1,1,0,1,1,1,2,2,2,2,2,2,
%T A230415 2,2,2,1,2,1,0,1,2,1,2,3,3,3,3,1,1,3,3,3,3,2,2,1,2,2,0,2,2,1,2,2,3,3,
%U A230415 2,2,3,3,3,3,2,2,3,3,1,2,2,1,2,2,0,2,2,1,2,2,1,2,2,3,3,3,3,1,1,3,3,3,3,2,2,2,1,2,2,1,2,1,0,1,2,1,2,2,1,2
%N A230415 Square array T(i,j) giving the number of differing digits in the factorial base representations of i and j, for i >= 0, j >= 0, read by antidiagonals.
%C A230415 This table relates to the factorial base representation (A007623) in a somewhat similar way as A101080 relates to the binary system. See A231713 for another analog.
%H A230415 Antti Karttunen, <a href="/A230415/b230415.txt">The first 121 antidiagonals of the table, flattened</a>
%F A230415 T(n,0) = T(0,n) = A060130(n).
%F A230415 Each entry T(i,j) <= A231713(i,j).
%e A230415 The top left corner of this square array begins as:
%e A230415 0, 1, 1, 2, 1, 2, 1, 2, 2, 3, 2, ...
%e A230415 1, 0, 2, 1, 2, 1, 2, 1, 3, 2, 3, ...
%e A230415 1, 2, 0, 1, 1, 2, 2, 3, 1, 2, 2, ...
%e A230415 2, 1, 1, 0, 2, 1, 3, 2, 2, 1, 3, ...
%e A230415 1, 2, 1, 2, 0, 1, 2, 3, 2, 3, 1, ...
%e A230415 2, 1, 2, 1, 1, 0, 3, 2, 3, 2, 2, ...
%e A230415 1, 2, 2, 3, 2, 3, 0, 1, 1, 2, 1, ...
%e A230415 2, 1, 3, 2, 3, 2, 1, 0, 2, 1, 2, ...
%e A230415 2, 3, 1, 2, 2, 3, 1, 2, 0, 1, 1, ...
%e A230415 3, 2, 2, 1, 3, 2, 2, 1, 1, 0, 2, ...
%e A230415 2, 3, 2, 3, 1, 2, 1, 2, 1, 2, 0, ...
%e A230415 ...
%e A230415 For example, T(1,2) = T(2,1) = 2 as 1 has factorial base representation '...0001' and 2 has factorial base representation '...0010', and they differ by their two least significant digits.
%e A230415 On the other hand, T(3,5) = T(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.
%e A230415 Note that as A007623(6)='100' and A007623(10)='120', we have T(6,10) = T(10,6) = 1 (instead of 2 as in A231713, cf. also its Example section), as here we count only the number of differing digit positions, but ignore the magnitudes of their differences.
%t A230415 nn = 14; m = 1; While[m! < nn, m++]; m; Table[Function[w, Count[Subtract @@ Map[PadLeft[#, Max@ Map[Length, w]] &, w], k_ /; k != 0]]@ Map[IntegerDigits[#, MixedRadix[Reverse@ Range[2, m]]] &, {i - j, j}], {i, 0, nn}, {j, 0, i}] // Flatten (* _Michael De Vlieger_, Jun 27 2016, Version 10.2 *)
%o A230415 (Scheme)
%o A230415 (define (A230415 n) (A230415bi (A025581 n) (A002262 n)))
%o A230415 (define (A230415bi 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 (if (= (modulo x i) (modulo y i)) 0 1)))))))
%Y A230415 The topmost row and the leftmost column: A060130.
%Y A230415 Only the lower triangular region: A230417. Related arrays: A230419, A231713. Cf. also A101080, A084558, A230410.
%K A230415 nonn,base,tabl
%O A230415 0,7
%A A230415 _Antti Karttunen_, Nov 10 2013