OFFSET
0,2
LINKS
Antti Karttunen, Table of n, a(n) for n = 0..10080
EXAMPLE
1 has a factorial base representation A007623(1) = '1'. This shifted once left is '10', and when each digit is incremented by one, this will be '21', and 2*2! + 1*1! = 5 (also A007623(5) = '21'), thus a(1)=5.
2 has a factorial base representation '10'. This shifted once left is '100', and with each digit incremented, makes '211'. 2*3! + 1*2! + 1*1! = 15, thus a(2)=15.
PROG
(Scheme)
;; Standalone iterative implementation:
(define (A231720 n) (let loop ((n n) (z 1) (i 2) (f 2)) (cond ((zero? n) z) (else (loop (quotient n i) (+ (* f (+ 1 (remainder n i))) z) (+ 1 i) (* f (+ i 1)))))))
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Antti Karttunen, Nov 29 2013
STATUS
approved