login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A007623 Integers written in factorial base.
(Formerly M4678)
245

%I M4678 #118 Feb 20 2024 18:37:36

%S 0,1,10,11,20,21,100,101,110,111,120,121,200,201,210,211,220,221,300,

%T 301,310,311,320,321,1000,1001,1010,1011,1020,1021,1100,1101,1110,

%U 1111,1120,1121,1200,1201,1210,1211,1220,1221,1300,1301,1310,1311,1320,1321,2000,2001,2010

%N Integers written in factorial base.

%C Places reading from right have values (1, 2, 6, 24, 120, ...) = factorials.

%C Also the reversed inversion vectors for the list of all finite permutations in reversed lexicographic order: A055089.

%C This concatenated representation is unsatisfactory for large n (above 36287999), when coefficients of 10 or greater start to appear. For these large numbers the representation given in A108731 is better. - _N. J. A. Sloane_, Jun 04 2012

%C For n < 10*10!-1, a(n) = concatenation of n-th row of triangle in A108731. - _Reinhard Zumkeller_, Jun 04 2012

%C a(n) = A049345(n) for n=0..23. - _Reinhard Zumkeller_, Jan 05 2014

%C For n = 36288000 = 10 * 10!, the digits in factorial base are {10, 0, 0, 0, 0, 0, 0, 0, 0, 0}. - _Michael De Vlieger_, Oct 11 2015, corrected and edited by _M. F. Hasler_, Nov 27 2018

%C The alt text in xkcd comic #2835 describes "Numbers larger than about 3.6 million" to be illegal. See links. - _David Cleaver_, Sep 30 2023

%D D. E. Knuth, The Art of Computer Programming. Addison-Wesley, Reading, MA, Vol. 2, p. 192.

%D F. Smarandache, Definitions solved and unsolved problems, conjectures and theorems in number theory and geometry, edited by M. Perez, Xiquan Publishing House, 2000.

%D N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

%H M. F. Hasler (terms 0 .. 1000) & Antti Karttunen, <a href="/A007623/b007623.txt">Table of n, a(n) for n = 0..40320</a>

%H Italo J. Dejter, <a href="http://arxiv.org/abs/1012.0995">A numeral system for the middle levels</a>, arXiv:1012.0995 [math.CO], 2010-2015.

%H Italo J. Dejter, <a href="http://home.coqui.net/dejterij/acson.pdf">Dihedral-symmetry middle-levels problem via a Catalan system of numeration</a>, preprint, 2015.

%H Italo J. Dejter, <a href="/A007623/a007623.pdf">Ordering the Levels Lk and Lk+1 of B2k+1</a>, preprint, 2015-2017.

%H P. Hecht, <a href="https://dx.doi.org/10.22161/ijaers.4.6.10">Post-Quantum Cryptography: S_381 Cyclic Subgroup of High Order</a>, International Journal of Advanced Engineering Research and Science (IJAERS, 2017) Vol. 4, Issue 6, 78-86.

%H C. A. Laisant, <a href="http://www.numdam.org/item?id=BSMF_1888__16__176_0">Sur la numération factorielle, application aux permutations</a>, Bulletin de la Société Mathématique de France, 16 (1888), p. 176-183.

%H Randall Munroe, <a href="https://xkcd.com/2835/">Factorial Numbers</a>, xkcd Web Comic #2835, Sep 29 2023.

%H Wikipedia, <a href="http://en.wikipedia.org/wiki/Factoradic">Factorial base</a>

%H <a href="/index/Fa#facbase">Index entries for sequences related to factorial base representation</a>

%e a(47) = 1321 because 47 = 1*4! + 3*3! + 2*2! + 1*1!

%p a := n -> if nargs<2 then a(n,2) elif n<args[2] then n else a(iquo(n,args[2]),args[2]+1)*10+irem(n,args[2]) fi: 'a(i)'$i=0..200;

%t factBaseIntDs[n_] := Module[{m, i, len, dList, currDigit}, i = 1; While[n > i!, i++ ]; m = n; len = i; dList = Table[0, {len}]; Do[ currDigit = 0; While[m >= j!, m = m - j!; currDigit++ ]; dList[[len - j + 1]] = currDigit, {j, i, 1, -1}]; If[dList[[1]] == 0, dList = Drop[dList, 1]]; dList]; Table[FromDigits[factBaseIntDs[n]], {n, 0, 50}] (* _Alonso del Arte_, May 03 2006 *)

%t lim = 50; m = 1; While[Factorial@ m < lim, m++]; m; IntegerDigits[#, MixedRadix[Reverse@ Range[2, m]]] & /@ Range@ lim (* _Michael De Vlieger_, Oct 11 2015, Version 10.2 *)

%o (PARI) apply( a(n,p=2)=if(n<p, n, a(n\p, p+1)*10 + n%p), [0..199]) \\ _M. F. Hasler_, Mar 27 2007; minor edit Nov 26 2018

%o (Haskell)

%o a007623 n | n <= 36287999 = read $ concatMap show (a108731_row n) :: Int

%o | otherwise = error "representation would be ambiguous"

%o -- _Reinhard Zumkeller_, Jun 04 2012

%o (Scheme, R6RS standard) (define (A007623 n) (let loop ((n n) (s 0) (p 1) (i 2)) (if (zero? n) s (let ((d (mod n i))) (loop (/ (- n d) i) (+ (* p d) s) (* 10 p) (+ 1 i)))))) ;; In older Schemes use modulo instead of mod. - _Antti Karttunen_, Feb 13 2016

%o (Python)

%o def a(n, p=2): return n if n<p else a(n//p, p+1)*10 + n%p

%o print([a(n - 1) for n in range(1, 201)]) # _Indranil Ghosh_, Jun 19 2017, after PARI program

%o (APL, Dyalog dialect) A007623 ← {⍺←2 ⋄ ⍵<⍺: ⍵ ⋄ (⍺|⍵) + ((⍺+1) ∇ ⍺(⌊÷⍨)⍵)×10} ⍝ (code from Dani Adham) - _Antti Karttunen_, Feb 20 2024

%Y Cf. A000142.

%Y Cf. A034968 (sum of digits).

%Y Cf. A060130 (number of nonzero digits).

%Y Cf. A099563 (the most significant digit).

%Y Cf. also A055089, A055881, A060112, A060495. Permutation of A064039.

%Y See index entry "factorial base representation" for many more related sequences.

%Y Compare also to primorial base A049345.

%K base,nonn,nice,easy

%O 0,3

%A _N. J. A. Sloane_, _Robert G. Wilson v_, _Mira Bernstein_

%E More terms from _R. K. Guy_

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

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 25 03:15 EDT 2024. Contains 371964 sequences. (Running on oeis4.)