OFFSET
1,1
COMMENTS
Used for computing A107346.
Term a(n) can be obtained by adding one to each digit of factorial base representation of n (A007623(n)) and then reinterpreting it as a kind of pseudo-factorial base representation, ignoring the fact that now some of the digits might be over the maximum allowed in that position. Please see the example section. - Antti Karttunen, Nov 29 2013
LINKS
Antti Karttunen, Table of n, a(n) for n = 1..5039
FORMULA
a(n) = A220656(n)-1 = A003422(A084558(n)+1) + A000142(A084558(n)) + A212598(n) - 1. [The original definition]
a(n) = n + A007489(A084558(n)). [The above formula reduces to this, which proves that the original Dec 17 2012 description and the new main description produce the same sequence. Essentially, we are adding to n a factorial base repunit '1...111' with as many fact.base digits as n has.] - Antti Karttunen, Nov 29 2013
EXAMPLE
1 has a factorial base representation A007623(1) = '1', as 1 = 1*1!. Incrementing the digit 1 with 1, we get 2*1! = 2, thus a(1) = 2. (Note that although '2' is not a valid factorial base representation, it doesn't matter here.)
2 has a factorial base representation '10', as 2 = 1*2! + 0*1!. Incrementing the digits by one, we get 2*2! + 1*1! = 5, thus a(2) = 5.
3 has a factorial base representation '11', as 3 = 1*2! + 1*1!. Incrementing the digits by one, we get 2*2! + 2*1! = 6, thus a(3) = 6.
MATHEMATICA
Block[{nn = 66, m = 1}, While[Factorial@ m < nn, m++]; m = MixedRadix[Reverse@ Range[2, m]]; Array[FromDigits[1 + IntegerDigits[#, m], m] &, nn]] (* Michael De Vlieger, Jan 20 2020 *)
PROG
(Scheme)
;; Standalone iterative implementation (Nov 29 2013):
(define (A220655 n) (let loop ((n n) (z 0) (i 2) (f 1)) (cond ((zero? n) z) (else (loop (quotient n i) (+ (* f (+ 1 (remainder n i))) z) (+ 1 i) (* f i))))))
;; Alternative implementation:
CROSSREFS
KEYWORD
nonn
AUTHOR
Antti Karttunen, Dec 17 2012
EXTENSIONS
Name changed by Antti Karttunen, Nov 29 2013
STATUS
approved