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.

A265897 Numbers n for which (2n+1)! / n! [= A000407(n)] is >= k! but < 2*k! for some k; positions of ones in A265891.

Original entry on oeis.org

0, 1, 3, 8, 11, 14, 17, 20, 23, 30, 37, 41, 52, 56, 60, 64, 68, 72, 76, 89, 93, 97, 106, 110, 119, 128, 132, 137, 146, 155, 164, 169, 178, 183, 197, 202, 216, 221, 226, 231, 260, 265, 270, 275, 280, 285, 290, 295, 300, 331, 336, 341, 346, 351, 367, 372, 377, 393, 398, 403, 414, 419, 435, 440, 451, 456, 467, 472, 483, 494, 499, 510
Offset: 0

Views

Author

Antti Karttunen, Dec 24 2015

Keywords

Comments

a(0) = 0 is a special case in this sequence, thus the indexing starts from zero.
Numbers n such that A000407(n) is in A265334.

Crossrefs

Cf. also A265898.

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

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).

A265890 Array read by ascending antidiagonals: A(n,k) = A099563(A265609(n,k)), with n as row >= 0, k as column >= 0; the most significant digit 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, 1, 1, 1, 0, 1, 2, 2, 1, 1, 0, 1, 2, 3, 2, 1, 1, 0, 1, 1, 1, 1, 3, 1, 1, 0, 1, 1, 1, 1, 1, 3, 1, 1, 0, 1, 1, 2, 2, 2, 1, 4, 1, 1, 0, 1, 1, 3, 4, 4, 3, 1, 4, 1, 1, 0, 1, 1, 3, 1, 1, 6, 3, 1, 5, 1, 1, 0, 1, 1, 4, 1, 1, 1, 8, 4, 1, 5, 1, 1, 0, 1, 2, 1, 1, 2, 2, 1, 1, 5, 2, 6, 1, 1, 0, 1, 2, 1, 2, 3, 3, 3, 2, 1, 6, 2, 6, 1, 1, 0
Offset: 0

Views

Author

Antti Karttunen, Dec 19 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), ...
A265609(n,k) is the rising factorial, also known as Pochhammer symbol and A099563(n) is the most significant "digit" (place holder) in the factorial representation (A007623) of n.

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
-
Taking the most significant "digit" (placeholder that may get arbitrarily large values) gives us the top left corner of this array:
-
1, 0, 0, 0, 0, 0, 0, 0,  0, 0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0
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, 1, 1, 1, 1,  1, 1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1
1, 1, 2, 2, 3, 3, 4, 4,  5, 5,  6,  6,  7,  7,  8,  8,  9,  9, 10, 10, 11
1, 2, 3, 1, 1, 1, 1, 1,  1, 2,  2,  2,  2,  2,  2,  3,  3,  3,  3,  3,  3
1, 2, 1, 1, 2, 3, 3, 4,  5, 6,  7,  8, 10, 11, 12, 14, 15, 17, 19, 21,  1
1, 1, 1, 2, 4, 6, 8, 1,  1, 1,  1,  2,  2,  2,  2,  3,  3,  3,  4,  4,  5
1, 1, 2, 4, 1, 1, 1, 2,  3, 3,  4,  5,  6,  8,  9, 11, 12, 14, 16, 19, 21
1, 1, 3, 1, 1, 2, 3, 4,  6, 8, 11, 14,  1,  1,  1,  1,  2,  2,  2,  3,  3
1, 1, 3, 1, 2, 3, 5, 8,  1, 1,  1,  2,  2,  3,  4,  5,  6,  7,  8, 10, 12
1, 1, 4, 1, 3, 5, 9, 1,  2, 2,  3,  5,  6,  8, 11, 14, 17, 21,  1,  1,  1
1, 1, 1, 2, 4, 8, 1, 2,  3, 5,  7, 10, 14,  1,  1,  1,  2,  2,  3,  3,  4
1, 2, 1, 3, 6, 1, 2, 4,  6, 9, 14,  1,  1,  2,  3,  4,  5,  6,  8, 10, 13
1, 2, 1, 3, 1, 2, 3, 6, 10, 1,  1,  2,  3,  5,  6,  9, 12, 16, 21,  1,  1
1, 2, 1, 4, 1, 2, 5, 9,  1, 2,  3,  4,  7, 10, 14, 20,  1,  1,  2,  2,  3
1, 2, 2, 5, 1, 3, 7, 1,  2, 3,  5,  8, 13,  1,  1,  1,  2,  3,  4,  6,  8
...
		

Crossrefs

Column 1: A099563.
Row 0: A000007, rows 1 & 2: A000012, row 3: A008619 (see comment in A001710).
Row 4: 1,2,3 followed by A097992 ?
Main diagonal: A265891 (essentially, without the initial 1 from the corner of this array).
Cf. also array A265892.

Programs

A216377 The most significant digit in base n representation of n!.

Original entry on oeis.org

1, 2, 1, 4, 3, 2, 1, 6, 3, 2, 1, 7, 4, 2, 1, 10, 5, 2, 1, 15, 8, 4, 2, 1, 13, 6, 3, 1, 25, 12, 6, 3, 1, 25, 12, 6, 3, 1, 28, 13, 6, 3, 1, 33, 16, 7, 3, 1, 41, 20, 9, 4, 2, 1, 26, 12, 6, 2, 1, 38, 18, 8, 3, 1, 57, 27, 12, 5, 2, 1, 43, 20, 9, 4, 2, 72, 33, 15, 7, 3, 1
Offset: 2

Views

Author

Alex Ratushnyak, Sep 06 2012

Keywords

Comments

a(n) < n, by definition.
Numbers n such that a(n)=1: 2, 4, 8, 12, 16, 20, 25, 29, 34, 39, 44, 49, 55, 60, 65, 71, 82, 88, 94, 105, 111, 117, 123, 136, ... (see A221707).
Numbers n such that a(n) > a(k) for k < n: 2, 3, 5, 9, 13, 17, 21, 30, 40, 45, 50, 66, 77, 100, 118, 124, 130, 155, 161, 226, 246, 273, 371, 378, 385, 421, 450, 472, 509, 584, 599, 637, 660, 683, 745, 784, 855, 983, 991, 999, ... (see A221708).

Crossrefs

Cf. also to scatter plots of A265891 and A265894.

Programs

  • Maple
    a:= n-> iquo(n!, n^ilog[n](n!)):
    seq(a(n), n=2..100);  # Alois P. Heinz, Sep 06 2012
  • Mathematica
    Table[IntegerDigits[n!, n][[1]], {n, 2, 100}] (* T. D. Noe, Sep 06 2012 *)
  • Python
    import math
    def modlg(a,b):
        return a // b**int(math.log(a,b))
    for n in range(2,88):
        print(modlg(math.factorial(n), n), end=', ')

Formula

a(n) = modlg(n!, n), where modlg is the function defined in A215894: modlg(A,B) = floor(A / B^floor(logB(A))), logB is the logarithm base B.
Showing 1-5 of 5 results.