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

A265898 Numbers n for which (2n)! / n! [= A001813(n)] is >= k! but < 2*k! for some k; positions of ones in A265894.

Original entry on oeis.org

0, 1, 3, 6, 8, 11, 14, 17, 20, 27, 34, 41, 45, 49, 81, 85, 89, 102, 106, 115, 124, 128, 137, 142, 146, 151, 160, 169, 174, 188, 193, 202, 207, 212, 231, 236, 241, 246, 251, 256, 306, 311, 316, 321, 326, 331, 336, 357, 362, 367, 383, 388, 393, 409, 414, 425, 430, 446, 462, 478, 489, 494, 505, 516, 521, 532, 543, 554, 565
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 A001813(n) is in A265334.

Crossrefs

After zero-term, a subsequence of A265899.
Cf. also A265897.

A265899 After a(1) = 1, positions of descents in A265894.

Original entry on oeis.org

1, 3, 6, 8, 11, 14, 17, 20, 24, 27, 31, 34, 38, 41, 45, 49, 53, 57, 61, 65, 69, 73, 77, 81, 85, 89, 94, 98, 102, 106, 111, 115, 120, 124, 128, 133, 137, 142, 146, 151, 156, 160, 165, 169, 174, 179, 184, 188, 193, 198, 202, 207, 212, 217, 222, 227, 231, 236, 241, 246, 251, 256, 261, 266, 271, 276, 281, 286, 291, 296, 301
Offset: 1

Views

Author

Antti Karttunen, Dec 24 2015

Keywords

Comments

Numbers n for which A099563(A001813(n)) <= A099563(A001813(n-1)), where A001813(n) = (2n)! / n!, and A099563 gives the most significant digit in the factorial base representation (A007623) of n.

Crossrefs

Cf. A265898 (a subsequence), A266119 (first differences), A266120 (terms immediately before descents).
Cf. also A031435.

Programs

  • PARI
    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!);
    my(i=0, p=1, n=0); while(i < 60, n++; my(k = A265894(n)); if(k <= p, i++; print1(n, ", ")); p = k; );
    
  • Scheme
    ;; With Antti Karttunen's IntSeq-library.
    (define A265899 (MATCHING-POS 1 1 (lambda (n) (<= (A265894 n) (A265894 (- n 1))))))

A266120 Local maxima of A265894 just before its descents: a(n) = A265894(A265899(n) - 1).

Original entry on oeis.org

1, 2, 6, 4, 7, 10, 11, 10, 25, 19, 38, 23, 39, 20, 29, 40, 51, 62, 70, 77, 79, 78, 73, 66, 57, 47, 118, 91, 68, 49, 106, 71, 147, 93, 57, 108, 62, 112, 61, 105, 174, 89, 141, 68, 104, 154, 224, 100, 139, 191, 80, 105, 136, 172, 215, 263, 98, 116, 135, 154, 174, 192, 210, 225, 238, 248, 254, 257, 256, 251, 244, 233, 219, 204, 187, 169, 151, 133
Offset: 1

Views

Author

Antti Karttunen, Dec 24 2015

Keywords

Crossrefs

Programs

  • PARI
    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!);
    i=0; p=1; n=0; while(i < 2016, n++; k = A265894(n); if(k <= p, i++; write("b266120.txt", i, " ", p)); p = k; );
    
  • Scheme
    (define (A266120 n) (A265894 (- (A265899 n) 1)))

Formula

a(n) = A265894(A265899(n) - 1).

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

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

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