This site is supported by donations to The OEIS Foundation.

 Hints (Greetings from The On-Line Encyclopedia of Integer Sequences!)
 A276009 Decrement each nonzero digit by one in factorial base representation of n: a(n) = n - A276008(n). 3
 0, 0, 0, 0, 2, 2, 0, 0, 0, 0, 2, 2, 6, 6, 6, 6, 8, 8, 12, 12, 12, 12, 14, 14, 0, 0, 0, 0, 2, 2, 0, 0, 0, 0, 2, 2, 6, 6, 6, 6, 8, 8, 12, 12, 12, 12, 14, 14, 24, 24, 24, 24, 26, 26, 24, 24, 24, 24, 26, 26, 30, 30, 30, 30, 32, 32, 36, 36, 36, 36, 38, 38, 48, 48, 48, 48, 50, 50, 48, 48, 48, 48, 50, 50, 54, 54, 54, 54, 56, 56, 60, 60, 60, 60, 62, 62, 72, 72, 72, 72 (list; graph; refs; listen; history; text; internal format)
 OFFSET 0,5 LINKS Antti Karttunen, Table of n, a(n) for n = 0..40320 FORMULA a(n) = n - A276008(n). EXAMPLE For n=23 whose factorial base representation is "321", when we subtract one from each digit we get "210", the factorial base representation of 14, thus a(23) = 14. For n=37 ("1201"), when we subtract one from each digit we get "0100", thus a(37) = 6 as A007623(6) = 100. PROG (Scheme) (define (A276009 n) (- n (A276008 n))) ;; Standalone version: (define (A276009 n) (let loop ((n n) (s 0) (f 1) (i 2)) (if (zero? n) s (let ((d (modulo n i))) (if (zero? d) (loop (/ n i) s (* i f) (+ 1 i)) (loop (/ (- n d) i) (+ s (* f (- d 1))) (* i f) (+ 1 i))))))) (Python) from sympy import factorial as f def a007623(n, p=2): return n if n

0 else '0' for i in x])[::-1]     return sum([int(y[i])*f(i + 1) for i in xrange(len(y))]) print [a(n) for n in xrange(201)] # Indranil Ghosh, Jun 21 2017 CROSSREFS Cf. A007623, A276008. Cf. also A257684, A257687, A266123, A266193. Sequence in context: A227188 A037863 A163536 * A113302 A292946 A196078 Adjacent sequences:  A276006 A276007 A276008 * A276010 A276011 A276012 KEYWORD nonn,base AUTHOR Antti Karttunen, Aug 18 2016 STATUS approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

Last modified October 20 20:08 EDT 2019. Contains 328271 sequences. (Running on oeis4.)