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-5 of 5 results.

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

A265609 Array read by ascending antidiagonals: A(n,k) the rising factorial, also known as Pochhammer symbol, for n >= 0 and k >= 0.

Original entry on oeis.org

1, 1, 0, 1, 1, 0, 1, 2, 2, 0, 1, 3, 6, 6, 0, 1, 4, 12, 24, 24, 0, 1, 5, 20, 60, 120, 120, 0, 1, 6, 30, 120, 360, 720, 720, 0, 1, 7, 42, 210, 840, 2520, 5040, 5040, 0, 1, 8, 56, 336, 1680, 6720, 20160, 40320, 40320, 0
Offset: 0

Views

Author

Peter Luschny, Dec 19 2015

Keywords

Comments

The Pochhammer function is defined P(x,n) = x*(x+1)*...*(x+n-1). By convention P(0,0) = 1.
From Antti Karttunen, Dec 19 2015: (Start)
Apart from the initial row of zeros, if we discard the leftmost column and divide the rest of terms A(n,k) with (n+k) [where k is now the once-decremented column index of the new, shifted position] we get the same array back. See the given recursive formula.
When the numbers in array are viewed in factorial base (A007623), certain repeating patterns can be discerned, at least in a few of the topmost rows. See comment in A001710 and arrays A265890, A265892. (End)
A(n,k) is the k-th moment (about 0) of a gamma (Erlang) distribution with shape parameter n and rate parameter 1. - Geoffrey Critzer, Dec 24 2018

Examples

			Square array A(n,k) [where n=row, k=column] is read by ascending antidiagonals as:
A(0,0), A(1,0), A(0,1), A(2,0), A(1,1), A(0,2), A(3,0), A(2,1), A(1,2), A(0,3), ...
Array starts:
n\k [0  1   2    3     4      5        6         7          8]
--------------------------------------------------------------
[0] [1, 0,  0,   0,    0,     0,       0,        0,         0]
[1] [1, 1,  2,   6,   24,   120,     720,     5040,     40320]
[2] [1, 2,  6,  24,  120,   720,    5040,    40320,    362880]
[3] [1, 3, 12,  60,  360,  2520,   20160,   181440,   1814400]
[4] [1, 4, 20, 120,  840,  6720,   60480,   604800,   6652800]
[5] [1, 5, 30, 210, 1680, 15120,  151200,  1663200,  19958400]
[6] [1, 6, 42, 336, 3024, 30240,  332640,  3991680,  51891840]
[7] [1, 7, 56, 504, 5040, 55440,  665280,  8648640, 121080960]
[8] [1, 8, 72, 720, 7920, 95040, 1235520, 17297280, 259459200]
.
Seen as a triangle, T(n, k) = Pochhammer(n - k, k), the first few rows are:
   [0] 1;
   [1] 1, 0;
   [2] 1, 1,  0;
   [3] 1, 2,  2,   0;
   [4] 1, 3,  6,   6,    0;
   [5] 1, 4, 12,  24,   24,    0;
   [6] 1, 5, 20,  60,  120,  120,     0;
   [7] 1, 6, 30, 120,  360,  720,   720,     0;
   [8] 1, 7, 42, 210,  840, 2520,  5040,  5040,     0;
   [9] 1, 8, 56, 336, 1680, 6720, 20160, 40320, 40320, 0.
		

References

  • Ronald L. Graham, Donald E. Knuth and Oren Patashnik, Concrete Mathematics, Addison-Wesley, 1994.
  • H. S. Wall, Analytic Theory of Continued Fractions, Chelsea 1973, p. 355.

Crossrefs

Triangle giving terms only up to column k=n: A124320.
Row 0: A000007, row 1: A000142, row 3: A001710 (from k=1 onward, shifted two terms left).
Column 0: A000012, column 1: A001477, column 2: A002378, columns 3-7: A007531, A052762, A052787, A053625, A159083 (shifted 2 .. 6 terms left respectively, i.e. without the extra initial zeros), column 8: A239035.
Row sums of the triangle: A000522.
A(n, n) = A000407(n-1) for n>0.
2^n*A(1/2,n) = A001147(n).
Cf. also A007623, A008279 (falling factorial), A173333, A257505, A265890, A265892.

Programs

  • Maple
    for n from 0 to 8 do seq(pochhammer(n,k), k=0..8) od;
  • Mathematica
    Table[Pochhammer[n, k], {n, 0, 8}, {k, 0, 8}]
  • Sage
    for n in (0..8): print([rising_factorial(n,k) for k in (0..8)])
    
  • Scheme
    (define (A265609 n) (A265609bi (A025581 n) (A002262 n)))
    (define (A265609bi row col) (if (zero? col) 1 (* (+ row col -1) (A265609bi row (- col 1)))))
    ;; Antti Karttunen, Dec 19 2015

Formula

A(n,k) = Gamma(n+k)/Gamma(n) for n > 0 and n^k for n=0.
A(n,k) = Sum_{j=0..k} n^j*S1(k,j), S1(n,k) the Stirling cycle numbers A132393(n,k).
A(n,k) = (k-1)!/(Sum_{j=0..k-1} (-1)^j*binomial(k-1, j)/(j+n)) for n >= 1, k >= 1.
A(n,k) = (n+k-1)*A(n,k-1) for k >= 1, A(n,0) = 1. - Antti Karttunen, Dec 19 2015
E.g.f. for row k: 1/(1-x)^k. - Geoffrey Critzer, Dec 24 2018
A(n, k) = FallingFactorial(n + k - 1, k). - Peter Luschny, Mar 22 2022
G.f. for row n as a continued fraction of Stieltjes type: 1/(1 - n*x/(1 - x/(1 - (n+1)*x/(1 - 2*x/(1 - (n+2)*x/(1 - 3*x/(1 - ... ))))))). See Wall, Chapter XVIII, equation 92.5. Cf. A226513. - Peter Bala, Aug 27 2023

A265894 a(n) = A099563(A001813(n)); the most significant digit in factorial base representation of (2n)! / n!.

Original entry on oeis.org

1, 1, 2, 1, 2, 6, 1, 4, 1, 2, 7, 1, 3, 10, 1, 3, 11, 1, 3, 10, 1, 3, 8, 25, 2, 6, 19, 1, 4, 13, 38, 2, 7, 23, 1, 4, 13, 39, 2, 6, 20, 1, 3, 9, 29, 1, 4, 13, 40, 1, 5, 16, 51, 2, 6, 20, 62, 2, 7, 23, 70, 2, 8, 25, 77, 2, 8, 25, 79, 2, 8, 25, 78, 2, 7, 23, 73, 2, 6, 21, 66, 1, 6, 18, 57, 1, 4, 15, 47, 1, 3, 12, 38, 118, 3, 9
Offset: 0

Views

Author

Antti Karttunen, Dec 24 2015

Keywords

Examples

			The terms A001813(0) .. A001813(8) in factorial base representation (A007623) look as:
  1, 10, 200, 10000, 220000, 6000000, 174000000, 4760000000, 110000000000, ...
Taking the first digit (actually: a place holder value) of each gives the terms a(0) .. a(8) of this sequence: 1, 1, 2, 1, 2, 6, 1, 4, 1, ...
		

Crossrefs

Submain diagonal of A265890.
Cf. A265898 (positions of ones), A265899 (of descents), A266120 (local maxima just before those descents).
Cf. also A265891.

Programs

  • Mathematica
    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]; (* taken from A007623,  Alonso del Arte, May 03 2006 *) f[n_] := factBaseIntDs[(2 n)!/n!][[1]]; Array[f, 96, 0] (* Robert G. Wilson v, Dec 25 2015 *)
  • PARI
    allocatemem((2^31)); \\ Enough?
    A099563(n) = { my(i=2,dig=0); until(0==n, dig = n % i; n = (n - dig)/i; i++); return(dig); };
    A265894 = n -> A099563((2*n)! / n!);
    
  • Scheme
    (define (A265894 n) (A099563 (A001813 n)))
    
  • Scheme
    (define (A265894 n) (A265890bi (+ 1 n) n)) ;; Code for A265890bi given in A265890.

Formula

a(n) = A099563(A001813(n)).
a(n) = A265890(n+1, n).

A265891 a(n) = A099563(A000407(n)); the most significant digit in factorial base representation of (2n+1)! / n!.

Original entry on oeis.org

1, 1, 2, 1, 3, 8, 2, 6, 1, 3, 10, 1, 5, 14, 1, 5, 16, 1, 5, 15, 1, 4, 12, 1, 3, 9, 28, 2, 6, 19, 1, 3, 11, 35, 2, 6, 19, 1, 3, 10, 30, 1, 4, 14, 44, 2, 6, 20, 61, 2, 8, 25, 1, 3, 10, 31, 1, 3, 11, 35, 1, 4, 12, 38, 1, 4, 12, 39, 1, 4, 12, 39, 1, 3, 11, 36, 1, 3, 10, 33, 102, 3, 9, 28, 89, 2, 7, 23, 74, 1, 6, 19, 59
Offset: 0

Views

Author

Antti Karttunen, Dec 20 2015

Keywords

Examples

			The terms A000407(0) .. A000407(8) in factorial base representation (A007623) look as:
  1, 100, 2200, 110000, 3000000, 82000000, 2374000000, 65500000000, 1550000000000, ...
Taking the first digit (actually: a place holder value) of each gives the terms a(0) .. a(8) of this sequence: 1, 1, 2, 1, 3, 8, 2, 6, 1, ...
		

Crossrefs

Main diagonal of A265890 (apart from the corner term).
Cf. A265897 (positions of ones).
Cf. also A265894.

Programs

  • Mathematica
    a[n_] := Module[{k = (2*n+1)!/n!, m = 2, r, d=0}, While[{k, r} = QuotientRemainder[k, m]; k != 0 || r != 0, If[r > 0, d = r]; m++]; d]; Array[a, 100, 0] (* Amiram Eldar, Feb 14 2024 *)
  • PARI
    allocatemem((2^31)); \\ Enough?
    A099563(n) = { my(i=2,dig=0); until(0==n, dig = n % i; n = (n - dig)/i; i++); return(dig); };
    A265891 = n -> A099563(((2*n)+1)! / n!);
    
  • Scheme
    (define (A265891 n) (A099563 (A000407 n)))
    
  • Scheme
    (define (A265891 n) (A265890bi (+ 1 n) (+ 1 n))) ;; Code for A265890bi given in A265890.

Formula

a(n) = A099563(A000407(n)).
a(n) = A265890(n+1, n+1).

A265892 Array read by ascending antidiagonals: A(n,k) = A265893(A265609(n,k)), with n as row >= 0, k as column >= 0; the number of significant digits counted without trailing zeros in the factorial base representation of rising factorial n^(k) = (n+k-1)!/(n-1)!.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Dec 20 2015

Keywords

Comments

Square array A(row,col) is read by ascending antidiagonals as: A(0,0), A(1,0), A(0,1), A(2,0), A(1,1), A(0,2), A(3,0), A(2,1), A(1,2), A(0,3), ...

Examples

			The top left corner of the array A265609 with its terms shown in factorial base (A007623) looks like this:
1,   0,    0,     0,       0,        0,         0,          0,           0
1,   1,   10,   100,    1000,    10000,    100000,    1000000,    10000000
1,  10,  100,  1000,   10000,   100000,   1000000,   10000000,   100000000
1,  11,  200,  2200,   30000,   330000,   4000000,   44000000,   500000000
1,  20,  310, 10000,  110000,  1220000,  14000000,  160000000,  1830000000
1,  21, 1100, 13300,  220000,  3000000,  36000000,  452000000,  5500000000
1, 100, 1300, 24000,  411000,  6000000,  82000000, 1100000000, 13300000000
1, 101, 2110, 41000, 1000000, 13000000, 174000000, 2374000000, 30360000000
-
Counting such digits for each term, but without the trailing zeros gives us the top left corner of this array:
-
The top left corner of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, 6, 5, 5, 5, 5
1, 2, 3, 2, 4, 3, 4, 4, 4, 4, 5, 5, 6, 5, 5, 4, 6, 5, 6, 5, 4, 4, 4, 5, 6
1, 3, 1, 2, 3, 4, 5, 4, 3, 4, 4, 5, 5, 7, 6, 7, 6, 7, 5, 6, 7, 5, 4, 5, 6
1, 2, 4, 3, 5, 4, 3, 5, 6, 6, 5, 6, 6, 5, 6, 5, 6, 4, 5, 6, 4, 4, 6, 7, 8
1, 3, 3, 5, 4, 5, 5, 6, 5, 6, 5, 7, 6, 7, 6, 7, 4, 5, 6, 8, 5, 6, 7, 8, 6
1, 1, 3, 3, 4, 3, 5, 4, 5, 4, 6, 5, 6, 5, 6, 6, 7, 6, 7, 4, 5, 6, 7, 5, 6
...
		

Crossrefs

Row 0: A000007, rows 1-2: A000012, row 3: A000034 (see comment in A001710).
Column 0: A000012, column 1: A265893.
Cf. also array A265890.

Programs

Formula

A(n,k) = A265893(A265609(n,k)).
Showing 1-5 of 5 results.