cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

Showing 1-3 of 3 results.

A084558 a(0) = 0; for n >= 1: a(n) = largest m such that n >= m!.

Original entry on oeis.org

0, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5
Offset: 0

Views

Author

Antti Karttunen, Jun 23 2003

Keywords

Comments

For n >= 1, a(n) = the number of significant digits in n's factorial base representation (A007623).
After zero, which occurs once, each n occurs A001563(n) times.
Number of iterations (...(f_4(f_3(f_2(n))))...) such that the result is < 1, where f_j(x):=x/j. - Hieronymus Fischer, Apr 30 2012
For n > 0: a(n) = length of row n in table A108731. - Reinhard Zumkeller, Jan 05 2014

Examples

			a(4) = 2 because 2! <= 4 < 3!.
		

References

  • F. Smarandache, "f-Inferior and f-Superior Functions - Generalization of Floor Functions", Arizona State University, Special Collections.

Crossrefs

Programs

  • Haskell
    a084558 n = a090529 (n + 1) - 1  -- Reinhard Zumkeller, Jan 05 2014
    
  • Maple
    0, seq(m$(m*m!),m=1..5); # Robert Israel, Apr 27 2015
  • Mathematica
    Table[m = 1; While[m! <= n, m++]; m - 1, {n, 0, 104}] (* Jayanta Basu, May 24 2013 *)
    Table[Floor[Last[Reduce[x! == n && x > 0, x]]], {n, 120}] (* Eric W. Weisstein, Sep 13 2024 *)
  • PARI
    a(n)={my(m=0);while(n\=m++,);m-1} \\ R. J. Cano, Apr 09 2018
    
  • Python
    def A084558(n):
      i=1
      while n: i+=1; n//=i
      return(i-1)
    print(list(map(A084558,range(101)))) # Natalia L. Skirrow, May 28 2023

Formula

From Hieronymus Fischer, Apr 30 2012: (Start)
a(n!) = a((n-1)!)+1, for n>1.
G.f.: 1/(1-x)*Sum_{k>=1} x^(k!).
The explicit first terms of the g.f. are: (x+x^2+x^6+x^24+x^120+x^720...)/(1-x).
(End)
Other identities:
For all n >= 0, a(n) = A090529(n+1) - 1. - Reinhard Zumkeller, Jan 05 2014
For all n >= 1, a(n) = A060130(n) + A257510(n). - Antti Karttunen, Apr 27 2015
a(n) ~ log(n^2/(2*Pi)) / (2*LambertW(log(n^2/(2*Pi))/(2*exp(1)))) - 1/2. - Vaclav Kotesovec, Aug 22 2025

Extensions

Name clarified by Antti Karttunen, Apr 27 2015

A108911 Difference between n and the sum of the factorials of its digits.

Original entry on oeis.org

0, 0, -3, -20, -115, -714, -5033, -40312, -362871, 8, 9, 9, 6, -11, -106, -705, -5024, -40303, -362862, 17, 18, 18, 15, -2, -97, -696, -5015, -40294, -362853, 23, 24, 24, 21, 4, -91, -690, -5009, -40288, -362847, 15, 16, 16, 13, -4, -99, -698, -5017, -40296, -362855, -71, -70, -70, -73
Offset: 1

Views

Author

Keywords

Comments

Null values are at n = 1, 2, 145, 40585 (A014080). Twin values are at n = 1, 2; 11, 12; 21, 22; ... 10*i + 1, 10*i + 2. Not in sequence: 7, 10, 14, ... Nice polar diagrams repeating themselves with normalized angle to 9! and radius = a(n).
The sequence can be seen as the difference between the natural numbers in the decimal system (n_dec = N0*(10^0) + N1*(10^1) + N2*(10^2)...) and their values in a non-positional number system based on the factorials of the digits (n_fact = N0*(N0 - 1)! + N1*(N1 - 1)! + N2*(N2 - 1)! ...). See also A111095. Note that a(np) - a(n) is congruent to 0 mod 9 if n and np are different for the permutation of the digits. Example (a(5971) - a(1957))/9 = 446. The property can be easily derived by remembering that np - n is congruent to 0 mod 9. - Giorgio Balzarotti, Oct 15 2005

Examples

			For n = 35, a(35) = -91 because 35 - (3! + 5!) = 35 - (6 + 120) = -91.
		

Crossrefs

Programs

  • Magma
    [n-&+[Factorial(d): d in Intseq(n)]: n in [1..60]]; // Bruno Berselli, Oct 25 2018
  • Maple
    a:= n-> n-add(i!, i=convert(n, base, 10)):
    seq(a(n), n=1..100);  # Alois P. Heinz, Oct 24 2018
  • Mathematica
    f[n_] := n - Plus @@ Factorial /@ IntegerDigits[n]; Table[f[n], {n, 53}] (* Ray Chandler, Jul 24 2005 *)
  • PARI
    a(n) = my(d = digits(n)); n - sum(i=1, #d, d[i]!); \\ Michel Marcus, Apr 21 2014
    

Formula

a(n) = n - (N0! + N1! + N2! + ...) if n = N0*10^0 + N1*10^1 + N2*10^2 ...
a(n) = n - A061602(n). - Michel Marcus, Apr 21 2014

Extensions

Extended by Ray Chandler, Jul 24 2005

A181521 Representation of n = sum_k b_k*(k!!) in the double-factorial base by some b_k-fold concatenation of the indices k.

Original entry on oeis.org

1, 2, 3, 13, 23, 33, 133, 4, 14, 24, 34, 134, 234, 334, 5, 15, 25, 35, 135, 235, 335, 1335, 45, 145, 245, 345, 1345, 2345, 3345, 55, 155, 255, 355, 1355, 2355, 3355, 13355, 455, 1455, 2455, 3455, 13455, 23455, 33455, 555, 1555, 2555, 6, 16, 26, 36, 136, 236, 336
Offset: 1

Views

Author

Keywords

Comments

The encoding of n is similar to A111095 but uses a double-factorial base A006882 to define the expansion coefficients.
The expansion coefficients b_k in n = sum_{k>=1} b_k * A006882(k) are defined "greedily" by taking the largest A006882(k) which is <=n, choosing b_k as large as possible such that b_k*A006882(k) remains <=n, subtracing b_k*A006882(k) from n to define a remainder, and recursively slicing the remainder to generate b_{k-1}, then b_{k-2} etc until the remainder reduces to zero. This produces the b_k for each n equivalent to A019513(n).
This representation A019513 is then scanned from the least to the most-significant b_k, i.e., along increasing k, and for each nonzero b_k, b_k copies of k are appended to a string representation -- starting from an empty string. This final representation is interpreted as a base-10 number a(n).

Examples

			a(39) = 1455 because 1!!+4!!+5!!+5!! = 1+8+15+15 = 39
		

Crossrefs

Programs

  • Maple
    dblfactfloor := proc(n) local j ; for j from 1 do if doublefactorial(j) > n then return j-1 ; end if; end do: end proc:
    dblfbase := proc(n) local nshf,L,f; nshf := n ; L := [] ; while nshf > 0 do f := dblfactfloor(nshf) ; L := [f,op(L)] ; nshf := nshf-doublefactorial(f) ; end do: L ; end proc:
    read("transforms") ; A181521 := proc(n) digcatL(dblfbase(n)) ; end proc:
    seq(A181521(n),n=1..70) ; # R. J. Mathar, Dec 06 2010
Showing 1-3 of 3 results.