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.

A266123 Decrement by 1 all digits > 1 in factorial base representation of n and then shift it one digit right.

This page as a plain text file.
%I A266123 #9 Dec 25 2015 21:05:28
%S A266123 0,0,1,1,1,1,2,2,3,3,3,3,2,2,3,3,3,3,4,4,5,5,5,5,6,6,7,7,7,7,8,8,9,9,
%T A266123 9,9,8,8,9,9,9,9,10,10,11,11,11,11,6,6,7,7,7,7,8,8,9,9,9,9,8,8,9,9,9,
%U A266123 9,10,10,11,11,11,11,12,12,13,13,13,13,14,14,15,15,15,15,14,14,15,15,15,15,16,16,17,17,17,17,18
%N A266123 Decrement by 1 all digits > 1 in factorial base representation of n and then shift it one digit right.
%H A266123 Antti Karttunen, <a href="/A266123/b266123.txt">Table of n, a(n) for n = 0..10080</a>
%H A266123 <a href="/index/Fa#facbase">Index entries for sequences related to factorial base representation</a>
%e A266123    n     A007623(n)  [subtract 1 from digits > 1     a(n)
%e A266123        [in factorial  then shift one digit right]  [reinterpret
%e A266123              base]                                  in decimal]
%e A266123     0         0    ->      0                         =  0
%e A266123     1         1    ->      0                         =  0
%e A266123     2        10    ->      1                         =  1
%e A266123     3        11    ->      1                         =  1
%e A266123     4        20    ->      1                         =  1
%e A266123     5        21    ->      1                         =  1
%e A266123     6       100    ->     10                         =  2
%e A266123     7       101    ->     10                         =  2
%e A266123     8       110    ->     11                         =  3
%e A266123     9       111    ->     11                         =  3
%e A266123    10       120    ->     11                         =  3
%e A266123    11       121    ->     11                         =  3
%e A266123    12       200    ->     10                         =  2
%e A266123    13       201    ->     10                         =  2
%e A266123    14       210    ->     11                         =  3
%e A266123    15       211    ->     11                         =  3
%e A266123    16       220    ->     11                         =  3
%e A266123    17       221    ->     11                         =  3
%e A266123    18       300    ->     20                         =  4
%o A266123 (MIT/GNU Scheme)
%o A266123 (define (A266123 n) (let loop ((n n) (z 0) (i 2) (f 0)) (cond ((zero? n) z) (else (let ((d (remainder n i))) (loop (quotient n i) (+ z (* f (- d (if (<= d 1) 0 1)))) (+ 1 i) (if (zero? f) 1 (* f (- i 1)))))))))
%Y A266123 Cf. A007623, A257684, A266193.
%K A266123 nonn,base
%O A266123 0,7
%A A266123 _Antti Karttunen_, Dec 23 2015