login
A219651
a(n) = n minus (sum of digits in factorial base expansion of n).
23
0, 0, 1, 1, 2, 2, 5, 5, 6, 6, 7, 7, 10, 10, 11, 11, 12, 12, 15, 15, 16, 16, 17, 17, 23, 23, 24, 24, 25, 25, 28, 28, 29, 29, 30, 30, 33, 33, 34, 34, 35, 35, 38, 38, 39, 39, 40, 40, 46, 46, 47, 47, 48, 48, 51, 51, 52, 52, 53, 53, 56, 56, 57, 57, 58, 58, 61, 61
OFFSET
0,5
COMMENTS
See A007623 for the factorial base number system representation.
LINKS
FORMULA
a(n) = n - A034968(n).
MATHEMATICA
(* First run program for A007623 to define factBaseIntDs *) Table[n - Plus@@factBaseIntDs[n], {n, 0, 99}] (* Alonso del Arte, Nov 25 2012 *)
PROG
(Scheme): (define (A219651 n) (- n (A034968 n)))
(Python)
from itertools import count
def A219651(n):
c, f = 0, 1
for i in count(2):
f *= i
if f>n:
break
c += (i-1)*(n//f)
return c # Chai Wah Wu, Oct 11 2024
CROSSREFS
Bisection: A219650. Analogous sequence for binary system: A011371, for Zeckendorf expansion: A219641.
Sequence in context: A208301 A069896 A053246 * A168391 A157123 A265764
KEYWORD
nonn,base
AUTHOR
Antti Karttunen, Nov 25 2012
STATUS
approved