OFFSET
0,6
LINKS
FORMULA
EXAMPLE
Columns 0-4 of rows 0 - 24 of the array:
0, 0, 0, 0, 0, ... [No matter which digit of zero we clear, it stays zero forever]
0, 1, 1, 1, 1 ... [When clearing the least significant digit (pos. 0) of one, "1", we get zero, and clearing any other digit past the most significant digit keeps one as one]
2, 0, 2, 2, 2, ... [Clearing the least significant digit of 2, "10", doesn't affect it, but clearing the digit-1 zeros the whole number].
2, 1, 3, 3, 3, ... [Clearing the least significant factorial base digit of 3 ("11") gives "10", 2, clearing the digit-1 gives "01" = 1, and clearing any digit past the most significant keeps "11" as it is, 3].
4, 0, 4, 4, 4
4, 1, 5, 5, 5
6, 6, 0, 6, 6
6, 7, 1, 7, 7
8, 6, 2, 8, 8
8, 7, 3, 9, 9
10, 6, 4, 10, 10
10, 7, 5, 11, 11
12, 12, 0, 12, 12
12, 13, 1, 13, 13
14, 12, 2, 14, 14
14, 13, 3, 15, 15
16, 12, 4, 16, 16
16, 13, 5, 17, 17
18, 18, 0, 18, 18
18, 19, 1, 19, 19
20, 18, 2, 20, 20
20, 19, 3, 21, 21
22, 18, 4, 22, 22
22, 19, 5, 23, 23
24, 24, 24, 0, 24
...
PROG
(Scheme)
(define (A275730bi n c) (let loop ((z 0) (n n) (m 2) (f 1) (c c)) (let ((d (modulo n m))) (cond ((zero? n) z) ((zero? c) (loop z (/ (- n d) m) (+ 1 m) (* f m) (- c 1))) (else (loop (+ z (* f d)) (/ (- n d) m) (+ 1 m) (* f m) (- c 1)))))))
CROSSREFS
KEYWORD
AUTHOR
Antti Karttunen, Aug 08 2016
STATUS
approved