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 79 results. Next

A063079 Bisection of A001790.

Original entry on oeis.org

1, 5, 63, 429, 12155, 88179, 1300075, 9694845, 583401555, 4418157975, 67282234305, 514589420475, 15801325804719, 121683714103007, 1879204156221315, 14544636039226909, 1804857108504066435
Offset: 1

Views

Author

N. J. A. Sloane, Aug 07 2001

Keywords

Crossrefs

Cf. A001790, A060818, A334907. Other bisection gives A061548.

Programs

  • Maple
    seq(numer(binomial(2*n-3/2,-1/2)), n=1..20);
  • Mathematica
    Numerator[Binomial[2Range[20]-3/2,-(1/2)]] (* Harvey P. Dale, Feb 27 2012 *)

Formula

Numerators of binomial(2*n-3/2, -1/2).
Because A334907(n)/n! = a(n+1)/A060818(n) for n >= 0, the o.g.f. of a(n+1)/A060818(n), for n >= 0, is (sqrt(1 + sqrt(8*s)) - sqrt(1 - sqrt(8*s)))/sqrt(8*s * (1 - 8*s)), which is the e.g.f. of A334907 (see the link above for a proof). - Petros Hadjicostas, May 16 2020

Extensions

More terms from Vladeta Jovovic, Aug 07 2001

A180403 Numerator in Moebius transform of A001790/A046161.

Original entry on oeis.org

1, -1, -5, -3, -93, 95, -793, -211, -5853, 27003, -215955, 57459, -3518265, 3602027, 16811055, -4362627, -1846943453, 293601363, -14911085359, 4487888279, 144251733709, 245294787521, -1936010885087, 228009405371, -11179552565305, 63485965327535, -48562641580527
Offset: 1

Views

Author

Mats Granvik, Sep 02 2010

Keywords

Comments

Consider a lower triangular matrix T(n,k) defined by T(n,1)=A001790/A046161, k>1: T(n,k) = (Sum_{i=1..k-1} T(n-i,k-1)) - (Sum_{i=1..k-1} T(n-i,k)). The first column in the matrix inverse of T(n,k) will have the fraction A180403/A046161 in its first column.
The sequence considers the Moebius transform 1, -1/2, -5/8, -3/16, -93/128, ... of the sequence A001790(n-1)/A046161(n-1), i.e., assigning offset 1 to A001790 and A046161. - R. J. Mathar, Apr 22 2011

Crossrefs

Cf. A001790, A046161 (denominators).

Formula

Lambert series: Sum_{n >= 1} (A180403(n)/A046161(n))*x^n/(1-x^n) = x/sqrt(1-x). - Mats Granvik, Sep 07 2010

Extensions

Signs of terms corrected by Mats Granvik, Sep 05 2010
Corrected and edited by Mats Granvik, Oct 08 2010

A206771 0 followed by the numerators of the reduced (A001803(n) + A001790(n)) / (2*A046161(n)).

Original entry on oeis.org

0, 1, 1, 9, 5, 175, 189, 1617, 429, 57915, 60775, 508079, 264537, 8788507, 9100525, 75218625, 9694845, 5109183315, 5250613995, 43106892675, 22090789875, 723694276305, 740104577355, 6049284520695, 1543768261425, 201547523019375
Offset: 0

Views

Author

Paul Curtz, Jan 10 2013

Keywords

Comments

We write the fractions a(n)/b(n) and higher order differences as a matrix:
0, 1, 1, 9/8, 5/4,...
1, 0, 1/8, 1/8, 15/128,... = (A001790(n)/A046161(n) +Lorbeta(n)) /2
-1, 1/8, 0, -1/128, -1/128,... = (Lorbeta(n+1) +A161200(n+1)/A046161(n+1)) / 2
9/8, -1/8, -1/128, 0, 1/1024,...
-5/4, 15/128, 1/128, 1/1024, 0,...
Here, Lorbeta(0)=1 and Lorbeta(n) = -A098597(n-1)/A046161(n) for n>0 is the inverse of the Lorentz factor.
The first line with numerators a(n) and denominators b(n) is 0, 1, 1, 9/8, 5/4, 175/128, 189/128, 1617/1024, 429/256, 57915/32768, 60775/32768,... It is an autosequence: Its inverse binomial transform is the signed sequence.
a(n+1)/(2*n-1)= 1, 3, 1, 25, 21, 147, 33, 3861, 3575, 26741,... .
a(n+1)/A146535(n) = 9, 5, 35, 27, 539, 39, 4455,... .
A001790(n)/A046161(n) yields the coefficients of the Lorentz factor (or Lorentz gamma factor). With b for beta and g for gamma:
g = (1-b^2)^-1 = 1 + (b^2)/2 + 3*(b^4)/8 + 5*(b^6)/16 + ... .
b = (1-g^-2)^-1 = 1 - (g^-2)/2 - (g^-4)/8 - (g^-6)/16 - ... .
Are the denominators of the first subdiagonal 1, 1/8, -1/128, 1/1024,... A061549(n) ?
a(n+1)/(A000108(n)*b(n)) = 1, 1, 9/16, 1/4, 25/256, 9/256, 49/4096, 1/256, 81/65536, 25/65536, 121/1048576,... = A191871(n+1)/ A084623(n+1)^2 ?

Examples

			From the first formula: a(1)=1*1, a(2)=1*1, a(3)=3*3, a(4)=1*5, a(5)=5*35, a(6)=3*63.
		

Crossrefs

Programs

  • Magma
    /* By definition: */ m:=25; R:=PowerSeriesRing(Rationals(), m); p:=Coefficients(R!(1/(1-x)^(1/2))); q:=Coefficients(R!((1-x)^(-3/2))); A001790:=[Numerator(p[i]): i in [1..m]]; A001803:=[Numerator(q[i]): i in [1..m]]; A046161:=[Denominator(Binomial(2*n,n)/4^n): n in [0..m-1]]; [0] cat [Numerator((A001803[n]+A001790[n])/(2*A046161[n])): n in [1..m]]; // Bruno Berselli, Mar 11 2013
  • Maple
    A206771 := proc(n)
            A001790(n)+A001803(n) ;
            %/2/A046161(n) ;
            numer(%) ;
    end proc: # R. J. Mathar, Jan 18 2013
  • Mathematica
    max = 25; A001803 = CoefficientList[Series[(1 - x)^(-3/2), {x, 0, max}], x] // Numerator; A001790 = CoefficientList[Series[1/Sqrt[(1 - x)], {x, 0, max}], x] // Numerator; A046161 = Table[Binomial[2n, n]/4^n, {n, 0, max}] // Denominator; a[n_] := (A001803[[n]] + A001790[[n]])/(2*A046161[[n]]) // Numerator; a[0] = 0; Table[a[n], {n, 0, max}]
    (* or (from 1st formula) : *) Table[ n*Numerator[4^(1-n)*Binomial[2n-2, n-1]]/2^IntegerExponent[n, 2], {n, 0, max}]
    (* or (from 2nd formula) : *) Table[ Numerator[ CatalanNumber[n-1]/2^(2n-1)]*Numerator[n^2/2^n], {n, 0, max}] (* Jean-François Alcover, Jan 31 2013 *)

Formula

a(n) = A000265(n) * A001790(n-1).
a(n) = A098597(n-1) * A191871(n). See also A181318
a(n) = numerator of n*binomial(2n-2,n-1)/4^(n-1). - Nathaniel Johnston, Dec 16 2022

Extensions

a(11)-a(25) from Jean-François Alcover, Jan 13 2013

A138773 Triangle read by rows: T(n,k) is the coefficient of x^k in the polynomial P[n](x) = b(n)Q[n](x), where b(n) = numerator of binomial(2n,n)/2^n = A001790(n) and Q[n](x) = F(-n,1; 1/2-n; x) (hypergeometric function); 0 <= k <= n.

Original entry on oeis.org

1, 1, 2, 3, 4, 8, 5, 6, 8, 16, 35, 40, 48, 64, 128, 63, 70, 80, 96, 128, 256, 231, 252, 280, 320, 384, 512, 1024, 429, 462, 504, 560, 640, 768, 1024, 2048, 6435, 6864, 7392, 8064, 8960, 10240, 12288, 16384, 32768, 12155, 12870, 13728, 14784, 16128, 17920, 20480, 24576, 32768, 65536
Offset: 0

Views

Author

Emeric Deutsch, Apr 12 2008

Keywords

Comments

The polynomials Q[n](x) arise in a contact problem in elasticity theory.
Row sums yield A001803.
T(n,0) = A001790(n).
T(n,n) = A046161(n).

Examples

			Triangle begins:
   1,
   1,  2,
   3,  4,  8,
   5,  6,  8, 16,
  35, 40, 48, 64, 128,
  63, 70, 80, 96, 128, 256,
  ...
		

References

  • E. G. Deich (E. Deutsch), On an axially symmetric contact problem for a non-plane stamp with a circular cross-section (in Russian), Prikl. Mat. Mekh., 26, No. 5, 1962, 931-934.

Crossrefs

Cf. A001803 (row sums), A001790 (1st column), A046161 (right diagonal).

Programs

  • Maple
    p:=proc(n) options operator, arrow: numer(simplify(hypergeom([ -n, 1], [1/2-n], x))) end proc: for n from 0 to 9 do P[n]:=p(n) end do: for n from 0 to 9 do seq(coeff(P[n],x,k),k=0..n) end do;
  • Mathematica
    b[n_] := Numerator[Binomial[2n, n]/2^n];
    Q[n_][x_] := HypergeometricPFQ[{-n, 1}, {1/2 - n}, x];
    T[n_, k_] := Coefficient[b[n]*Q[n][x], x, k];
    Table[T[n, k], {n, 0, 9}, {k, 0, n}] // Flatten (* Jean-François Alcover, Jul 23 2024 *)

Formula

Q[n](x) = (2n+1)*(Integral_{t=0..sqrt(1-x)} (x+t^2)^n dt)/sqrt(1-x).
Q[n](x) = 1 + 2*n*x*Q[n-1](x)/(2n-1).

A000120 1's-counting sequence: number of 1's in binary expansion of n (or the binary weight of n).

Original entry on oeis.org

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

Views

Author

Keywords

Comments

The binary weight of n is also called Hamming weight of n. [The term "Hamming weight" was named after the American mathematician Richard Wesley Hamming (1915-1998). - Amiram Eldar, Jun 16 2021]
a(n) is also the largest integer such that 2^a(n) divides binomial(2n, n) = A000984(n). - Benoit Cloitre, Mar 27 2002
To construct the sequence, start with 0 and use the rule: If k >= 0 and a(0), a(1), ..., a(2^k-1) are the first 2^k terms, then the next 2^k terms are a(0) + 1, a(1) + 1, ..., a(2^k-1) + 1. - Benoit Cloitre, Jan 30 2003
An example of a fractal sequence. That is, if you omit every other number in the sequence, you get the original sequence. And of course this can be repeated. So if you form the sequence a(0 * 2^n), a(1 * 2^n), a(2 * 2^n), a(3 * 2^n), ... (for any integer n > 0), you get the original sequence. - Christopher.Hills(AT)sepura.co.uk, May 14 2003
The n-th row of Pascal's triangle has 2^k distinct odd binomial coefficients where k = a(n) - 1. - Lekraj Beedassy, May 15 2003
Fixed point of the morphism 0 -> 01, 1 -> 12, 2 -> 23, 3 -> 34, 4 -> 45, etc., starting from a(0) = 0. - Robert G. Wilson v, Jan 24 2006
a(n) is the number of times n appears among the mystery calculator sequences: A005408, A042964, A047566, A115419, A115420, A115421. - Jeremy Gardiner, Jan 25 2006
a(n) is the number of solutions of the Diophantine equation 2^m*k + 2^(m-1) + i = n, where m >= 1, k >= 0, 0 <= i < 2^(m-1); a(5) = 2 because only (m, k, i) = (1, 2, 0) [2^1*2 + 2^0 + 0 = 5] and (m, k, i) = (3, 0, 1) [2^3*0 + 2^2 + 1 = 5] are solutions. - Hieronymus Fischer, Jan 31 2006
The first appearance of k, k >= 0, is at a(2^k-1). - Robert G. Wilson v, Jul 27 2006
Sequence is given by T^(infinity)(0) where T is the operator transforming any word w = w(1)w(2)...w(m) into T(w) = w(1)(w(1)+1)w(2)(w(2)+1)...w(m)(w(m)+1). I.e., T(0) = 01, T(01) = 0112, T(0112) = 01121223. - Benoit Cloitre, Mar 04 2009
For n >= 2, the minimal k for which a(k(2^n-1)) is not multiple of n is 2^n + 3. - Vladimir Shevelev, Jun 05 2009
Triangle inequality: a(k+m) <= a(k) + a(m). Equality holds if and only if C(k+m, m) is odd. - Vladimir Shevelev, Jul 19 2009
a(k*m) <= a(k) * a(m). - Robert Israel, Sep 03 2023
The number of occurrences of value k in the first 2^n terms of the sequence is equal to binomial(n, k), and also equal to the sum of the first n - k + 1 terms of column k in the array A071919. Example with k = 2, n = 7: there are 21 = binomial(7,2) = 1 + 2 + 3 + 4 + 5 + 6 2's in a(0) to a(2^7-1). - Brent Spillner (spillner(AT)acm.org), Sep 01 2010, simplified by R. J. Mathar, Jan 13 2017
Let m be the number of parts in the listing of the compositions of n as lists of parts in lexicographic order, a(k) = n - length(composition(k)) for all k < 2^n and all n (see example); A007895 gives the equivalent for compositions into odd parts. - Joerg Arndt, Nov 09 2012
From Daniel Forgues, Mar 13 2015: (Start)
Just tally up row k (binary weight equal k) from 0 to 2^n - 1 to get the binomial coefficient C(n,k). (See A007318.)
0 1 3 7 15
0: O | . | . . | . . . . | . . . . . . . . |
1: | O | O . | O . . . | O . . . . . . . |
2: | | O | O O . | O O . O . . . |
3: | | | O | O O O . |
4: | | | | O |
Due to its fractal nature, the sequence is quite interesting to listen to.
(End)
The binary weight of n is a particular case of the digit sum (base b) of n. - Daniel Forgues, Mar 13 2015
The mean of the first n terms is 1 less than the mean of [a(n+1),...,a(2n)], which is also the mean of [a(n+2),...,a(2n+1)]. - Christian Perfect, Apr 02 2015
a(n) is also the largest part of the integer partition having viabin number n. The viabin number of an integer partition is defined in the following way. Consider the southeast border of the Ferrers board of the integer partition and consider the binary number obtained by replacing each east step with 1 and each north step, except the last one, with 0. The corresponding decimal form is, by definition, the viabin number of the given integer partition. "Viabin" is coined from "via binary". For example, consider the integer partition [2, 2, 2, 1]. The southeast border of its Ferrers board yields 10100, leading to the viabin number 20. - Emeric Deutsch, Jul 20 2017
a(n) is also known as the population count of the binary representation of n. - Chai Wah Wu, May 19 2020

Examples

			Using the formula a(n) = a(floor(n / floor_pow4(n))) + a(n mod floor_pow4(n)):
  a(4) = a(1) + a(0) = 1,
  a(8) = a(2) + a(0) = 1,
  a(13) = a(3) + a(1) = 2 + 1 = 3,
  a(23) = a(1) + a(7) = 1 + a(1) + a(3) = 1 + 1 + 2 = 4.
_Gary W. Adamson_ points out (Jun 03 2009) that this can be written as a triangle:
  0,
  1,
  1,2,
  1,2,2,3,
  1,2,2,3,2,3,3,4,
  1,2,2,3,2,3,3,4,2,3,3,4,3,4,4,5,
  1,2,2,3,2,3,3,4,2,3,3,4,3,4,4,5,2,3,3,4,3,4,4,5,3,4,4,5,4,5,5,6,
  1,2,2,3,2,3,...
where the rows converge to A063787.
From _Joerg Arndt_, Nov 09 2012: (Start)
Connection to the compositions of n as lists of parts (see comment):
[ #]:   a(n)  composition
[ 0]:   [0]   1 1 1 1 1
[ 1]:   [1]   1 1 1 2
[ 2]:   [1]   1 1 2 1
[ 3]:   [2]   1 1 3
[ 4]:   [1]   1 2 1 1
[ 5]:   [2]   1 2 2
[ 6]:   [2]   1 3 1
[ 7]:   [3]   1 4
[ 8]:   [1]   2 1 1 1
[ 9]:   [2]   2 1 2
[10]:   [2]   2 2 1
[11]:   [3]   2 3
[12]:   [2]   3 1 1
[13]:   [3]   3 2
[14]:   [3]   4 1
[15]:   [4]   5
(End)
		

References

  • Jean-Paul Allouche and Jeffrey Shallit, Automatic Sequences, Cambridge Univ. Press, 2003, p. 119.
  • Donald E. Knuth, The Art of Computer Programming, vol. 4A, Combinatorial Algorithms, Section 7.1.3, Problem 41, p. 589. - N. J. A. Sloane, Aug 03 2012
  • Manfred R. Schroeder, Fractals, Chaos, Power Laws. W.H. Freeman, 1991, p. 383.
  • 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

The basic sequences concerning the binary expansion of n are this one, A000788, A000069, A001969, A023416, A059015, A007088.
Partial sums see A000788. For run lengths see A131534. See also A001792, A010062.
Number of 0's in n: A023416 and A080791.
a(n) = n - A011371(n).
Sum of digits of n written in bases 2-16: this sequence, A053735, A053737, A053824, A053827, A053828, A053829, A053830, A007953, A053831, A053832, A053833, A053834, A053835, A053836.
This is Guy Steele's sequence GS(3, 4) (see A135416).
Cf. A230952 (boustrophedon transform).
Cf. A070939 (length of binary representation of n).

Programs

  • Fortran
    c See link in A139351
    
  • Haskell
    import Data.Bits (Bits, popCount)
    a000120 :: (Integral t, Bits t) => t -> Int
    a000120 = popCount
    a000120_list = 0 : c [1] where c (x:xs) = x : c (xs ++ [x,x+1])
    -- Reinhard Zumkeller, Aug 26 2013, Feb 19 2012, Jun 16 2011, Mar 07 2011
    
  • Haskell
    a000120 = concat r
        where r = [0] : (map.map) (+1) (scanl1 (++) r)
    -- Luke Palmer, Feb 16 2014
    
  • Magma
    [Multiplicity(Intseq(n, 2), 1): n in [0..104]]; // Marius A. Burtea, Jan 22 2020
    
  • Magma
    [&+Intseq(n, 2):n in [0..104]]; // Marius A. Burtea, Jan 22 2020
  • Maple
    A000120 := proc(n) local w,m,i; w := 0; m := n; while m > 0 do i := m mod 2; w := w+i; m := (m-i)/2; od; w; end: wt := A000120;
    A000120 := n -> add(i, i=convert(n,base,2)): # Peter Luschny, Feb 03 2011
    with(Bits): p:=n->ilog2(n-And(n,n-1)): seq(p(binomial(2*n,n)),n=0..200) # Gary Detlefs, Jan 27 2019
  • Mathematica
    Table[DigitCount[n, 2, 1], {n, 0, 105}]
    Nest[Flatten[# /. # -> {#, # + 1}] &, {0}, 7] (* Robert G. Wilson v, Sep 27 2011 *)
    Table[Plus @@ IntegerDigits[n, 2], {n, 0, 104}]
    Nest[Join[#, # + 1] &, {0}, 7] (* IWABUCHI Yu(u)ki, Jul 19 2012 *)
    Log[2, Nest[Join[#, 2#] &, {1}, 14]] (* gives 2^14 term, Carlos Alves, Mar 30 2014 *)
  • PARI
    {a(n) = if( n<0, 0, 2*n - valuation((2*n)!, 2))};
    
  • PARI
    {a(n) = if( n<0, 0, subst(Pol(binary(n)), x ,1))};
    
  • PARI
    {a(n) = if( n<1, 0, a(n\2) + n%2)}; /* Michael Somos, Mar 06 2004 */
    
  • PARI
    a(n)=my(v=binary(n));sum(i=1,#v,v[i]) \\ Charles R Greathouse IV, Jun 24 2011
    
  • PARI
    a(n)=norml2(binary(n)) \\ better use {A000120=hammingweight}. - M. F. Hasler, Oct 09 2012, edited Feb 27 2020
    
  • PARI
    a(n)=hammingweight(n) \\ Michel Marcus, Oct 19 2013
    (Common Lisp) (defun floor-to-power (n pow) (declare (fixnum pow)) (expt pow (floor (log n pow)))) (defun enabled-bits (n) (if (< n 4) (n-th n (list 0 1 1 2)) (+ (enabled-bits (floor (/ n (floor-to-power n 4)))) (enabled-bits (mod n (floor-to-power n 4)))))) ; Stephen K. Touset (stephen(AT)touset.org), Apr 04 2007
    
  • Python
    def A000120(n): return bin(n).count('1') # Chai Wah Wu, Sep 03 2014
    
  • Python
    import numpy as np
    A000120 = np.array([0], dtype="uint8")
    for bitrange in range(25): A000120 = np.append(A000120, np.add(A000120, 1))
    print([A000120[n] for n in range(0, 105)]) # Karl-Heinz Hofmann, Nov 07 2022
    
  • Python
    def A000120(n): return n.bit_count() # Requires Python 3.10 or higher. - Pontus von Brömssen, Nov 08 2022
    
  • Python
    # Also see links.
    
  • SageMath
    def A000120(n):
        if n <= 1: return Integer(n)
        return A000120(n//2) + n%2
    [A000120(n) for n in range(105)]  # Peter Luschny, Nov 19 2012
    
  • SageMath
    def A000120(n) : return sum(n.digits(2)) # Eric M. Schmidt, Apr 26 2013
    
  • Scala
    (0 to 127).map(Integer.bitCount()) // _Alonso del Arte, Mar 05 2019
    

Formula

a(0) = 0, a(2*n) = a(n), a(2*n+1) = a(n) + 1.
a(0) = 0, a(2^i) = 1; otherwise if n = 2^i + j with 0 < j < 2^i, a(n) = a(j) + 1.
G.f.: Product_{k >= 0} (1 + y*x^(2^k)) = Sum_{n >= 0} y^a(n)*x^n. - N. J. A. Sloane, Jun 04 2009
a(n) = a(n-1) + 1 - A007814(n) = log_2(A001316(n)) = 2n - A005187(n) = A070939(n) - A023416(n). - Henry Bottomley, Apr 04 2001; corrected by Ralf Stephan, Apr 15 2002
a(n) = log_2(A000984(n)/A001790(n)). - Benoit Cloitre, Oct 02 2002
For n > 0, a(n) = n - Sum_{k=1..n} A007814(k). - Benoit Cloitre, Oct 19 2002
a(n) = n - Sum_{k>=1} floor(n/2^k) = n - A011371(n). - Benoit Cloitre, Dec 19 2002
G.f.: (1/(1-x)) * Sum_{k>=0} x^(2^k)/(1+x^(2^k)). - Ralf Stephan, Apr 19 2003
a(0) = 0, a(n) = a(n - 2^floor(log_2(n))) + 1. Examples: a(6) = a(6 - 2^2) + 1 = a(2) + 1 = a(2 - 2^1) + 1 + 1 = a(0) + 2 = 2; a(101) = a(101 - 2^6) + 1 = a(37) + 1 = a(37 - 2^5) + 2 = a(5 - 2^2) + 3 = a(1 - 2^0) + 4 = a(0) + 4 = 4; a(6275) = a(6275 - 2^12) + 1 = a(2179 - 2^11) + 2 = a(131 - 2^7) + 3 = a(3 - 2^1) + 4 = a(1 - 2^0) + 5 = 5; a(4129) = a(4129 - 2^12) + 1 = a(33 - 2^5) + 2 = a(1 - 2^0) + 3 = 3. - Hieronymus Fischer, Jan 22 2006
A fixed point of the mapping 0 -> 01, 1 -> 12, 2 -> 23, 3 -> 34, 4 -> 45, ... With f(i) = floor(n/2^i), a(n) is the number of odd numbers in the sequence f(0), f(1), f(2), f(3), f(4), f(5), ... - Philippe Deléham, Jan 04 2004
When read mod 2 gives the Morse-Thue sequence A010060.
Let floor_pow4(n) denote n rounded down to the next power of four, floor_pow4(n) = 4 ^ floor(log4 n). Then a(0) = 0, a(1) = 1, a(2) = 1, a(3) = 2, a(n) = a(floor(n / floor_pow4(n))) + a(n % floor_pow4(n)). - Stephen K. Touset (stephen(AT)touset.org), Apr 04 2007
a(n) = n - Sum_{k=2..n} Sum_{j|n, j >= 2} (floor(log_2(j)) - floor(log_2(j-1))). - Hieronymus Fischer, Jun 18 2007
a(n) = A138530(n, 2) for n > 1. - Reinhard Zumkeller, Mar 26 2008
a(A077436(n)) = A159918(A077436(n)); a(A000290(n)) = A159918(n). - Reinhard Zumkeller, Apr 25 2009
a(n) = A063787(n) - A007814(n). - Gary W. Adamson, Jun 04 2009
a(n) = A007814(C(2n, n)) = 1 + A007814(C(2n-1, n)). - Vladimir Shevelev, Jul 20 2009
For odd m >= 1, a((4^m-1)/3) = a((2^m+1)/3) + (m-1)/2 (mod 2). - Vladimir Shevelev, Sep 03 2010
a(n) - a(n-1) = { 1 - a(n-1) if and only if A007814(n) = a(n-1), 1 if and only if A007814(n) = 0, -1 for all other A007814(n) }. - Brent Spillner (spillner(AT)acm.org), Sep 01 2010
a(A001317(n)) = 2^a(n). - Vladimir Shevelev, Oct 25 2010
a(n) = A139351(n) + A139352(n) = Sum_k {A030308(n, k)}. - Philippe Deléham, Oct 14 2011
From Hieronymus Fischer, Jun 10 2012: (Start)
a(n) = Sum_{j = 1..m+1} (floor(n/2^j + 1/2) - floor(n/2^j)), where m = floor(log_2(n)).
General formulas for the number of digits >= d in the base p representation of n, where 1 <= d < p: a(n) = Sum_{j = 1..m+1} (floor(n/p^j + (p-d)/p) - floor(n/p^j)), where m=floor(log_p(n)); g.f.: g(x) = (1/(1-x))*Sum_{j>=0} (x^(d*p^j) - x^(p*p^j))/(1-x^(p*p^j)). (End)
a(n) = A213629(n, 1) for n > 0. - Reinhard Zumkeller, Jul 04 2012
a(n) = A240857(n,n). - Reinhard Zumkeller, Apr 14 2014
a(n) = log_2(C(2*n,n) - (C(2*n,n) AND C(2*n,n)-1)). - Gary Detlefs, Jul 10 2014
Sum_{n >= 1} a(n)/2n(2n+1) = (gamma + log(4/Pi))/2 = A344716, where gamma is Euler's constant A001620; see Sondow 2005, 2010 and Allouche, Shallit, Sondow 2007. - Jonathan Sondow, Mar 21 2015
For any integer base b >= 2, the sum of digits s_b(n) of expansion base b of n is the solution of this recurrence relation: s_b(n) = 0 if n = 0 and s_b(n) = s_b(floor(n/b)) + (n mod b). Thus, a(n) satisfies: a(n) = 0 if n = 0 and a(n) = a(floor(n/2)) + (n mod 2). This easily yields a(n) = Sum_{i = 0..floor(log_2(n))} (floor(n/2^i) mod 2). From that one can compute a(n) = n - Sum_{i = 1..floor(log_2(n))} floor(n/2^i). - Marek A. Suchenek, Mar 31 2016
Sum_{k>=1} a(k)/2^k = 2 * Sum_{k >= 0} 1/(2^(2^k)+1) = 2 * A051158. - Amiram Eldar, May 15 2020
Sum_{k>=1} a(k)/(k*(k+1)) = A016627 = log(4). - Bernard Schott, Sep 16 2020
a(m*(2^n-1)) >= n. Equality holds when 2^n-1 >= A000265(m), but also in some other cases, e.g., a(11*(2^2-1)) = 2 and a(19*(2^3-1)) = 3. - Pontus von Brömssen, Dec 13 2020
G.f.: A(x) satisfies A(x) = (1+x)*A(x^2) + x/(1-x^2). - Akshat Kumar, Nov 04 2023

A002193 Decimal expansion of square root of 2.

Original entry on oeis.org

1, 4, 1, 4, 2, 1, 3, 5, 6, 2, 3, 7, 3, 0, 9, 5, 0, 4, 8, 8, 0, 1, 6, 8, 8, 7, 2, 4, 2, 0, 9, 6, 9, 8, 0, 7, 8, 5, 6, 9, 6, 7, 1, 8, 7, 5, 3, 7, 6, 9, 4, 8, 0, 7, 3, 1, 7, 6, 6, 7, 9, 7, 3, 7, 9, 9, 0, 7, 3, 2, 4, 7, 8, 4, 6, 2, 1, 0, 7, 0, 3, 8, 8, 5, 0, 3, 8, 7, 5, 3, 4, 3, 2, 7, 6, 4, 1, 5, 7
Offset: 1

Views

Author

Keywords

Comments

Sometimes called Pythagoras's constant.
Its continued fraction expansion is [1; 2, 2, 2, ...] (see A040000). - Arkadiusz Wesolowski, Mar 10 2012
The discovery of irrational numbers is attributed to Hippasus of Metapontum, who may have proved that sqrt(2) is not a rational number; thus sqrt(2) is often regarded as the earliest known irrational number. - Clark Kimberling, Oct 12 2017
From Clark Kimberling, Oct 12 2017: (Start)
In the first million digits,
0 occurs 99814 times;
1 occurs 99925 times;
2 occurs 100436 times;
3 occurs 100190 times;
4 occurs 100024 times;
5 occurs 100155 times;
6 occurs 99886 times;
7 occurs 100008 times;
8 occurs 100441 times;
9 occurs 100121 times. (End)
Diameter of a sphere whose surface area equals 2*Pi. More generally, the square root of x is also the diameter of a sphere whose surface area equals x*Pi. - Omar E. Pol, Nov 10 2018
Sqrt(2) = 1 + area of region bounded by y = sin x, y = cos x, and x = 0. - Clark Kimberling, Jul 03 2020
Also aspect ratio of the ISO 216 standard for paper sizes. - Stefano Spezia, Feb 24 2021
The standard deviation of a roll of a 5-sided die. - Mohammed Yaseen, Feb 23 2023
From Michal Paulovic, Mar 22 2023: (Start)
The length of a unit square diagonal.
The infinite tetration (power tower) sqrt(2)^(sqrt(2)^(sqrt(2)^(...))) equals 2 from the identity (x^(1/x))^((x^(1/x))^((x^(1/x))^(...))) = x where 1/e <= x <= e. (End)

Examples

			1.41421356237309504880168872420969807856967187537694807317667...
		

References

  • John H. Conway and Richard K. Guy, The Book of Numbers, New York: Springer-Verlag, 1996. See pp. 24, 182.
  • Steven R. Finch, Mathematical Constants, Encyclopedia of Mathematics and its Applications, vol. 94, Cambridge University Press, Section 1.1.
  • David Flannery, The Square Root of 2, Copernicus Books Springer-Praxis Pub. 2006.
  • Martin Gardner, Gardner's Workout, Chapter 2 "The Square Root of 2=1.414213562373095..." pp. 9-19 A. K. Peters MA 2002.
  • Jan Gullberg, Mathematics from the Birth of Numbers, W. W. Norton & Co., NY & London, 1997, §3.4 Irrational Numbers and §4.4 Powers and Roots, pp. 84, 145.
  • Alfred S. Posamentier, Math Charmers, Tantalizing Tidbits for the Mind, Prometheus Books, NY, 2003, pages 64-67.
  • B. Rittaud, Le fabuleux destin de sqrt(2), Le Pommier, Paris 2006.
  • 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 60, page 605.
  • David Wells, The Penguin Dictionary of Curious and Interesting Numbers. Penguin Books, NY, 1986, Revised edition 1987, pp. 34-35.

Crossrefs

Cf. A004539 (binary version).

Programs

  • Haskell
    -- After Michael B. Porter's PARI program.
    a002193 n = a002193_list !! (n-1)
    a002193_list = w 2 0 where
    w x r = dig : w (100 * (x - (20 * r + dig) * dig)) (10 * r + dig)
    where dig = head (dropWhile (\d -> (20 * r + d) * d < x) [0..]) - 1
    -- Reinhard Zumkeller, Nov 22 2013
  • Maple
    Digits:=100; evalf(sqrt(2)); # Wesley Ivan Hurt, Dec 04 2013
  • Mathematica
    RealDigits[N[2^(1/2), 128]] (* Vladimir Joseph Stephan Orlovsky, Dec 25 2008 *)
  • Maxima
    fpprec: 100$ ev(bfloat(sqrt(2))); /* Martin Ettl, Oct 17 2012 */
    
  • PARI
    default(realprecision, 20080); x=sqrt(2); for (n=1, 20000, d=floor(x); x=(x-d)*10; write("b002193.txt", n, " ", d)); \\ Harry J. Smith, Apr 21 2009
    
  • PARI
    r=0; x=2; /* Digit-by-digit method */
    for(digits=1,100,{d=0;while((20*r+d)*d <= x,d++);
    d--; /* while loop overshoots correct digit */
    print(d);x=100*(x-(20*r+d)*d);r=10*r+d}) \\ Michael B. Porter, Oct 20 2009
    
  • PARI
    \\ Works in v2.15.0; n = 100 decimal places
    my(n=100); digits(floor(10^n*quadgen(8))) \\ Michal Paulovic, Mar 22 2023
    

Formula

Sqrt(2) = 14 * Sum_{n >= 0} (A001790(n)/2^A005187(floor(n/2)) * 10^(-2n-1)) where A001790(n) are numerators in expansion of 1/sqrt(1-x) and the denominators in expansion of 1/sqrt(1-x) are 2^A005187(n). 14 = 2*7, see A010503 (expansion of 1/sqrt(2)). - Gerald McGarvey, Jan 01 2005
Limit_{n -> +oo} (1/n)*(Sum_{k = 1..n} frac(sqrt(1+zeta(k+1)))) = 1/(1+sqrt(2)). - Yalcin Aktar, Jul 14 2005
sqrt(2) = 2 + n*A167199(n-1)/A167199(n) as n -> infinity (conjecture). - Mats Granvik, Oct 30 2009
sqrt(2) = limit as n goes to infinity of A179807(n+1)/A179807(n) - 1. - Mats Granvik, Feb 15 2011
sqrt(2) = Product_{l=0..k-1} 2*cos((2*l+1)*Pi/(4*k)) = (Product_{l=0..k-1} R(2*l+1,rho(4*k)) - 1), identical for k >= 1, with the row polynomials R(n, x) from A127672 and rho(4*k) := 2*cos(Pi/(4*k)) is the length ratio (smallest diagonal)/side in a regular (4*k)-gon. From the product formula given in a Oct 21 2013 formula contribution to A056594, with n -> 2*k, using cos(Pi-alpha) = - cos(alpha) to obtain 2 for the square of the present product. - Wolfdieter Lang, Oct 22 2013
If x = sqrt(2), 1/log(x - 1) + 1/log(x + 1) = 0. - Kritsada Moomuang, Jul 10 2020
From Amiram Eldar, Jul 25 2020: (Start)
Equals Product_{k>=0} (1 + (-1)^k/(2*k + 1)).
Equals Sum_{k>=0} binomial(2*k,k)/8^k. (End)
Equals i^(1/2) + i^(-1/2). - Gary W. Adamson, Jul 11 2022
Equals (sqrt(2) + (sqrt(2) + (sqrt(2) + ...)^(1/3))^(1/3))^(1/3). - Michal Paulovic, Mar 22 2023
Equals 1 + Sum_{k>=1} (-1)^(k-1)/(2^(2*k)*(2*k - 1))*binomial(2*k,k) [Newton]. - Stefano Spezia, Oct 15 2024
From Antonio Graciá Llorente, Dec 19 2024: (Start)
Equals Sum_{k>=0} 2*k*binomial(2*k,k)/8^k.
Equals Product_{k>=2} k/sqrt(k^2 + 1).
Equals Product_{k>=0} (6*k + 3)/((6*k + 3) - (-1)^k).
Equals Product_{k>=1} (2*k + 1)/((2*k + 1) + (-1)^k).
Equals Product_{k>=0} ((4*k + 3)*(4*k + 1 + (-1)^k))/((4*k + 1)*(4*k + 3 + (-1)^k)). (End)
Equals hypergeom([1/2, 1/2], [1/2], 1/2). - Stefano Spezia, Jan 05 2025

A005187 a(n) = a(floor(n/2)) + n; also denominators in expansion of 1/sqrt(1-x) are 2^a(n); also 2n - number of 1's in binary expansion of 2n.

Original entry on oeis.org

0, 1, 3, 4, 7, 8, 10, 11, 15, 16, 18, 19, 22, 23, 25, 26, 31, 32, 34, 35, 38, 39, 41, 42, 46, 47, 49, 50, 53, 54, 56, 57, 63, 64, 66, 67, 70, 71, 73, 74, 78, 79, 81, 82, 85, 86, 88, 89, 94, 95, 97, 98, 101, 102, 104, 105, 109, 110, 112, 113, 116, 117, 119, 120, 127, 128
Offset: 0

Views

Author

N. J. A. Sloane, May 20 1991; Allan Wilks, Dec 11 1999

Keywords

Comments

Also exponent of the largest power of 2 dividing (2n)! (A010050) and (2n)!! (A000165).
Write n in binary: 1ab..yz, then a(n) = 1ab..yz + ... + 1ab + 1a + 1. - Ralf Stephan, Aug 27 2003
Also numbers having a partition into distinct Mersenne numbers > 0; A079559(a(n))=1; complement of A055938. - Reinhard Zumkeller, Mar 18 2009
Wikipedia's article on the "Whitney Immersion theorem" mentions that the a(n)-dimensional sphere arises in the Immersion Conjecture proved by Ralph Cohen in 1985. - Jonathan Vos Post, Jan 25 2010
For n > 0, denominators for consecutive pairs of integral numerator polynomials L(n+1,x) for the Legendre polynomials with o.g.f. 1 / sqrt(1-tx+x^2). - Tom Copeland, Feb 04 2016
a(n) is the total number of pointers in the first n elements of a perfect skip list. - Alois P. Heinz, Dec 14 2017
a(n) is the position of the n-th a (indexing from 0) in the fixed point of the morphism a -> aab, b -> b. - Jeffrey Shallit, Dec 24 2020
Numbers that can be expressed as the sum of distinct numbers of the form 2^k - 1 (lenient Mersenne numbers, A000225). This follows from the 2N - Hamming weight definition. A corollary is that these are the numbers with no 2 in their skew-binary representation (cf. A169683). - Allan C. Wechsler, Feb 25 2025

Examples

			G.f. = x + 3*x^2 + 4*x^3 + 7*x^4 + 8*x^5 + 10*x^6 + 11*x^7 + 15*x^8 + ...
		

References

  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Cf. A001511 (first differences), A122247 (partial sums), A055938 (complement).

Programs

  • Haskell
    a005187 n = a005187_list !! n
    a005187_list = 0 : zipWith (+) [1..] (map (a005187 . (`div` 2)) [1..])
    -- Reinhard Zumkeller, Nov 07 2011, Oct 05 2011
    
  • Magma
    [n + Valuation(Factorial(n), 2): n in [0..70]]; // Vincenzo Librandi, Jun 11 2019
    
  • Maple
    A005187 := n -> 2*n - add(i, i=convert(n, base, 2)):
    seq(A005187(n), n=0..65); # Peter Luschny, Apr 08 2014
  • Mathematica
    a[0] = 0; a[n_] := a[n] = a[Floor[n/2]] + n; Table[ a[n], {n, 0, 50}] (* or *)
    Table[IntegerExponent[(2n)!, 2], {n, 0, 65}] (* Robert G. Wilson v, Apr 19 2006 *)
    Table[2n-DigitCount[2n,2,1],{n,0,70}] (* Harvey P. Dale, May 24 2014 *)
  • PARI
    {a(n) = if( n<0, 0, valuation((2*n)!, 2))}; /* Michael Somos, Oct 24 2002 */
    
  • PARI
    {a(n) = if( n<0, 0, sum(k=1, n, (2*n)\2^k))}; /* Michael Somos, Oct 24 2002 */
    
  • PARI
    {a(n) = if( n<0, 0, 2*n - subst( Pol( binary( n ) ), x, 1) ) }; /* Michael Somos, Aug 28 2007 */
    
  • PARI
    a(n)=my(s=n);while(n>>=1,s+=n);s \\ Charles R Greathouse IV, Apr 07 2012
    
  • PARI
    a(n)=2*n-hammingweight(n) \\ Charles R Greathouse IV, Jan 07 2013
    
  • Python
    def A005187(n): return 2*n-bin(n).count('1') # Chai Wah Wu, Jun 03 2021
  • Sage
    @CachedFunction
    def A005187(n): return A005187(n//2) + n if n > 0 else 0
    [A005187(n) for n in range(66)]  # Peter Luschny, Dec 13 2012
    

Formula

a(n) = A011371(2n+1) = A011371(n) + n, n >= 0.
A046161(n) = 2^a(n).
For m>0, let q = floor(log_2(m)); a(2m+1) = 2^q + 3m + Sum_{k>=1} floor((m-2^q)/2^k); a(2m) = a(2m+1) - 1. - Len Smiley
a(n) = Sum_{k >= 0} floor(n/2^k) = n + A011371(n). - Henry Bottomley, Jul 03 2001
G.f.: A(x) = Sum_{k>=0} x^(2^k)/((1-x)*(1-x^(2^k))). - Ralf Stephan, Dec 24 2002
a(n) = Sum_{k=1..n} A001511(k), sum of binary Hamming distances between consecutive integers up to n. - Gary W. Adamson, Jun 15 2003
Conjecture: a(n) = 2n + O(log(n)). - Benoit Cloitre, Oct 07 2003 [true as a(n) = 2*n - hamming_weight(2*n). Joerg Arndt, Jun 10 2019]
Sum_{n=2^k..2^(k+1)-1} a(n) = 3*4^k - (k+4)*2^(k-1) = A085354(k). - Philippe Deléham, Feb 19 2004
From Hieronymus Fischer, Aug 14 2007: (Start)
Recurrence: a(n) = n + a(floor(n/2)); a(2n) = 2n + a(n); a(n*2^m) = 2*n*(2^m-1) + a(n).
a(2^m) = 2^(m+1) - 1, m >= 0.
Asymptotic behavior: a(n) = 2n + O(log(n)), a(n+1) - a(n) = O(log(n)); this follows from the inequalities below.
a(n) <= 2n-1; equality holds for powers of 2.
a(n) >= 2n-1-floor(log_2(n)); equality holds for n = 2^m-1, m > 0.
lim inf (2n - a(n)) = 1, for n-->oo.
lim sup (2n - log_2(n) - a(n)) = 0, for n-->oo.
lim sup (a(n+1) - a(n) - log_2(n)) = 1, for n-->oo. (End)
a(n) = 2n - A000120(n). - Paul Barry, Oct 26 2007
PURRS demo results: Bounds for a(n) = n + a(n/2) with initial conditions a(1) = 1: a(n) >= -2 + 2*n - log(n)*log(2)^(-1), a(n) <= 1 + 2*n for each n >= 1. - Alexander R. Povolotsky, Apr 06 2008
If n = 2^a_1 + 2^a_2 + ... + 2^a_k, then a(n) = n-k. This can be used to prove that 2^n maximally divides (2n!)/n!. - Jon Perry, Jul 16 2009
a(n) = Sum_{k>=0} A030308(n,k)*A000225(k+1). - Philippe Deléham, Oct 16 2011
a(n) = log_2(denominator(binomial(-1/2,n))). - Peter Luschny, Nov 25 2011
a(2n+1) = a(2n) + 1. - M. F. Hasler, Jan 24 2015
a(n) = A004134(n) - n. - Cyril Damamme, Aug 04 2015
G.f.: (1/(1 - x))*Sum_{k>=0} (2^(k+1) - 1)*x^(2^k)/(1 + x^(2^k)). - Ilya Gutkovskiy, Jul 23 2017

A046161 a(n) = denominator of binomial(2n,n)/4^n.

Original entry on oeis.org

1, 2, 8, 16, 128, 256, 1024, 2048, 32768, 65536, 262144, 524288, 4194304, 8388608, 33554432, 67108864, 2147483648, 4294967296, 17179869184, 34359738368, 274877906944, 549755813888, 2199023255552, 4398046511104, 70368744177664, 140737488355328, 562949953421312
Offset: 0

Views

Author

Keywords

Comments

Also denominator of e(0,n) (see Maple line). - N. J. A. Sloane, Feb 16 2002
Denominator of coefficient of x^n in (1+x)^(k/2) or (1-x)^(k/2) for any odd integer k. - Michael Somos, Sep 15 2004
Numerator of binomial(2n,n)/4^n = A001790(n).
Denominators in expansion of sqrt(c(x)), c(x) the g.f. of A000108. - Paul Barry, Jul 12 2005
Denominator of 2^m*Gamma(m+3/4)/(Gamma(3/4)*Gamma(m+1)). - Stephen Crowley, Mar 19 2007
Denominator in expansion of Jacobi_P(n,1/2,1/2,x). - Paul Barry, Feb 13 2008
This sequence equals the denominators of the coefficients of the series expansions of (1-x)^((-1-2*n)/2) for all integer values of n; see A161198 for detailed information. - Johannes W. Meijer, Jun 08 2009
Numerators of binomial transform of 1, -1/3, 1/5, -1/7, 1/9, ... (Madhava-Gregory-Leibniz series for Pi/4): 1, 2/3, 8/15, 16/35, 128/315, 256/693, .... First differences are -1/3, -2/15, -8/105, -16/315, -128/3465, -256/9009, ... which contain the same numerators, negated. The second differences are 1/5, 2/35, 8/315, 16/1155, 128/15015, ... again with the same numerators. Second column: 2/3, -2/15, 2/35, -2/63, 2/99; see A000466(n+1) = A005563(2n+1). Third column: 8*(1/15, -1/105, 1/315, -1/693, ...), see A061550. See A173294 and A173296. - Paul Curtz, Feb 16 2010
0, 1, 5/3, 11/5, 93/35, 193/63, 793/231, ... = (0 followed by A120778(n))/A001790(n) is the binomial transform of 0, 1, -1/3, 1/5, -1/7, 1/9, ... . See A173755 and formula below. - Paul Curtz, Mar 13 2013
Numerator of power series of arcsin(x)/sqrt(1-x^2), centered at x=0. - John Molokach, Aug 02 2013
Denominators of coefficients in the Taylor series expansion of Sum_{n>=0} exp((-1)^n * Euler(2*n)*x^n/(2*n)), see A280442 for the numerators. - Johannes W. Meijer, Jan 05 2017
Denominators of Pochhammer(n+1, -1/2)/sqrt(Pi). - Adam Hugill, Sep 11 2022
a(n) is the denominator of the mean value of cos(x)^(2*n) from x = 0 to 2*Pi. - Stefano Spezia, May 16 2023
4^n/binomial(2n,n) is the expected value of the number of socks that are randomly drawn out of a drawer of n different pairs of socks, when one sock is drawn out at a time until a matching pair is found (King and King, 2005). - Amiram Eldar, Jul 02 2023
a(n) is the denominator of (1/Pi) * Integral_{x=-oo..+oo} sech(x)^(2*n+1) dx. The corresponding numerator is A001790(n). - Mohammed Yaseen, Jul 29 2023
a(n) is the numerator of Integral_{x=0..Pi/2} sin(x)^(2*n+1) dx. The corresponding denominator is A001803(n). - Mohammed Yaseen, Sep 22 2023

Examples

			sqrt(1+x) = 1 + (1/2)*x - (1/8)*x^2 + (1/16)*x^3 - (5/128)*x^4 + (7/256)*x^5 - (21/1024)*x^6 + (33/2048)*x^7 + ...
binomial(2n,n)/4^n => 1, 1/2, 3/8, 5/16, 35/128, 63/256, 231/1024, 429/2048, 6435/32768, ...
The sequence e(0,n) begins 1, 3/2, 21/8, 77/16, 1155/128, 4389/256, 33649/1024, 129789/2048, 4023459/32768, ...
		

References

  • W. Feller, An Introduction to Probability Theory and Its Applications, Vol. 1, 2nd ed. New York: Wiley, 1968; Chap. III, Eq. 4.1.
  • B. D. Hughes, Random Walks and Random Environments, Oxford 1995, vol. 1, p. 513, Eq. (7.282).
  • Eli Maor, e: The Story of a Number. Princeton, New Jersey: Princeton University Press (1994), p. 72.
  • Jerome Spanier and Keith B. Oldham, "Atlas of Functions", Hemisphere Publishing Corp., 1987, chapter 6, equations 6:14:5 - 6:14:9 at pages 50-51.

Crossrefs

Cf. A161198 triangle related to the series expansions of (1-x)^((-1-2*n)/2) for all values of n.

Programs

  • Magma
    [Denominator(Binomial(2*n,n)/4^n): n in [0..30]]; // Vincenzo Librandi, Jul 18 2015
    
  • Maple
    e := proc(l,m) local k; add(2^(k-2*m)*binomial(2*m-2*k,m-k)* binomial(m+k, m) *binomial(k,l), k=l..m); end: seq(denom(e(0,n)), n = 0..24);
    Z[0]:=0: for k to 30 do Z[k]:=simplify(1/(2-z*Z[k-1])) od: g:=sum((Z[j]-Z[j-1]), j=1..30): gser:=series(g, z=0, 27): seq(denom(coeff(gser, z, n)), n=-1..23); # Zerinvary Lajos, May 21 2008
    A046161 := proc(n) option remember: if n = 0 then 1 else 2^A001511(n) * procname(n-1) fi: end: A001511 := proc(n): padic[ordp](2*n, 2) end: seq(A046161(n), n = 0..24); # Johannes W. Meijer, Nov 04 2012
    A046161 := n -> 4^n/2^add(i,i=convert(n, base, 2)):
    seq(A046161(n), n=0..24); # Peter Luschny, Apr 08 2014
  • Mathematica
    a[n_, m_] := Binomial[n - m/2 + 1, n - m + 1] - Binomial[n - m/2, n - m + 1]; s[n_] := Sum[ a[n, k], {k, 0, n}]; Table [Denominator[s[n]], {n, 0, 26}] (* Michele Dondi (bik.mido(AT)tiscalinet.it), Jul 11 2002 *)
    Denominator[Table[Binomial[2n,n]/4^n,{n,0,30}]] (* Harvey P. Dale, Oct 29 2012 *)
    Table[Denominator@LegendreP[2n,0],{n,0,24}] (* Andres Cicuttin, Jan 22 2018 *)
  • Maxima
    a(n) := denom(binomial(-1/2,n));
    makelist(a(n),n,0,24); /* Peter Luschny, Nov 21 2012 */
    
  • PARI
    a(n)=if(n<0,0,denominator(binomial(2*n,n)/4^n)) /* Michael Somos, Sep 15 2004 */
    
  • PARI
    a(n)=my(s=n);while(n>>=1,s+=n);2^s \\ Charles R Greathouse IV, Apr 07 2012
    
  • PARI
    a(n)=denominator(I^-n*pollegendre(n,I/2)) \\ Charles R Greathouse IV, Mar 18 2017
    
  • Python
    def A046161(n): return 1<<(n<<1)-n.bit_count() # Chai Wah Wu, Nov 15 2022
  • Sage
    def A046161(n):
        A005187 = lambda n: A005187(n//2) + n if n > 0 else 0
        return 2^A005187(n)
    [A046161(n) for n in (0..24)]  # Peter Luschny, Nov 16 2012
    

Formula

a(n) = 2^(2*n - 1 - A048881(n-1)), if n > 0.
a(n) = 2^A005187(n).
a(n) = 4^n/2^A000120(n). - Michael Somos, Sep 15 2004
a(n) = 2^A001511(n)*a(n-1) with a(0) = 1. - Johannes W. Meijer, Nov 04 2012
a(n) = denominator(binomial(-1/2,n)). - Peter Luschny, Nov 21 2012
a(n) = (0 followed by A120778(n)) + A001790(n). - Paul Curtz, Mar 13 2013
a(n) = 2^n*A060818(n). - Johannes W. Meijer, Jan 05 2017
a(n)/A001790(n) ~ sqrt(Pi*n) (King and King, 2005). - Amiram Eldar, Jul 02 2023

A048896 a(n) = 2^(A000120(n+1) - 1), n >= 0.

Original entry on oeis.org

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

Views

Author

Keywords

Comments

a(n) = 2^A048881 = 2^{maximal power of 2 dividing the n-th Catalan number (A000108)}. [Comment corrected by N. J. A. Sloane, Apr 30 2018]
Row sums of triangle A128937. - Philippe Deléham, May 02 2007
a(n) = sum of (n+1)-th row terms of triangle A167364. - Gary W. Adamson, Nov 01 2009
a(n), n >= 1: Numerators of Maclaurin series for 1 - ((sin x)/x)^2, A117972(n), n >= 2: Denominators of Maclaurin series for 1 - ((sin x)/x)^2, the correlation function in Montgomery's pair correlation conjecture. - Daniel Forgues, Oct 16 2011
For n > 0: a(n) = A007954(A007931(n)). - Reinhard Zumkeller, Oct 26 2012
a(n) = A261363(2*(n+1), n+1). - Reinhard Zumkeller, Aug 16 2015
From Gus Wiseman, Oct 30 2022: (Start)
Also the number of coarsenings of the (n+1)-th composition in standard order. The k-th composition in standard order (graded reverse-lexicographic, A066099) is obtained by taking the set of positions of 1's in the reversed binary expansion of k, prepending 0, taking first differences, and reversing again. This gives a bijective correspondence between nonnegative integers and integer compositions. See link for sequences related to standard compositions. For example, the a(10) = 4 coarsenings of (2,1,1) are: (2,1,1), (2,2), (3,1), (4).
Also the number of times n+1 appears in A357134. For example, 11 appears at positions 11, 20, 33, and 1024, so a(10) = 4.
(End)

Examples

			From _Omar E. Pol_, Jul 21 2009: (Start)
If written as a triangle:
  1;
  1,2;
  1,2,2,4;
  1,2,2,4,2,4,4,8;
  1,2,2,4,2,4,4,8,2,4,4,8,4,8,8,16;
  1,2,2,4,2,4,4,8,2,4,4,8,4,8,8,16,2,4,4,8,4,8,8,16,4,8,8,16,8,16,16,32;
  ...,
the first half-rows converge to Gould's sequence A001316.
(End)
		

Crossrefs

This is Guy Steele's sequence GS(3, 5) (see A135416).
Equals first right hand column of triangle A160468.
Equals A160469(n+1)/A002425(n+1).
Standard compositions are listed by A066099.
The opposite version (counting refinements) is A080100.
The version for Heinz numbers of partitions is A317141.

Programs

  • Haskell
    a048896 n = a048896_list !! n
    a048896_list = f [1] where f (x:xs) = x : f (xs ++ [x,2*x])
    -- Reinhard Zumkeller, Mar 07 2011
    
  • Haskell
    import Data.List (transpose)
    a048896 = a000079 . a000120
    a048896_list = 1 : concat (transpose
       [zipWith (-) (map (* 2) a048896_list) a048896_list,
        map (* 2) a048896_list])
    -- Reinhard Zumkeller, Jun 16 2013
    
  • Magma
    [Numerator(2^n / Factorial(n+1)): n in [0..100]]; // Vincenzo Librandi, Apr 12 2014
  • Maple
    a := n -> 2^(add(i,i=convert(n+1,base,2))-1): seq(a(n), n=0..97); # Peter Luschny, May 01 2009
  • Mathematica
    NestList[Flatten[#1 /. a_Integer -> {a, 2 a}] &, {1}, 4] // Flatten (* Robert G. Wilson v, Aug 01 2012 *)
    Table[Numerator[2^n / (n + 1)!], {n, 0, 200}] (* Vincenzo Librandi, Apr 12 2014 *)
    Denominator[Table[BernoulliB[2*n] / (Zeta[2*n]/Pi^(2*n)), {n, 1, 100}]] (* Terry D. Grant, May 29 2017 *)
    Table[Denominator[((2 n)!/2^(2 n + 1)) (-1)^n], {n, 1, 100}]/4 (* Terry D. Grant, May 29 2017 *)
    2^IntegerExponent[CatalanNumber[Range[0,100]],2] (* Harvey P. Dale, Apr 30 2018 *)
  • PARI
    a(n)=if(n<1,1,if(n%2,a(n/2-1/2),2*a(n-1)))
    
  • PARI
    a(n) = 1 << (hammingweight(n+1)-1); \\ Kevin Ryde, Feb 19 2022
    

Formula

a(n) = 2^A048881(n).
a(n) = 2^k if 2^k divides A000108(n) but 2^(k+1) does not divide A000108(n).
It appears that a(n) = Sum_{k=0..n} binomial(2*(n+1), k) mod 2. - Christopher Lenard (c.lenard(AT)bendigo.latrobe.edu.au), Aug 20 2001
a(0) = 1; a(2*n) = 2*a(2*n-1); a(2*n+1) = a(n).
a(n) = (1/2) * A001316(n+1). - Mohammed Bouayoun (bouyao(AT)wanadoo.fr), Mar 26 2004
It appears that a(n) = Sum_{k=0..2n} floor(binomial(2n+2, k+1)/2)(-1)^k = 2^n - Sum_{k=0..n+1} floor(binomial(n+1, k)/2). - Paul Barry, Dec 24 2004
a(n) = Sum_{k=0..n} (T(n,k) mod 2) where T = A039598, A053121, A052179, A124575, A126075, A126093. - Philippe Deléham, May 02 2007
a(n) = numerator(b(n)), where sin(x)^2/x = Sum_{n>0} b(n)*(-1)^n x^(2*n-1). - Vladimir Kruchinin, Feb 06 2013
a((2*n+1)*2^p-1) = A001316(n), p >= 0 and n >= 0. - Johannes W. Meijer, Feb 12 2013
a(n) = numerator(2^n / (n+1)!). - Vincenzo Librandi, Apr 12 2014
a(2n) = (2n+1)!/(n!n!)/A001803(n). - Richard Turk, Aug 23 2017
a(2n-1) = (2n-1)!/(n!(n-1)!)/A001790(n). - Richard Turk, Aug 23 2017

Extensions

New definition from N. J. A. Sloane, Mar 01 2008

A001803 Numerators in expansion of (1 - x)^(-3/2).

Original entry on oeis.org

1, 3, 15, 35, 315, 693, 3003, 6435, 109395, 230945, 969969, 2028117, 16900975, 35102025, 145422675, 300540195, 9917826435, 20419054425, 83945001525, 172308161025, 1412926920405, 2893136075115, 11835556670925
Offset: 0

Views

Author

Keywords

Comments

a(n) is the denominator of the integral from 0 to Pi of (sin(x))^(2*n+1). - James R. Buddenhagen, Aug 17 2008
a(n) is the denominator of (2n)!!/(2*n + 1)!! = 2^(2*n)*n!*n!/(2*n + 1)! (see Andersson). - N. J. A. Sloane, Jun 27 2011
a(n) = (2*n + 1)*A001790(n). A046161(n)/a(n) = 1, 2/3, 8/15, 16/35, 128/315, 256/693, ... is binomial transform of Madhava-Gregory-Leibniz series for Pi/4 (i.e., 1 - 1/3 + 1/5 - 1/7 + ... ). See A173384 and A173396. - Paul Curtz, Feb 21 2010
a(n) is the denominator of Integral_{x=-oo..oo} sech(x)^(2*n+2) dx. The corresponding numerator is A101926(n). - Mohammed Yaseen, Jul 25 2023

References

  • M. Abramowitz and I. A. Stegun, eds., Handbook of Mathematical Functions, National Bureau of Standards Applied Math. Series 55, 1964 (and various reprintings), p. 798.
  • G. Prévost, Tables de Fonctions Sphériques. Gauthier-Villars, Paris, 1933, pp. 156-157.
  • 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 6, equation 6:14:9 at page 51.

Crossrefs

The denominator is given in A046161.
Largest odd divisors of A001800, A002011, A002457, A005430, A033876, A086228.
Bisection of A004731, A004735, A086116.
Second column of triangle A100258.
Cf. A002596 (numerators in expansion of (1-x)^(1/2)).
Cf. A161198 (triangle related to the series expansions of (1-x)^((-1-2*n)/2)).
A163590 is the odd part of the swinging factorial, A001790 at even indices. - Peter Luschny, Aug 01 2009

Programs

  • Julia
    A001803(n) = sum(<<(A001790(k), A005187(n) - A005187(k)) for k in 0:n) # Peter Luschny, Oct 03 2019
    
  • Magma
    A001803:= func< n | Numerator(Binomial(n+2,2)*Catalan(n+1)/4^n) >;
    [A001803(n): n in [0..30]]; // G. C. Greubel, Apr 27 2025
    
  • Maple
    swing := proc(n) option remember; if n = 0 then 1 elif irem(n, 2) = 1 then swing(n-1)*n else 4*swing(n-1)/n fi end:
    sigma := n -> 2^(add(i,i= convert(iquo(n,2),base,2))):
    a := n -> swing(2*n+1)/sigma(2*n+1); # Peter Luschny, Aug 01 2009
    A001803 := proc(n) (2*n+1)*binomial(2*n,n)/4^n ; numer(%) ; end proc: # R. J. Mathar, Jul 06 2011
    a := n -> denom(Pi*binomial(n, -1/2)): seq(a(n), n = 0..22); # Peter Luschny, Dec 06 2024
  • Mathematica
    Numerator/@CoefficientList[Series[(1-x)^(-3/2),{x,0,25}],x]  (* Harvey P. Dale, Feb 19 2011 *)
    Table[Denominator[Beta[1, n + 1, 1/2]], {n, 0, 22}] (* Gerry Martens, Nov 13 2016 *)
  • PARI
    a(n) = numerator((2*n+1)*binomial(2*n,n)/(4^n)); \\ Altug Alkan, Sep 06 2018
    
  • SageMath
    def A001803(n): return numerator((n+1)*binomial(2*n+2,n+1)/2^(2*n+1))
    print([A001803(n) for n in range(31)]) # G. C. Greubel, Apr 27 2025

Formula

a(n) = (2*n + 1)! /(n!^2*2^A000120(n)) = (n + 1)*binomial(2*n+2,n+1)/2^(A000120(n)+1). - Ralf Stephan, Mar 10 2004
From Johannes W. Meijer, Jun 08 2009: (Start)
a(n) = numerator( (2*n+1)*binomial(2*n,n)/(4^n) ).
(1 - x)^(-3/2) = Sum_{n>=0} ((2*n+1)*binomial(2*n,n)/4^n)*x^n. (End)
Truncations of rational expressions like those given by the numerator or denominator operators are artifacts in integer formulas and have many disadvantages. A pure integer formula follows. Let n$ denote the swinging factorial and sigma(n) = number of '1's in the base-2 representation of floor(n/2). Then a(n) = (2*n+1)$ / sigma(2*n+1) = A056040(2*n+1) / A060632(2*n+2). Simply said: This sequence gives the odd part of the swinging factorial at odd indices. - Peter Luschny, Aug 01 2009
a(n) = denominator(Pi*binomial(n, -1/2)). - Peter Luschny, Dec 06 2024
Showing 1-10 of 79 results. Next