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-10 of 18 results. Next

A141825 Encodes permutations which "avoid" the subsequence "123" based on the mapping described in A051683.

Original entry on oeis.org

0, 1, 2, 3, 4, 6, 7, 8, 9, 10, 12, 13, 16, 18, 24, 25, 26, 27, 28, 30, 31, 32, 33, 34, 36, 37, 40, 42, 48, 49, 50, 51, 52, 60, 61, 64, 66, 72, 73, 76, 90, 96
Offset: 1

Views

Author

Alford Arnold, Jul 24 2008

Keywords

Comments

Note that a(n) can be viewed as an irregular table with shape sequence 1 1 3 9 28 ... demonstrating the relationships with 1 2 5 14 42 ... Cf. A000108 and A000142.
0
1
2 3 4
6 7 8 9 10 12 13 16 18
24 25 26 27 28 30 31 32 ... 96
120 ...

Examples

			The numbers 0 thru 4 map to 321,312,231,213 and 132 and are included because they avoid 123. The next number, 5, maps to 123 so is excluded from a(n).
		

Crossrefs

A001563 a(n) = n*n! = (n+1)! - n!.

Original entry on oeis.org

0, 1, 4, 18, 96, 600, 4320, 35280, 322560, 3265920, 36288000, 439084800, 5748019200, 80951270400, 1220496076800, 19615115520000, 334764638208000, 6046686277632000, 115242726703104000, 2311256907767808000, 48658040163532800000, 1072909785605898240000
Offset: 0

Views

Author

Keywords

Comments

A similar sequence, with the initial 0 replaced by 1, namely A094258, is defined by the recurrence a(2) = 1, a(n) = a(n-1)*(n-1)^2/(n-2). - Andrey Ryshevich (ryshevich(AT)notes.idlab.net), May 21 2002
Denominators in power series expansion of E_1(x) + gamma + log(x), x > 0. - Michael Somos, Dec 11 2002
If all the permutations of any length k are arranged in lexicographic order, the n-th term in this sequence (n <= k) gives the index of the permutation that rotates the last n elements one position to the right. E.g., there are 24 permutations of 4 items. In lexicographic order they are (0,1,2,3), (0,1,3,2), (0,2,1,3), ... (3,2,0,1), (3,2,1,0). Permutation 0 is (0,1,2,3), which rotates the last 1 element, i.e., it makes no change. Permutation 1 is (0,1,3,2), which rotates the last 2 elements. Permutation 4 is (0,3,1,2), which rotates the last 3 elements. Permutation 18 is (3,0,1,2), which rotates the last 4 elements. The same numbers work for permutations of any length. - Henry H. Rich (glasss(AT)bellsouth.net), Sep 27 2003
Stirling transform of a(n+1)=[4,18,96,600,...] is A083140(n+1)=[4,22,154,...]. - Michael Somos, Mar 04 2004
From Michael Somos, Apr 27 2012: (Start)
Stirling transform of a(n)=[1,4,18,96,...] is A069321(n)=[1,5,31,233,...].
Partial sums of a(n)=[0,1,4,18,...] is A033312(n+1)=[0,1,5,23,...].
Binomial transform of A000166(n+1)=[0,1,2,9,...] is a(n)=[0,1,4,18,...].
Binomial transform of A000255(n+1)=[1,3,11,53,...] is a(n+1)=[1,4,18,96,...].
Binomial transform of a(n)=[0,1,4,18,...] is A093964(n)=[0,1,6,33,...].
Partial sums of A001564(n)=[1,3,4,14,...] is a(n+1)=[1,4,18,96,...].
(End)
Number of small descents in all permutations of [n+1]. A small descent in a permutation (x_1,x_2,...,x_n) is a position i such that x_i - x_(i+1) =1. Example: a(2)=4 because there are 4 small descents in the permutations 123, 13\2, 2\13, 231, 312, 3\2\1 of {1,2,3} (shown by \). a(n)=Sum_{k=0..n-1}k*A123513(n,k). - Emeric Deutsch, Oct 02 2006
Equivalently, in the notation of David, Kendall and Barton, p. 263, this is the total number of consecutive ascending pairs in all permutations on n+1 letters (cf. A010027). - N. J. A. Sloane, Apr 12 2014
a(n-1) is the number of permutations of n in which n is not fixed; equivalently, the number of permutations of the positive integers in which n is the largest element that is not fixed. - Franklin T. Adams-Watters, Nov 29 2006
Number of factors in a determinant when writing down all multiplication permutations. - Mats Granvik, Sep 12 2008
a(n) is also the sum of the positions of the left-to-right maxima in all permutations of [n]. Example: a(3)=18 because the positions of the left-to-right maxima in the permutations 123,132,213,231,312 and 321 of [3] are 123, 12, 13, 12, 1 and 1, respectively and 1+2+3+1+2+1+3+1+2+1+1=18. - Emeric Deutsch, Sep 21 2008
Equals eigensequence of triangle A002024 ("n appears n times"). - Gary W. Adamson, Dec 29 2008
Preface the series with another 1: (1, 1, 4, 18, ...); then the next term = dot product of the latter with "n occurs n times". Example: 96 = (1, 1, 4, 8) dot (4, 4, 4, 4) = (4 + 4 + 16 + 72). - Gary W. Adamson, Apr 17 2009
Row lengths of the triangle in A030298. - Reinhard Zumkeller, Mar 29 2012
a(n) is also the number of minimum (n-)distinguishing labelings of the star graph S_{n+1} on n+1 nodes. - Eric W. Weisstein, Oct 14 2014
When the numbers denote finite permutations (as row numbers of A055089) these are the circular shifts to the right, i.e., a(n) is the permutation with the cycle notation (0 1 ... n-1 n). Compare array A051683 for circular shifts to the right in a broader sense. Compare sequence A007489 for circular shifts to the left. - Tilman Piesk, Apr 29 2017
a(n-1) is the number of permutations on n elements with no cycles of length n. - Dennis P. Walsh, Oct 02 2017
The number of pandigital numbers in base n+1, such that each digit appears exactly once. For example, there are a(9) = 9*9! = 3265920 pandigital numbers in base 10 (A050278). - Amiram Eldar, Apr 13 2020

Examples

			E_1(x) + gamma + log(x) = x/1 - x^2/4 + x^3/18 - x^4/96 + ..., x > 0. - _Michael Somos_, Dec 11 2002
G.f. = x + 4*x^2 + 18*x^3 + 96*x^4 + 600*x^5 + 4320*x^6 + 35280*x^7 + 322560*x^8 + ...
		

References

  • A. T. Benjamin and J. J. Quinn, Proofs that really count: the art of combinatorial proof, M.A.A. 2003, id. 218.
  • J. M. Borwein and P. B. Borwein, Pi and the AGM, Wiley, 1987, p. 336.
  • F. N. David, M. G. Kendall, and D. E. Barton, Symmetric Function and Allied Tables, Cambridge, 1966, p. 263.
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
  • Jerome Spanier and Keith B. Oldham, "Atlas of Functions", Hemisphere Publishing Corp., 1987, chapter 37, equation 37:6:1 at page 354.

Crossrefs

Cf. A163931 (E(x,m,n)), A002775 (n^2*n!), A091363 (n^3*n!), A091364 (n^4*n!).
Cf. sequences with formula (n + k)*n! listed in A282466.
Row sums of A185105, A322383, A322384, A094485.

Programs

  • GAP
    List([0..20], n-> n*Factorial(n) ); # G. C. Greubel, Dec 30 2019
  • Haskell
    a001563 n = a001563_list !! n
    a001563_list = zipWith (-) (tail a000142_list) a000142_list
    -- Reinhard Zumkeller, Aug 05 2013
    
  • Magma
    [Factorial(n+1)-Factorial(n): n in [0..20]]; // Vincenzo Librandi, Aug 08 2014
    
  • Maple
    A001563 := n->n*n!;
  • Mathematica
    Table[n!n,{n,0,25}] (* Harvey P. Dale, Oct 03 2011 *)
  • PARI
    {a(n) = if( n<0, 0, n * n!)} /* Michael Somos, Dec 11 2002 */
    
  • Sage
    [n*factorial(n) for n in (0..20)] # G. C. Greubel, Dec 30 2019
    

Formula

From Michael Somos, Dec 11 2002: (Start)
E.g.f.: x / (1 - x)^2.
a(n) = -A021009(n, 1), n >= 0. (End)
The coefficient of y^(n-1) in expansion of (y+n!)^n, n >= 1, gives the sequence 1, 4, 18, 96, 600, 4320, 35280, ... - Artur Jasinski, Oct 22 2007
Integral representation as n-th moment of a function on a positive half-axis: a(n) = Integral_{x=0..oo} x^n*(x*(x-1)*exp(-x)) dx, for n>=0. This representation may not be unique. - Karol A. Penson, Sep 27 2001
a(0)=0, a(n) = n*a(n-1) + n!. - Benoit Cloitre, Feb 16 2003
a(0) = 0, a(n) = (n - 1) * (1 + Sum_{i=1..n-1} a(i)) for i > 0. - Gerald McGarvey, Jun 11 2004
Arises in the denominators of the following identities: Sum_{n>=1} 1/(n*(n+1)*(n+2)) = 1/4, Sum_{n>=1} 1/(n*(n+1)*(n+2)*(n+3)) = 1/18, Sum_{n>=1} 1/(n*(n+1)*(n+2)*(n+3)*(n+4)) = 1/96, etc. The general expression is Sum_{n>=k} 1/C(n, k) = k/(k-1). - Dick Boland, Jun 06 2005 [And the general expression implies that Sum_{n>=1} 1/(n*(n+1)*...*(n+k-1)) = (Sum_{n>=k} 1/C(n, k))/k! = 1/((k-1)*(k-1)!) = 1/a(k-1), k >= 2. - Jianing Song, May 07 2023]
a(n) = Sum_{m=2..n+1} |Stirling1(n+1, m)|, n >= 1 and a(0):=0, where Stirling1(n, m) = A048994(n, m), n >= m = 0.
a(n) = 1/(Sum_{k>=0} k!/(n+k+1)!), n > 0. - Vladeta Jovovic, Sep 13 2006
a(n) = Sum_{k=1..n(n+1)/2} k*A143946(n,k). - Emeric Deutsch, Sep 21 2008
The reciprocals of a(n) are the lead coefficients in the factored form of the polynomials obtained by summing the binomial coefficients with a fixed lower term up to n as the upper term, divided by the term index, for n >= 1: Sum_{k = i..n} C(k, i)/k = (1/a(n))*n*(n-1)*..*(n-i+1). The first few such polynomials are Sum_{k = 1..n} C(k, 1)/k = (1/1)*n, Sum_{k = 2..n} C(k, 2)/k = (1/4)*n*(n-1), Sum_{k = 3..n} C(k, 3)/k = (1/18)*n*(n-1)*(n-2), Sum_{k = 4..n} C(k, 4)/k = (1/96)*n*(n-1)*(n-2)*(n-3), etc. - Peter Breznay (breznayp(AT)uwgb.edu), Sep 28 2008
If we define f(n,i,x) = Sum_{k=i..n} Sum_{j=i..k} binomial(k,j)*Stirling1(n,k)* Stirling2(j,i)*x^(k-j) then a(n) = (-1)^(n-1)*f(n,1,-2), (n >= 1). - Milan Janjic, Mar 01 2009
Sum_{n>=1} (-1)^(n+1)/a(n) = 0.796599599... [Jolley eq. 289]
G.f.: 2*x*Q(0), where Q(k) = 1 - 1/(k+2 - x*(k+2)^2*(k+3)/(x*(k+2)*(k+3)-1/Q(k+1))); (continued fraction). - Sergei N. Gladkovskii, Apr 19 2013
G.f.: W(0)*(1-sqrt(x)) - 1, where W(k) = 1 + sqrt(x)/( 1 - sqrt(x)*(k+2)/(sqrt(x)*(k+2) + 1/W(k+1) )); (continued fraction). - Sergei N. Gladkovskii, Aug 18 2013
G.f.: T(0)/x - 1/x, where T(k) = 1 - x^2*(k+1)^2/( x^2*(k+1)^2 - (1-x-2*x*k)*(1-3*x-2*x*k)/T(k+1) ); (continued fraction). - Sergei N. Gladkovskii, Oct 17 2013
G.f.: Q(0)*(1-x)/x - 1/x, where Q(k) = 1 - x*(k+1)/( x*(k+1) - 1/(1 - x*(k+1)/( x*(k+1) - 1/Q(k+1) ))); (continued fraction). - Sergei N. Gladkovskii, Oct 22 2013
D-finite with recurrence: a(n) +(-n-2)*a(n-1) +(n-1)*a(n-2)=0. - R. J. Mathar, Jan 14 2020
a(n) = (-1)^(n+1)*(n+1)*Sum_{k=1..n} A094485(n,k)*Bernoulli(k). The inverse of the Worpitzky representation of the Bernoulli numbers. - Peter Luschny, May 28 2020
From Amiram Eldar, Aug 04 2020: (Start)
Sum_{n>=1} 1/a(n) = Ei(1) - gamma = A229837.
Sum_{n>=1} (-1)^(n+1)/a(n) = gamma - Ei(-1) = A239069. (End)
a(n) = Gamma(n)*A000290(n) for n > 0. - Jacob Szlachetka, Jan 01 2022

A001286 Lah numbers: a(n) = (n-1)*n!/2.

Original entry on oeis.org

1, 6, 36, 240, 1800, 15120, 141120, 1451520, 16329600, 199584000, 2634508800, 37362124800, 566658892800, 9153720576000, 156920924160000, 2845499424768000, 54420176498688000, 1094805903679488000, 23112569077678080000, 510909421717094400000
Offset: 2

Views

Author

Keywords

Comments

Number of surjections from {1,...,n} to {1,...,n-1}. - Benoit Cloitre, Dec 05 2003
First Eulerian transform of 0,1,2,3,4,... . - Ross La Haye, Mar 05 2005
With offset 0 : determinant of the n X n matrix m(i,j)=(i+j+1)!/i!/j!. - Benoit Cloitre, Apr 11 2005
These numbers arise when expressing n(n+1)(n+2)...(n+k)[n+(n+1)+(n+2)+...+(n+k)] as sums of squares: n(n+1)[n+(n+1)] = 6(1+4+9+16+ ... + n^2), n(n+1)(n+2)(n+(n+1)+(n+2)) = 36(1+(1+4)+(1+4+9)+...+(1+4+9+16+ ... + n^2)), n(n+1)(n+2)(n+3)(n+(n+1)+(n+2)+(n+3)) = 240(...), ... . - Alexander R. Povolotsky, Oct 16 2006
a(n) is the number of edges in the Hasse diagram for the weak Bruhat order on the symmetric group S_n. For permutations p,q in S_n, q covers p in the weak Bruhat order if p,q differ by an adjacent transposition and q has one more inversion than p. Thus 23514 covers 23154 due to the transposition that interchanges the third and fourth entries. Cf. A002538 for the strong Bruhat order. - David Callan, Nov 29 2007
a(n) is also the number of excedances in all permutations of {1,2,...,n} (an excedance of a permutation p is a value j such p(j)>j). Proof: j is exceeded (n-1)! times by each of the numbers j+1, j+2, ..., n; now, Sum_{j=1..n} (n-j)(n-1)! = n!(n-1)/2. Example: a(3)=6 because the number of excedances of the permutations 123, 132, 312, 213, 231, 321 are 0, 1, 1, 1, 2, 1, respectively. - Emeric Deutsch, Dec 15 2008
(-1)^(n+1)*a(n) is the determinant of the n X n matrix whose (i,j)-th element is 0 for i = j, is j-1 for j>i, and j for j < i. - Michel Lagneau, May 04 2010
Row sums of the triangle in A030298. - Reinhard Zumkeller, Mar 29 2012
a(n) is the total number of ascents (descents) over all n-permutations. a(n) = Sum_{k=1..n} A008292(n,k)*k. - Geoffrey Critzer, Jan 06 2013
For m>=4, a(m-2) is the number of Hamiltonian cycles in a simple graph with m vertices which is complete, except for one edge. Proof: think of distinct round-table seatings of m persons such that persons "1" and "2" may not be neighbors; the count is (m-3)(m-2)!/2. See also A001710. - Stanislav Sykora, Jun 17 2014
Popularity of left (right) children in treeshelves. Treeshelves are ordered binary (0-1-2) increasing trees where every child is connected to its parent by a left or a right link. Popularity is the sum of a certain statistic (number of left children, in this case) over all objects of size n. See A278677, A278678 or A278679 for more definitions and examples. See A008292 for the distribution of the left (right) children in treeshelves. - Sergey Kirgizov, Dec 24 2016

Examples

			G.f. = x^2 + 6*x^3 + 36*x^4 + 240*x^5 + 1800*x^6 + 15120*x^7 + 141120*x^8 + ...
a(10) = (1+2+3+4+5+6+7+8+9)*(1*2*3*4*5*6*7*8*9) = 16329600. - _Reinhard Zumkeller_, May 15 2010
		

References

  • A. T. Benjamin and J. J. Quinn, Proofs that really count: the art of combinatorial proof, M.A.A. 2003, p. 90, ex. 4.
  • Louis Comtet, Advanced Combinatorics, Reidel, 1974, p. 156.
  • A. P. Prudnikov, Yu. A. Brychkov and O.I. Marichev, "Integrals and Series", Volume 1: "Elementary Functions", Chapter 4: "Finite Sums", New York, Gordon and Breach Science Publishers, 1986-1992.
  • John Riordan, An Introduction to Combinatorial Analysis, Wiley, 1958, p. 44.
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

A002868 is an essentially identical sequence.
Column 2 of |A008297|.
Third column (m=2) of triangle |A111596(n, m)|: matrix product of |S1|.S2 Stirling number matrices.
Cf. also A000110, A000111.

Programs

Formula

a(n) = Sum_{i=0..n-1} (-1)^(n-i-1) * i^n * binomial(n-1,i). - Yong Kong (ykong(AT)curagen.com), Dec 26 2000 [corrected by Amiram Eldar, May 02 2022]
E.g.f.: x^2/[2(1-x)^2]. - Ralf Stephan, Apr 02 2004
a(n+1) = (-1)^(n+1)*det(M_n) where M_n is the n X n matrix M_(i,j)=max(i*(i+1)/2,j*(j+1)/2). - Benoit Cloitre, Apr 03 2004
Row sums of table A051683. - Alford Arnold, Sep 29 2006
5th binomial transform of A135218: (1, 1, 1, 25, 25, 745, 3145, ...). - Gary W. Adamson, Nov 23 2007
If we define f(n,i,x) = Sum_{k=i..n} Sum_{j=i..k} binomial(k,j)*Stirling1(n,k)*Stirling2(j,i)*x^(k-j) then a(n)=(-1)^n*f(n,2,-2), (n>=2). - Milan Janjic, Mar 01 2009
a(n) = A000217(n-1)*A000142(n-1). - Reinhard Zumkeller, May 15 2010
a(n) = (n+1)!*Sum_{k=1..n-1} 1/(k^2+3*k+2). - Gary Detlefs, Sep 14 2011
Sum_{n>=2} 1/a(n) = 2*(2 - exp(1) - gamma + Ei(1)) = 1.19924064599..., where gamma = A001620 and Ei(1) = A091725. - Ilya Gutkovskiy, Nov 24 2016
a(n+1) = a(n)*n*(n+1)/(n-1). - Chai Wah Wu, Apr 11 2018
Sum_{n>=2} (-1)^n/a(n) = 2*(gamma - Ei(-1)) - 2/e, where e = A001113 and Ei(-1) = -A099285. - Amiram Eldar, May 02 2022

A099563 a(0) = 0; for n > 0, a(n) = final nonzero number in the sequence n, f(n,2), f(f(n,2),3), f(f(f(n,2),3),4),..., where f(n,d) = floor(n/d); the most significant digit in the factorial base representation of n.

Original entry on oeis.org

0, 1, 1, 1, 2, 2, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 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
Offset: 0

Views

Author

John W. Layman, Oct 22 2004

Keywords

Comments

Records in {a(n)} occur at {1,4,18,96,600,4320,35280,322560,3265920,...}, which appears to be n*n! = A001563(n).
The most significant digit in the factorial expansion of n (A007623). Proof: The algorithm that computes the factorial expansion of n, generates the successive digits by repeatedly dividing the previous quotient with successively larger divisors (the remainders give the digits), starting from n itself and divisor 2. As a corollary we find that A001563 indeed gives the positions of the records. - Antti Karttunen, Jan 01 2007.

Examples

			For n=15, f(15,2) = floor(15/2)=7, f(7,3)=2, f(2,4)=0, so a(15)=2.
From _Antti Karttunen_, Dec 24 2015: (Start)
Example illustrating the role of this sequence in factorial base representation:
   n  A007623(n)       a(n) [= the most significant digit].
   0 =   0               0
   1 =   1               1
   2 =  10               1
   3 =  11               1
   4 =  20               2
   5 =  21               2
   6 = 100               1
   7 = 101               1
   8 = 110               1
   9 = 111               1
  10 = 120               1
  11 = 121               1
  12 = 200               2
  13 = 201               2
  14 = 210               2
  15 = 211               2
  16 = 220               2
  17 = 221               2
  18 = 300               3
  etc.
Note that there is no any upper bound for the size of digits in this representation.
(End)
		

Crossrefs

Programs

  • Mathematica
    Table[Floor[n/#] &@ (k = 1; While[(k + 1)! <= n, k++]; k!), {n, 0, 120}] (* Michael De Vlieger, Aug 30 2016 *)
  • PARI
    A099563(n) = { my(i=2,dig=0); until(0==n, dig = n % i; n = (n - dig)/i; i++); return(dig); }; \\ Antti Karttunen, Dec 24 2015
    
  • Python
    def a(n):
        i=2
        d=0
        while n:
            d=n%i
            n=(n - d)//i
            i+=1
        return d
    print([a(n) for n in range(201)]) # Indranil Ghosh, Jun 21 2017, after PARI code
  • Scheme
    (define (A099563 n) (let loop ((n n) (i 2)) (let* ((dig (modulo n i)) (next-n (/ (- n dig) i))) (if (zero? next-n) dig (loop next-n (+ 1 i))))))
    (definec (A099563 n) (cond ((zero? n) n) ((= 1 (A265333 n)) 1) (else (+ 1 (A099563 (A257684 n)))))) ;; Based on given recurrence, using the memoization-macro definec
    ;; Antti Karttunen, Dec 24-25 2015
    

Formula

From Antti Karttunen, Dec 25 2015: (Start)
a(0) = 0; for n >= 1, if A265333(n) = 1 [when n is one of the terms of A265334], a(n) = 1, otherwise 1 + a(A257684(n)).
Other identities. For all n >= 0:
a(A001563(n)) = n. [Sequence works as a left inverse for A001563.]
a(n) = A257686(n) / A048764(n).
(End)

Extensions

a(0) = 0 prepended and the alternative description added to the name-field by Antti Karttunen, Dec 24 2015

A257679 The smallest nonzero digit present in the factorial base representation (A007623) of n, 0 if no nonzero digits present.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, May 04 2015

Keywords

Comments

a(0) = 0 by convention, because "0" has no nonzero digits present.
a(n) gives the row index of n in array A257503 (equally, the column index for array A257505).

Examples

			Factorial base representation (A007623) of 4 is "20", the smallest digit which is not zero is "2", thus a(4) = 2.
		

Crossrefs

Positions of records: A001563.
Cf. A256450, A257692, A257693 (positions of 1's, 2's and 3's in this sequence).
Cf. also A257079, A246359 and arrays A257503, A257505.

Programs

  • Mathematica
    a[n_] := Module[{k = n, m = 2, rmin = n, r}, While[{k, r} = QuotientRemainder[k, m]; k != 0 || r != 0, If[0 < r < rmin, rmin = r]; m++]; rmin]; Array[a, 100, 0] (* Amiram Eldar, Jan 23 2024 *)
  • Python
    def A(n, p=2):
        return n if n
  • Scheme
    (define (A257679 n) (let loop ((n n) (i 2) (mind 0)) (if (zero? n) mind (let ((d (modulo n i))) (loop (/ (- n d) i) (+ 1 i) (cond ((zero? mind) d) ((zero? d) mind) (else (min d mind))))))))
    ;; Alternative implementations based on given recurrences, using memoizing definec-macro:
    (definec (A257679 n) (if (zero? (A257687 n)) (A099563 n) (min (A099563 n) (A257679 (A257687 n)))))
    (definec (A257679 n) (cond ((zero? n) n) ((= 1 (A257680 n)) 1) (else (+ 1 (A257679 (A257684 n))))))
    

Formula

If A257687(n) = 0, then a(n) = A099563(n), otherwise a(n) = min(A099563(n), a(A257687(n))).
In other words, if n is either zero or one of the terms of A051683, then a(n) = A099563(n) [the most significant digit of its f.b.r.], otherwise take the minimum of the most significant digit and a(A257687(n)) [value computed by recursing with a smaller value obtained by discarding that most significant digit].
a(0) = 0, and for n >= 1: if A257680(n) = 1, then a(n) = 1, otherwise 1 + a(A257684(n)).
Other identities:
For all n >= 0, a(A001563(n)) = n. [n * n! gives the first position where n appears. Note also that the "digits" (placeholders) in factorial base representation may get arbitrarily large values.]
For all n >= 0, a(2n+1) = 1 [because all odd numbers end with digit 1 in factorial base].

A200748 Smallest number requiring n terms to be expressed as a sum of factorials.

Original entry on oeis.org

0, 1, 3, 5, 11, 17, 23, 47, 71, 95, 119, 239, 359, 479, 599, 719, 1439, 2159, 2879, 3599, 4319, 5039, 10079, 15119, 20159, 25199, 30239, 35279, 40319, 80639, 120959, 161279, 201599, 241919, 282239, 322559, 362879, 725759, 1088639, 1451519, 1814399, 2177279
Offset: 0

Views

Author

Keywords

Comments

Indices of record values in A034968.
Records for sum of digits when numbers are written in factorial base.
Numbers, n, whose factorial base representation digitally dominates every number less than or equal to n; we say n digitally dominates m if each digit of n in its factorial base representation is greater than or equal to the corresponding digit of m in its factorial base representation. - Joanne Beckford, Sep 01 2017

Crossrefs

Partial sums of A130493.

Programs

  • Mathematica
    With[{b = MixedRadix[Reverse@ Range[2, 12]]}, Function[s, {0}~Join~Map[FirstPosition[s, #][[1]] &, Union@ FoldList[Max, s]]]@ Array[Total@ IntegerDigits[#, b] &, 10^5]] (* or *)
    Prepend[-1 + Rest@ Flatten[Table[n!*k, {n, 9}, {k, n}]], 0] (* Michael De Vlieger, Sep 03 2017, after Jean-François Alcover at A051683 *)
  • PARI
    k=0;m=1;s=0;vector(45,n,s+=m!;if(k++==m,k=0;m++);s)

Formula

a(n) = A051683(n+1) - 1.

A351954 Arithmetic derivative without its inherited divisor applied to the prime shadow of the factorial base exp-function: a(n) = A342001(A181819(A276076(n))).

Original entry on oeis.org

0, 1, 1, 2, 1, 5, 1, 2, 2, 3, 5, 8, 1, 5, 5, 8, 2, 7, 1, 7, 7, 12, 8, 31, 1, 2, 2, 3, 5, 8, 2, 3, 3, 4, 8, 11, 5, 8, 8, 11, 7, 10, 7, 12, 12, 17, 31, 46, 1, 5, 5, 8, 2, 7, 5, 8, 8, 11, 7, 10, 2, 7, 7, 10, 3, 9, 8, 31, 31, 46, 13, 41, 1, 7, 7, 12, 8, 31, 7, 12, 12, 17, 31, 46, 8, 31, 31, 46, 13, 41, 2, 9, 9, 14, 11
Offset: 0

Views

Author

Antti Karttunen, Apr 02 2022

Keywords

Comments

Compare the scatter plot to those of A275735, A353575 and of A353577. - Antti Karttunen, Apr 30 2022

Crossrefs

Programs

Formula

a(n) = A342001(A275735(n)) = A351945(A276076(n)).
a(n) = A353577(A351576(n)). - Antti Karttunen, Apr 30 2022

Extensions

Verbal description added to the definition by Antti Karttunen, Apr 30 2022

A162608 Triangle read by rows in which row n lists n+1 terms, starting with n!, such that the difference between successive terms is also equal to n!.

Original entry on oeis.org

1, 1, 2, 2, 4, 6, 6, 12, 18, 24, 24, 48, 72, 96, 120, 120, 240, 360, 480, 600, 720, 720, 1440, 2160, 2880, 3600, 4320, 5040, 5040, 10080, 15120, 20160, 25200, 30240, 35280, 40320, 40320, 80640, 120960, 161280, 201600, 241920, 282240, 322560, 362880
Offset: 0

Views

Author

Omar E. Pol, Jul 22 2009

Keywords

Comments

Note that the last term of the n-th row is the factorial of (n+1) = (n+1)! = A000142(n+1).
Sequence A178883 (with shape A000041) is a "refinement" of Table A162608; as expected, both sequences have row sums A001710(n+2). - Alford Arnold, Sep 28 2010
From Dennis P. Walsh, May 18 2020: (Start)
T(n,k) provides the number of length (n+2) permutations with elements 1 and 2 as cycle-mates in a (k+1)-cycle. We note that 1 and 2 are cycle-mates if they are elements of the same cycle in the permutation.
For example, T(3,2) counts the 12 permutations of length 5 that have 1 and 2 in the same 3 cycle, namely, (1 2 3)(4)(5), (1 3 2)(4)(5), (1 2 3)(4 5), (1 3 2)(4 5), (1 2 4)(3)(5), (1 4 2)(3)(5), (1 2 4)(3 5), (1 4 2)(3 5),(1 2 5)(3)(4), (1 5 2)(3)(4), (1 2 5)(3 4), and (1 5 2)(3 4).
Note that there are binomial(n,k-1) ways to choose the other (k-1) cycle-mates of 1 and 2 in the (k+1)-cycle and then k! different (k+1)-cycles with these elements. Since there are (n+1-k)! ways to permute the remaining elements, we obtain T(n,k) = (n+1-k)!*k!*binomial(n,k-1) = n!*k. (End)

Examples

			Triangle begins:
1;
1,     2;
2,     4,     6;
6,     12,    18,     24;
24,    48,    72,     96,     120;
120,   240,   360,    480,    600,    720;
720,   1440,  2160,   2880,   3600,   4320,   5040;
5040,  10080, 15120,  20160,  25200,  30240,  35280,  40320;
40320, 80640, 120960, 161280, 201600, 241920, 282240, 322560, 362880;
362880,725760,1088640,1451520,1814400,2177280,2540160,2903040,3265920,3628800;
...
Observation: It appears that rows sums = A001710(n+2).
		

Crossrefs

Programs

  • Haskell
    a162608 n k = a162608_tabl !! n !! k
    a162608_row n = a162608_tabl !! n
    a162608_tabl = map fst $ iterate f ([1], 1) where
       f (row, n) = (row' ++ [head row' + last row'], n + 1) where
         row' = map (* n) row
    -- Reinhard Zumkeller, Mar 09 2012
    
  • Magma
    /* As triangle */ [[Factorial(n)*k: k in [1..n+1]]: n in [0.. 15]]; // Vincenzo Librandi, Jul 04 2015
  • Mathematica
    Table[k n!, {n, 0, 8}, {k, n + 1}] // Flatten (* Michael De Vlieger, Jul 03 2015 *)

Formula

From Robert Israel, Jul 03 2015: (Start)
T(n,k) = n!*k, k = 1 .. n+1.
T(n+1,k) = (n+1)*T(n,k).
T(n,k+1) = T(n,k)+T(n,1). (End)

A211370 Array read by antidiagonals: T(m,n) = Sum( n <= i <= m+n-1 ) i!.

Original entry on oeis.org

1, 2, 3, 6, 8, 9, 24, 30, 32, 33, 120, 144, 150, 152, 153, 720, 840, 864, 870, 872, 873, 5040, 5760, 5880, 5904, 5910, 5912, 5913, 40320, 45360, 46080, 46200, 46224, 46230, 46232, 46233, 362880, 403200, 408240, 408960, 409080, 409104, 409110, 409112, 409113
Offset: 1

Views

Author

Tilman Piesk, Jul 07 2012

Keywords

Comments

When the numbers denote finite permutations (as row numbers of A055089) these are the circular shifts to the left within an interval. The subsequence A007489 then denotes the circular shifts that start with the first element. Compare A051683 for circular shifts to the right. - Tilman Piesk, Apr 29 2017

Examples

			T(3,2) = Sum( 2 <= i <= 4 ) i! = 2! + 3! + 4! = 32.
The array starts:
  1,    2,     6,     24,     120,      720, ...
  3,    8,    30,    144,     840,     5760, ...
  9,   32,   150,    864,    5880,    46080, ...
33,  152,   870,   5904,   46200,   408960, ...
153,  872,  5910,  46224,  409080,  4037760, ...
873, 5912, 46230, 409104, 4037880, 43954560, ...
		

Crossrefs

Cf. A051683 (circular shifts to the right), A007489 (column n=1), A000142 (row m=1).

Programs

  • Mathematica
    Table[Function[m, Sum[ i!, {i, n, m + n - 1}]][k - n + 1], {k, 9}, {n, k, 1, -1}] // Flatten (* Michael De Vlieger, Apr 30 2017 *)

A230422 Positions of ones in A230410.

Original entry on oeis.org

1, 8, 14, 16, 18, 22, 33, 35, 37, 41, 45, 51, 53, 57, 61, 71, 75, 82, 87, 96, 106, 116, 118, 120, 124, 128, 134, 136, 140, 144, 154, 158, 165, 170, 179, 189, 198, 200, 206, 208, 212, 216, 226, 230, 237, 242, 251, 261, 270, 272, 280, 289, 293, 300, 305, 314, 324
Offset: 1

Views

Author

Antti Karttunen, Nov 10 2013

Keywords

Comments

This sequence gives all n at which positions the successive terms A219666(n-1) & A219666(n) in the infinite trunk of the factorial beanstalk differ only in one digit position in their factorial base representations (A007623).
Please see further comments and examples in A230410.

Examples

			14 is included, because A219666(13) = 40 = '1220' in factorial base representation, while A219666(14) = 46 = '1320' in factorial base, and they differ only by their third least significant digit.
16 is included, because A219666(15) = 48 = '2000' in factorial base representation, while A219666(16) = 52 = '2020' in factorial base, and they differ only by their second least significant digit.
		

Crossrefs

Subset: A231718. Cf. also A230410 and A258010 (first differences).

Programs

  • Mathematica
    nn = 10^4; m = 1; While[m! < Floor[6 nn/5], m++]; m; f[n_] := IntegerDigits[n, MixedRadix[Reverse@ Range[2, m]]]; Position[#, 1] &[Function[w, Count[Subtract @@ Map[PadLeft[#, Max@ Map[Length, w]] &, w], k_ /; k != 0]]@ Map[f@ # &, {#1, #2}] & @@@ Partition[#, 2, 1] &@ TakeWhile[Reverse@ NestWhileList[# - Total@ f@ # &, Floor[6 nn/5], # > 0 &], # <= nn &]] // Flatten (* Michael De Vlieger, Jun 27 2016, Version 10.2 *)

Formula

For all n, A230406(a(n)) is one of the terms of A051683.
Showing 1-10 of 18 results. Next