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.

A062383 a(0) = 1: for n>0, a(n) = 2^floor(log_2(n)+1) or a(n) = 2*a(floor(n/2)).

Original entry on oeis.org

1, 2, 4, 4, 8, 8, 8, 8, 16, 16, 16, 16, 16, 16, 16, 16, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 128, 128, 128, 128, 128, 128
Offset: 0

Views

Author

Antti Karttunen, Jun 19 2001

Keywords

Comments

Informally, write down 1 followed by 2^k 2^(k-1) times, for k = 1,2,3,4,... These are the denominators of the binary van der Corput sequence (see A030101 for the numerators). - N. J. A. Sloane, Dec 01 2019
a(n) is the denominator of the form 2^k needed to make the ratio (2n-1)/2^k lie in the interval [1-2], i.e. such ratios are 1/1, 3/2, 5/4, 7/4, 9/8, 11/8, 13/8, 15/8, 17/16, 19/16, 21/16, ... where the numerators are A005408 (The odd numbers).
Let A_n be the upper triangular matrix in the group GL(n,2) that has zero entries below the diagonal and 1 elsewhere. For example for n=4 the matrix is / 1,1,1,1 / 0,1,1,1 / 0,0,1,1 / 0,0,0,1 /. The order of this matrix as an element of GL(n,2) is a(n-1). - Ahmed Fares (ahmedfares(AT)my-deja.com), Jul 14 2001
A006257(n)/a(n) = (0, 0.1, 0.01, 0.11, 0.001, ...) enumerates all binary fractions in the unit interval [0, 1). - Fredrik Johansson, Aug 14 2006
a(n) = maximum of row n+1 in A240769. - Reinhard Zumkeller, Apr 13 2014
This is the discriminator sequence for the odious numbers. - N. J. A. Sloane, May 10 2016
From Jianing Song, Jul 05 2025: (Start)
a(n) is the period of {binomial(N,n) mod 2: N in Z}. For the general result, see A349593.
Since the modulus (2) is a prime, the remainder of binomial(N,n) is given by Lucas's theorem. (End)

Crossrefs

Apart from the initial term, equals 2 * A053644. MASKTRANSi(A062383) seems to give a signed form of A038712. (See identities at A053644). floor_log_2 given in A054429.
Equals A003817(n)+1. Cf. A002884.
Bisection of A065285. Cf. A076877.
Equals for n>=1 the r(n) sequence of A160464. - Johannes W. Meijer, May 24 2009
Equals the r(n) sequence of A162440 for n>=1. - Johannes W. Meijer, Jul 06 2009
Discriminator of the odious numbers (A000069). - Jeffrey Shallit, May 08 2016
Column 2 of A349593. A064235 (if offset 0), A385552, A385553, and A385554 are respectively columns 3, 5, 6, and 10.

Programs

  • Haskell
    import Data.List (transpose)
    a062383 n = a062383_list !! n
    a062383_list = 1 : zs where
       zs = 2 : (map (* 2) $ concat $ transpose [zs, zs])
    -- Reinhard Zumkeller, Aug 27 2014, Mar 13 2014
    
  • Magma
    [2^Floor(Log(2,2*n+1)): n in [0..70]]; // Bruno Berselli, Mar 04 2016
    
  • Maple
    [seq(2^(floor_log_2(j)+1),j=0..127)]; or [seq(coerce1st_octave((2*j)+1),j=0..127)]; or [seq(a(j),j=0..127)];
    coerce1st_octave := proc(r) option remember; if(r < 1) then coerce1st_octave(2*r); else if(r >= 2) then coerce1st_octave(r/2); else (r); fi; fi; end;
    A062383 := proc(n)
        option remember;
        if n = 0 then
            1 ;
        else
            2*procname(floor(n/2));
        end if;
    end proc:
    A062383 := n -> 1 + Bits:-Iff(n, n):
    seq(A062383(n), n=0..69); # Peter Luschny, Sep 23 2019
  • Mathematica
    a[n_] := a[n] = 2 a[n/2 // Floor]; a[0] = 1; Table[a[n], {n, 0, 100}] (* Jean-François Alcover, Mar 04 2016 *)
    Table[2^Floor[Log2[n] + 1], {n, 0, 20}] (* Eric W. Weisstein, Nov 17 2017 *)
    2^Floor[Log2[Range[0, 20]] + 1] (* Eric W. Weisstein, Nov 17 2017 *)
    2^BitLength[Range[0, 100]] (* Paolo Xausa, Jan 29 2025 *)
  • PARI
    { a=1; for (n=0, 1000, write("b062383.txt", n, " ", a*=ceil((n + 1)/a)) ) } \\ Harry J. Smith, Aug 06 2009
    
  • PARI
    a(n)=1<<(log(2*n+1)\log(2)) \\ Charles R Greathouse IV, Dec 08 2011
    
  • Python
    def A062383(n): return 1 << n.bit_length() # Chai Wah Wu, Jun 30 2022

Formula

a(1) = 1 and a(n+1) = a(n)*ceiling(n/a(n)). - Benoit Cloitre, Aug 17 2002
G.f.: 1/(1-x) * (1 + Sum_{k>=0} 2^k*x^2^k). - Ralf Stephan, Apr 18 2003
a(n) = A142151(2*n)/2 + 1. - Reinhard Zumkeller, Jul 15 2008
log(a(n))/log(2) = A029837(n+1). - Johannes W. Meijer, Jul 06 2009
a(n+1) = a(n) + A099894(n). - Reinhard Zumkeller, Aug 06 2009
a(n) = A264619(n) - A264618(n). - Reinhard Zumkeller, Dec 01 2015
a(n) is the smallest power of 2 > n. - Chai Wah Wu, Nov 04 2016
a(n) = 2^ceiling(log_2(n+1)). - M. F. Hasler, Sep 20 2017

A349593 Square array read by downward diagonals: for n >= 0, k >= 1, T(n,k) is the period of {binomial(N,n) mod k: N in Z}.

Original entry on oeis.org

1, 1, 1, 1, 2, 1, 1, 3, 4, 1, 1, 4, 3, 4, 1, 1, 5, 8, 9, 8, 1, 1, 6, 5, 8, 9, 8, 1, 1, 7, 12, 5, 16, 9, 8, 1, 1, 8, 7, 36, 5, 16, 9, 8, 1, 1, 9, 16, 7, 72, 25, 16, 9, 16, 1, 1, 10, 9, 16, 7, 72, 25, 16, 9, 16, 1, 1, 11, 20, 27, 32, 7, 72, 25, 32, 27, 16, 1
Offset: 0

Views

Author

Jianing Song, Nov 27 2021

Keywords

Comments

Since binomial(N,n) is defined for all integers N, there is no need to assume that N >= n.
Let Q(N) = 1 if k | binomial(N,n), 0 otherwise. Then T(n,k) is also the period of {Q(N): N in Z}.
By the formula given below, the n-th row is identical to the (n-1)th row if and only if n is not a power of a prime, i.e., n is in A024619. - Jianing Song, Jul 03 2025

Examples

			Rows 0..10:
  1,  1,  1,  1,  1,   1,  1,  1,  1,   1, ...
  1,  2,  3,  4,  5,   6,  7,  8,  9,  10, ...
  1,  4,  3,  8,  5,  12,  7, 16,  9,  20, ...
  1,  4,  9,  8,  5,  36,  7, 16, 27,  20, ...
  1,  8,  9, 16,  5,  72,  7, 32, 27,  40, ...
  1,  8,  9, 16, 25,  72,  7, 32, 27, 200, ...
  1,  8,  9, 16, 25,  72,  7, 32, 27, 200, ...
  1,  8,  9, 16, 25,  72, 49, 32, 27, 200, ...
  1, 16,  9, 32, 25, 144, 49, 64, 27, 400, ...
  1, 16, 27, 32, 25, 432, 49, 64, 81, 400, ...
  1, 16, 27, 32, 25, 432, 49, 64, 81, 400, ...
Example showing that T(4,4) = 16: for N == 0, 1, ..., 15 (mod 16), binomial(N,4) == {0, 0, 0, 0, 1, 1, 3, 3, 2, 2, 2, 2, 3, 3, 1, 1} (mod 4).
Example showing that T(3,10) = 20: for N == 0, 1, ..., 19 (mod 20), binomial(N,3) == {0, 0, 0, 1, 4, 0, 0, 5, 6, 4, 0, 5, 0, 6, 4, 5, 0, 0, 6, 9} (mod 10).
		

Crossrefs

Cf. A022998 (row n = 2), A385555 (row n = 3), A385556 (row n = 4), A385557 (rows n = 5 and 6), A385558 (row n = 7), A385559 (row n = 8), A385560 (rows n = 9 and 10).
Cf. A062383 (2nd column), A064235 (3rd column if offset 0), A385552 (5th column), A385553 (6th column), A385554 (10th column).
Cf. A349221.

Programs

  • Mathematica
    A349593[n_, k_] := If[n == 0 || k == 1, 1, k*Product[p^Floor[Log[p, n]], {p, FactorInteger[k][[All, 1]]}]];
    Table[A349593[k - 1, n - k + 2], {n, 0, 15}, {k, n + 1}] (* Paolo Xausa, Jul 07 2025 *)
  • PARI
    T(n,k) = if(n==0, 1, my(r=1, f=factor(k)); for(j=1, #f[, 1], my(p=f[j, 1], e=f[j, 2]); r *= p^(logint(n,p)+e)); return(r))

Formula

The n-th row is multiplicative with T(n,p^e) = 1 if n = 0, p^(e+floor(log(n)/log(p))) otherwise. In other words, for n > 0, T(n,k) = k * Product_{prime p|k} p^(floor(log(n)/log(p))). See my pdf file for a proof.

A064235 The smallest power of 3 that is greater than or equal to n.

Original entry on oeis.org

1, 3, 3, 9, 9, 9, 9, 9, 9, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81
Offset: 1

Views

Author

Dan Fux (dan.fux(AT)OpenGaia.com or danfux(AT)OpenGaia.com), Sep 22 2001

Keywords

Comments

Let A_n be the upper triangular matrix in the group GL(n,3) of invertible n X n matrices over GF(3) that has zero entries below the diagonal and 1 elsewhere. For example for n=4 the matrix is / 1,1,1,1 / 0,1,1,1 / 0,0,1,1 / 0,0,0,1 /. a(n) is the order of this matrix as an element of GL(n,3).
For n>1 a(n) is the smallest integer such that gcd(a(n),2^a(n)+1) >= n. - Benoit Cloitre, Apr 21 2002
From Jianing Song, Jul 05 2025: (Start)
a(n+1) is the period of {binomial(N,n) mod 3: N in Z}. For the general result, see A349593.
Since the modulus (3) is a prime, the remainder of binomial(N,n) is given by Lucas's theorem. (End)

Crossrefs

Cf. A062383.
With offset 0, column 3 of A349593. A062383, A385552, A385553, and A385554 are respectively columns 2, 5, 6, and 10.

Programs

  • Haskell
    import Data.List (transpose)
    a064235 n = genericIndex a064235_list (n - 1)
    a064235_list = 1 : zs where
       zs = 3 : 3 : (map (* 3) $ concat $ transpose [zs, zs, zs])
    -- Reinhard Zumkeller, Sep 02 2015
    
  • Maple
    A064235 := proc(n)
            ceil(log(n)/log(3)) ;
            3^% ;
    end proc: # R. J. Mathar, Nov 06 2011
  • Mathematica
    nn=100;With[{p3=3^Range[0,Ceiling[Log[3,nn]]]},Flatten[Table[Select[ p3, #>=n&, 1],{n,nn}]]] (* Harvey P. Dale, Mar 14 2013 *)
  • Python
    from gmpy2 import digits
    def A064235(n): return 3**len(digits(n-1,3)) if n>1 else 1 # Chai Wah Wu, Oct 21 2024

Formula

a(n) = 3 ^ A080342(n). - Reinhard Zumkeller, Sep 02 2015
Sum_{n>=1} 1/a(n)^2 = 4/3. - Amiram Eldar, Aug 16 2022

Extensions

More terms from James Sellers, Sep 26 2001

A385552 Period of {binomial(N,n) mod 5: N in Z}.

Original entry on oeis.org

1, 5, 5, 5, 5, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125
Offset: 0

Views

Author

Jianing Song, Jul 03 2025

Keywords

Comments

a(n) is the smallest power of 5 > n. For the general result, see A349593.
Since the modulus (5) is a prime, the remainder of binomial(N,n) is given by Lucas's theorem.

Examples

			For N == 0, 1, ..., 24 (mod 5), binomial(N,5) == {0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4} (mod 5).
		

Crossrefs

Column 5 of A349593. A062383, A064235 (if offset 0), A385553, and A385554 are respectively columns 2, 3, 6, and 10.

Programs

  • PARI
    a(n) = if(n, 5^(logint(n,5)+1), 1)
    
  • Python
    from sympy import integer_log
    def A385552(n): return 5*5**(integer_log(n,5)[0]) if n else 1 # Chai Wah Wu, Jul 06 2025

A385554 Period of {binomial(N,n) mod 10: N in Z}.

Original entry on oeis.org

1, 10, 20, 20, 40, 200, 200, 200, 400, 400, 400, 400, 400, 400, 400, 400, 800, 800, 800, 800, 800, 800, 800, 800, 800, 4000, 4000, 4000, 4000, 4000, 4000, 4000, 8000, 8000, 8000, 8000, 8000, 8000, 8000, 8000, 8000, 8000, 8000, 8000, 8000, 8000, 8000, 8000, 8000, 8000, 8000, 8000
Offset: 0

Views

Author

Jianing Song, Jul 03 2025

Keywords

Examples

			For N == 0, 1, ..., 19 (mod 20), binomial(N,3) == {0, 0, 0, 1, 4, 0, 0, 5, 6, 4, 0, 5, 0, 6, 4, 5, 0, 0, 6, 9} (mod 10).
For N == 0, 1, ..., 39 (mod 40), binomial(N,4) == {0, 0, 0, 0, 1, 5, 5, 5, 0, 6, 0, 0, 5, 5, 1, 5, 0, 0, 0, 6, 5, 5, 5, 5, 6, 0, 0, 0, 5, 1, 5, 5, 0, 0, 6, 0, 5, 5, 5, 1} (mod 10).
		

Crossrefs

Column 10 of A349593. A062383, A064235 (if offset 0), A385552, and A385553 are respectively columns 2, 3, 5, and 6.

Programs

  • PARI
    a(n) = if(n, (2^(logint(n,2)+1)) * (5^(logint(n,5)+1)), 1)

Formula

a(n) = (the smallest power of 2 > n) * (the smallest power of 5 > n) = A062383(n) * A385552(n). For the general result, see A349593.
Showing 1-5 of 5 results.