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.

Previous Showing 71-80 of 226 results. Next

A120562 Sum of binomial coefficients binomial(i+j, i) modulo 2 over all pairs (i,j) of positive integers satisfying 3i+j=n.

Original entry on oeis.org

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

Views

Author

Sam Northshield (samuel.northshield(AT)plattsburgh.edu), Aug 07 2006

Keywords

Comments

a(n) is the number of 'vectors' (..., e_k, e_{k-1}, ..., e_0) with e_k in {0,1,3} such that Sum_{k} e_k 2^k = n. a(2^n-1) = F(n+1)*a(2^{k+1}+j) + a(j) = a(2^k+j) + a(2^{k-1}+j) if 2^k > 4j. This sequence corresponds to the pair (3,1) as Stern's diatomic sequence [A002487] corresponds to (2,1) and Gould's sequence [A001316] corresponds to (1,1). There are many interesting similarities to A000119, the number of representations of n as a sum of distinct Fibonacci numbers.
A120562 can be generated from triangle A177444. Partial sums of A120562 = A177445. - Gary W. Adamson, May 08 2010
The Ca1 and Ca2 triangle sums, see A180662 for their definitions, of Sierpinski's triangle A047999 equal this sequence. Some A120562(2^n-p) sequences, 0 <= p <= 32, lead to known sequences, see the crossrefs. - Johannes W. Meijer, Jun 05 2011

Examples

			a(2^n)=1 since a(2n)=a(n).
		

Crossrefs

Cf. A001316 (1,1), A002487 (2,1), A120562 (3,1), A112970 (4,1), A191373 (5,1).
Cf. A177444, A177445. - Gary W. Adamson, May 08 2010
Cf. A000012 (p=0), A000045 (p=1, p=2, p=4, p=8, p=16, p=32), A000071 (p=3, p=6, p=12, p=13, p=24, p=26), A001610 (p=5, p=10, p=20), A001595 (p=7, p=14, p=28), A014739 (p=11, p=22, p=29), A111314 (p=15, p=30), A027961 (p=19), A154691 (p=21), A001911 (p=23). - Johannes W. Meijer, Jun 05 2011
Same recurrence for odd n as A000930.

Programs

  • Maple
    p := product((1+x^(2^i)+x^(3*2^i)), i=0..25): s := series(p, x, 1000): for k from 0 to 250 do printf(`%d, `, coeff(s, x, k)) od:
    A120562:=proc(n) option remember; if n <0 then A120562(n):=0 fi: if (n=0 or n=1) then 1 elif n mod 2 = 0 then A120562(n/2) else A120562((n-1)/2) + A120562((n-3)/2); fi; end: seq(A120562(n),n=0..64); # Johannes W. Meijer, Jun 05 2011
  • Mathematica
    a[0] = a[1] = 1; a[n_?EvenQ] := a[n] = a[n/2]; a[n_?OddQ] := a[n] = a[(n-1)/2] + a[(n-1)/2 - 1]; Table[a[n], {n, 0, 64}] (* Jean-François Alcover, Sep 29 2011 *)
    Nest[Append[#1, If[EvenQ@ #2, #1[[#2/2 + 1]], Total@ #1[[#2 ;; #2 + 1]] & @@ {#1, (#2 - 1)/2}]] & @@ {#, Length@ #} &, {1, 1}, 10^4 - 1] (* Michael De Vlieger, Feb 19 2019 *)

Formula

Recurrence; a(0)=a(1)=1, a(2*n)=a(n) and a(2*n+1)=a(n)+a(n-1).
G.f.: A(x) = Product_{i>=0} (1 + x^(2^i) + x^(3*2^i)) = (1 + x + x^3)*A(x^2).
a(n-1) << n^x with x = log_2(phi) = 0.69424... - Charles R Greathouse IV, Dec 27 2011

Extensions

Reference edited and link added by Jason G. Wurtzel, Aug 22 2010

A156769 a(n) = denominator(2^(2*n-2)/factorial(2*n-1)).

Original entry on oeis.org

1, 3, 15, 315, 2835, 155925, 6081075, 638512875, 10854718875, 1856156927625, 194896477400625, 49308808782358125, 3698160658676859375, 1298054391195577640625, 263505041412702261046875, 122529844256906551386796875, 4043484860477916195764296875
Offset: 1

Views

Author

Johannes W. Meijer, Feb 15 2009

Keywords

Comments

Resembles A036279, the denominators in the Taylor series for tan(x). The first difference occurs at a(12).
The numerators of the two formulas for this sequence lead to A001316, Gould's sequence.
Stephen Crowley indicated on Aug 25 2008 that a(n) = denominator(Zeta(2*n)/Zeta(1-2*n)) and here numerator((Zeta(2*n)/Zeta(1-2*n))/(2*(-1)^(n)*(Pi)^(2*n))) leads to Gould's sequence.
This sequence appears in the Eta and Zeta triangles A160464 and A160474. Its resemblance to the sequence of the denominators of the Taylor series for tan(x) led to the conjecture A156769(n) = A036279(n)*A089170(n-1). - Johannes W. Meijer, May 24 2009

Crossrefs

Cf. A036279 Denominators in Taylor series for tan(x).
Cf. A001316 Gould's sequence appears in the numerators.
Cf. A000265, A036279, A089170, A117972, A160464, A160469 (which resembles the numerators of the Taylor series for tan(x)), A160474. - Johannes W. Meijer, May 24 2009

Programs

  • Magma
    [Denominator(4^(n-1)/Factorial(2*n-1)): n in [1..25]]; // G. C. Greubel, Jun 19 2021
    
  • Maple
    a := n ->(2*n-1)!*2^(add(i,i=convert(n-1,base,2))-2*n+2); # Peter Luschny, May 02 2009
  • Mathematica
    a[n_] := Denominator[4^(n-1)/(2n-1)!];
    Array[a, 15] (* Jean-François Alcover, Jun 20 2018 *)
  • Sage
    [denominator(4^(n-1)/factorial(2*n-1)) for n in (1..25)] # G. C. Greubel, Jun 19 2021

Formula

a(n) = denominator( Product_{k=1..n-1} 2/(k*(2*k+1)) ).
G.f.: (1/2)*z^(1/2)*sinh(2*z^(1/2)).
From Johannes W. Meijer, May 24 2009: (Start)
a(n) = abs(A117972(n))/A000265(n).
a(n) = A036279(n)*A089170(n-1). (End)
a(n) = A049606(2*n-1). - Zhujun Zhang, May 29 2019

A160474 The Zeta triangle.

Original entry on oeis.org

-1, 51, -10, -10594, 2961, -210, 356487, -115940, 12642, -420, -101141295, 35804857, -4751890, 254562, -4620, 48350824787, -18071509911, 2689347661, -180909586, 5471466, -60060
Offset: 2

Views

Author

Johannes W. Meijer, May 24 2009

Keywords

Comments

The coefficients of the ZS1 matrix are defined by ZS1[2*m-1,n] = (2^(2*m-1))*int(y^(2*m-1)/(sinh(y))^(2*n), y=0..infinity)/factorial(2*m-1) for m = 1, 2, 3, .. and n = 1, 2, 3, .. under the condition that n <= (m-1).
This definition leads to ZS1[2*m-1,n=1] = 2*zeta(2*m-1), for m = 2, 3, .. , and the recurrence relation ZS1[2*m-1,n]:=(1/(2*n-1))*((2/(n-1))*ZS1[2*m-3,n-1]-(2*n-2)*ZS1[2*m-1,n-1]). As usual zeta(m) is the Riemann zeta function. These two formulas enable us to determine the values of the ZS[2*m-1,n] coefficients, with m all integers and n all positive integers, but not for all. If we choose, somewhat but not entirely arbitrarily, ZS1[1,n=1] = 2*gamma, with gamma the Euler-Mascheroni constant, we can determine them all.
The coefficients in the columns of the ZS1 matrix, for m = 1, 2, 3, .., and n = 2, 3, 4 .. , can be generated with the GH(z;n) polynomials for which we found the following general expression GH(z;n) = (h(n)*CFN1(z;n)*GH(z;n=1) + ZETA(z;n))/p(n).
The CFN1(z;n) polynomials depend on the central factorial numbers A008955.
The ZETA(z;n) are the Zeta polynomials which lead to the Zeta triangle.
The zero patterns of the Zeta polynomials resemble a UFO. These patterns resemble those of the Eta, Beta and Lambda polynomials, see A160464, A160480 and A160487.
The first Maple algorithm generates the coefficients of the Zeta triangle. The second Maple algorithm generates the ZS1[2*m-1,n] coefficients for m= 0, -1, -2, .. .
The M(n) sequence, see the second Maple algorithm, leads to Gould's sequence A001316 and a sequence that resembles the denominators in Taylor series for tan(x), i.e., A156769(n).
Some of our results are conjectures based on numerical evidence.

Examples

			The first few rows of the triangle ZETA(n,m) with n=2,3,... and m=1,2,... are
  [ -1],
  [51, -10],
  [ -10594, 2961, -210],
  [356487, -115940, 12642, -420].
The first few ZETA(z;n) polynomials are
  ZETA(z;n=2) = -1,
  ZETA(z;n=3) = 51-10*z^2,
  ZETA(z;n=4) = -10594 + 2961*z^2 - 210*z^4.
The first few CFN1(z;n) polynomials are
  CFN1(z;n=2) = (z^2-1),
  CFN1(z;n=3) = (z^4 - 5*z^2 + 4),
  CFN1(z;n=4) = (z^6 - 14*z^4 + 49*z^2 - 36).
The first few generating functions GH(z;n) are
  GH(z;n=2) = (6*(z^2-1)*GH(z;n=1) + (-1)) / 9,
  GH(z;n=3) = (60*(z^4-5*z^2+4)*GH(z;n=1) + (51-10*z^2)) / 450,
  GH(z;n=4) = (1260*(z^6-14*z^4+49*z^2-36)*GH(z;n=1) + (-10594+2961*z^2-210*z^4))/99225.
		

Crossrefs

A160475 equals the first left hand column.
A160476 equals the first right hand column and 6*h(n).
A160477 equals the rows sums.
A160478 equals the p(n) sequence.
A160479 equals the ZL(n) sequence.
A001620 is the Euler-Mascheroni constant gamma.
The M(n-1) sequence equals A001316(n-1)/A156769(n) (n>=1).
The ZS1[ -1, n] and the Omega(n) coefficients lead to A002195 and A002196.
The CFN1(z, n) and the cfn1(n, k) lead to A008955.
Cf. The Eta, Beta and Lambda triangles A160464, A160480 and A160487.
Cf. A162446 (ZG1 matrix)

Programs

  • Maple
    nmax:=7; with(combinat): cfn1 := proc(n, k): sum((-1)^j*stirling1(n+1, n+1-k+j) * stirling1(n+1, n+1-k-j), j = -k..k) end proc: Omega(0):=1: for n from 1 to nmax do Omega(n) := (sum((-1)^(k1+n+1)*(bernoulli(2*k1)/(2*k1))*cfn1(n-1, n-k1), k1=1..n))/(2*n-1)! end do: for n from 1 to nmax do Zc(n) := (Omega(n)*2^(2*n-1))*2/((2*n+1)*(n)) end do: c(1) := denom(Zc(1)): for n from 2 to nmax do c(n) := lcm(c(n-1)*(n)*(2*n+1)/2, denom(Zc(n))); p(n) := c(n-1) end do: y(1):=Zc(1): for n from 1 to nmax-1 do y(n+1) := Zc(n+1) - ((2*n+2)/(2*n+3))*y(n) end do: for n from 1 to nmax do b(n) := 4^(-n)*(2*n+1)*n*denom(Omega(n)) end do: for n from 1 to nmax-1 do c(n+1) := lcm(c(n)*(n+1)*(2*n+3)/2, b(n+1)) end do: for n from 1 to nmax do cm(n) := c(n)*(1/6)* 4^n/(2*n+1)! end do: for n from 1 to nmax-1 do ZL(n+2) := cm(n+1)/cm(n) end do: mmax := nmax: for n from 2 to nmax do ZETA(n, 1) := p(n)*y(n-1): ZETA(n, n) := 0 end do: for m from 2 to mmax do for n from m+1 to nmax do ZETA(n, m) := ZL(n)*(ZETA(n-1, m-1) - (n-1)^2* ZETA(n-1, m)) end do end do; seq(seq(ZETA(n,m), m=1..n-1), n=2..nmax);
    # End first program (program edited, Johannes W. Meijer, Sep 20 2012)
    nmax1 := 10; m := 1; ZS1row := 1-2*m; with(combinat): t1 := proc(n, k): sum((-1)^j * stirling1(n+1, n+1-k+j) * stirling1(n+1, n+1-k-j), j = -k..k) end proc: mmax1 := nmax1: for m1 from 1 to mmax1 do M(m1-1) := 2^(2*m1-2)/((2*m1-1)!) end do: for m1 from 1 to mmax1 do ZS1[ -2*m1+1, 1] := 2*(-bernoulli(2*m1)/(2*m1)) od: for n from 2 to nmax1 do for m1 from 1 to mmax1-n+1 do ZS1[-2*m1+1, n] := M(n-1)*sum((-1)^(k1+1)*t1(n-1, k1-1) * ZS1[2*k1-2*n-2*m1+1, 1], k1 = 1..n) od: od: seq(ZS1[1-2*m, n], n = 1..nmax1-m+1);
    # End second program (program edited, Johannes W. Meijer, Sep 20 2012)

Formula

We discovered a remarkable relation between the Zeta triangle coefficients ZETA(n,m) = ZL(n)*(ZETA(n-1,m-1)-(n-1)^2*ZETA(n-1,m)) for n = 3, 4, ... and m = 2, 3, .... See A160475 for ZETA(n,m=1) and furthermore ZETA(n,n) = 0 for n = 2, 3, ....
We observe that the ZL(n) = A160479(n) sequence also rules the Lambda triangle A160487.
The generating functions GH(z;n) of the coefficients in the matrix columns are defined by
GH(z;n) = sum(ZS1[2*m-1,n]*z^(2*m-2), m=1..infinity), with n = 1, 2, 3, .... This definition, and our choice of ZS1[1,1] = 2*gamma, leads to GH(z;n=1) = (-Psi(1-z)-Psi(1+z)) with Psi(z) the digamma-function. Furthermore we discovered that GH(z;n) = GH(z;n-1)*(2*z^2/((2*n-1)*(n-1))-(2*n-2)/(2*n-1))+2*ZS1[ -1,n-1]/((2*n-1)*(n-1)) for n = 2, 3 , ..., with ZS1[ -1,n] = 2^(2*n-1)*A002195(n)/A002196(n) for n = 1, 2, ....
We found the following general expression for the GH(z;n) polynomials, for n = 2, 3, ...:
GH(z;n) = (h(n)*CFN1(z;n)*GH(z;n=1) + ZETA(z;n))/p(n) with
h(n) = 6*A160476(n) and p(n) = A160478(n).

A371176 Numbers k such that A000120(k) <= A001511(k).

Original entry on oeis.org

1, 2, 4, 6, 8, 10, 12, 16, 18, 20, 24, 28, 32, 34, 36, 40, 44, 48, 52, 56, 64, 66, 68, 72, 76, 80, 84, 88, 96, 100, 104, 112, 120, 128, 130, 132, 136, 140, 144, 148, 152, 160, 164, 168, 176, 184, 192, 196, 200, 208, 216, 224, 232, 240, 256, 258, 260, 264, 268
Offset: 1

Views

Author

Mikhail Kurkov, Mar 14 2024

Keywords

Comments

It appears that this sequence is obtained when ordering Schreier sets as explained in the Bird link. See decM(n) PARI code. - Michel Marcus, May 31 2024
That is correct since the binary representation of these numbers can be put into 1-to-1 correspondence with Schreier sets, which satisfy |X| <= min X, using the indicator function of X as the bits (starting from the right, LSB). The reason is that A000120 then computes |X| and A001511 computes min X. For example, the Schreier set X = {2, 5} can be mapped to 10010_2 = 18. - Michael S. Branicky, May 31 2024
From David A. Corneth, May 31 2024: (Start)
If k is in the sequence then so is 2*k.
a(A000045(k)) = 2^(k-2) for k >= 2. (End)
Apart from a(1), all terms are even. - Paolo Xausa, May 31 2024
Zeckendorf representation of n with rewrite 0 -> 0, {0, 1} -> 1 and k-1 zeros appended to the right side (where k is the number of ones in the given representation) and then interpreted as binary expansion is the same as a(n) (see the first formula). - Mikhail Kurkov, Oct 21 2024

Crossrefs

Programs

  • Maple
    filter:= proc(n) convert(convert(n,base,2),`+`) <= 1+padic:-ordp(n,2) end proc:
    select(filter, [1,seq(i,i=2..1000,2)]); # Robert Israel, Oct 20 2024
  • Mathematica
    Join[{1}, Select[Range[2, 1000, 2], DigitSum[#, 2] <= IntegerExponent[#, 2] + 1 &]] (* Paolo Xausa, Aug 12 2025 *)
  • PARI
    isok(n) = hammingweight(n) <= (valuation(n, 2) + 1)
    
  • PARI
    M(n) = my(list=List()); for (i=1, n, forsubset(i, s, my(bOk = if (#s && (vecmax(s) == n), #s <= vecmin(s), 0)); if (bOk, listput(list, vecsort(Vec(s),,4))););); Vec(list);
    decM(nn) = my(v = vector(nn, k, M(k)), list=List()); for (i=1, #v, my(vi = v[i]); for (j=1, #vi, my(s = vecsort(vi[j]), slist=List(), m = vecmax(s)); forstep(k=m, 1, -1, listput(slist, sign(vecsearch(s, k)))); listput(list, fromdigits(Vec(slist), 2)););); vecsort(Vec(list)); \\ Michel Marcus, May 31 2024
    
  • Python
    def ok(n): return n.bit_count() <= (-n&n).bit_length()
    print([k for k in range(1, 300) if ok(k)]) # Michael S. Branicky, May 31 2024
    
  • Python
    # Assuming the list starts with 0.
    def a():
        n = na = nb = 1
        while True:
            yield not(nb < (na - 1) << 1)
            nb, na = na, n.bit_count()
            n += 1
    aList = a(); print([n for n in range(77) if next(aList)]) # Peter Luschny, Jun 07 2024

Formula

a(n) = b(n)*A001316(b(n))/2 where b(n) = A048679(n).
a(n) = Sum_{i=0..n-1} 2^A213911(i).
a(n) = 2^(A072649(n) - 1) + [c(n) > 0]*2*a(c(n)) where c(n) = A066628(n).
a(n) = 2*a(A005206(n)) - A003849(n)*2^A007895(n-1) for n > 1 with a(1) = 1.
Conjecture: lim sup_{n -> oo} log(a(n))/log(n) = log(2) / log((1 + sqrt(5))/2) = 1.440420090412556479... = A104287. - Vaclav Kotesovec, Aug 12 2025

A151566 Leftist toothpicks (see Comments for definition).

Original entry on oeis.org

0, 1, 2, 4, 6, 8, 10, 14, 18, 20, 22, 26, 30, 34, 38, 46, 54, 56, 58, 62, 66, 70, 74, 82, 90, 94, 98, 106, 114, 122, 130, 146, 162, 164, 166, 170, 174, 178, 182, 190, 198, 202, 206, 214, 222, 230, 238, 254, 270, 274, 278, 286, 294, 302, 310, 326, 342, 350, 358, 374, 390, 406
Offset: 0

Views

Author

N. J. A. Sloane, May 23 2009

Keywords

Comments

Similar to A139250, except that when we add toothpicks to horizontal toothpicks, we only add them at the left-hand end.
Sequence gives total number of toothpicks in the n-th generation. First differences are in A060632.
This is equivalent to the Sierpinski triangle A047999. Each inverted T formed by two toothpicks is equivalent to a triangle in the Sierpinski sieve. See Gould's sequence A001316. [From Omar E. Pol, May 23 2009]

Crossrefs

Formula

a(2n) = 2*A006046(n), a(2n+1) = a(2n) + A001316(n) = 2*A006046(n) + A001316(n).
G.f.: (x*(1+x)/(1-x)) * Product_{k>0} (1 + 2 * x^(2^k)). - Seiichi Manyama, Oct 12 2019

A050922 Triangle in which n-th row gives prime factors of n-th Fermat number 2^(2^n)+1.

Original entry on oeis.org

3, 5, 17, 257, 65537, 641, 6700417, 274177, 67280421310721, 59649589127497217, 5704689200685129054721, 1238926361552897, 93461639715357977769163558199606896584051237541638188580280321
Offset: 0

Views

Author

N. J. A. Sloane, Dec 30 1999

Keywords

Comments

Alternatively, list of prime factors of terms of A001317 in order of their first appearance. - Labos Elemer, Jan 21 2002
From T. D. Noe, Jan 29 2009: (Start)
That these two definitions give the same sequence follows from the fact (stated as a formula in A001317) that A001317(n) is the product of Fermat numbers F(i) according to which bits of n are set.
For instance, for n=41, the binary representation of n is 101001, which has bits 0, 3 and 5 set. A001317(n) = 3311419785987 = 3*257*4294967297 = F(0)*F(3)*F(5).
This factorization also explains why the "first 31 numbers give odd-sided constructible polygons". I think Hewgill first noticed this factorization. (End)

Examples

			Triangle begins:
  3;
  5;
  17;
  257;
  65537;
  641,               6700417;
  274177,            67280421310721;
  59649589127497217, 5704689200685129054721;
  1238926361552897,  93461639715357977769163558199606896584051237541638188580280321;
  ...
A001317(127) = 3*5*17*257*65537.641*6700417*274177*6728042130721, A001317(128) = 59649589127497217*5704689200685129054721. See also A050922. Compare with A053576, where 2 and A000215 appear as prime factors. - _Labos Elemer_, Jan 21 2002
		

References

  • M. Aigner and G. M. Ziegler, Proofs from The Book, Springer-Verlag, Berlin, 2nd. ed., 2001; see p. 3.

Crossrefs

Programs

  • Mathematica
    Flatten[Transpose[FactorInteger[#]][[1]]&/@Table[2^(2^n)+1,{n,0,8}]] (* Harvey P. Dale, May 18 2012 *)
  • PARI
    for(n=0, 1e3, f=factor(2^(2^n)+1)[, 1]; for(i=1, #f, print1(f[i], ", "))) \\ Felix Fröhlich, Aug 16 2014

Extensions

More terms from Larry Reeves (larryr(AT)acm.org), Apr 13 2000.
Edited by N. J. A. Sloane, Jan 31 2009 at the suggestion of T. D. Noe
Link to Munafo webpage fixed by Robert Munafo, Dec 09 2009

A080098 Triangle T(n,k) = n OR k, 0 <= k <= n, bitwise logical OR, read by rows.

Original entry on oeis.org

0, 1, 1, 2, 3, 2, 3, 3, 3, 3, 4, 5, 6, 7, 4, 5, 5, 7, 7, 5, 5, 6, 7, 6, 7, 6, 7, 6, 7, 7, 7, 7, 7, 7, 7, 7, 8, 9, 10, 11, 12, 13, 14, 15, 8, 9, 9, 11, 11, 13, 13, 15, 15, 9, 9, 10, 11, 10, 11, 14, 15, 14, 15, 10, 11, 10, 11, 11, 11, 11, 15, 15, 15, 15, 11, 11, 11, 11, 12, 13, 14, 15, 12, 13, 14, 15, 12, 13, 14, 15, 12
Offset: 0

Views

Author

Reinhard Zumkeller, Jan 28 2003

Keywords

Examples

			Triangle begins:
   0,
   1,  1,
   2,  3,  2,
   3,  3,  3,  3,
   4,  5,  6,  7,  4,
   5,  5,  7,  7,  5,  5,
   6,  7,  6,  7,  6,  7,  6,
   7,  7,  7,  7,  7,  7,  7,  7,
   8,  9, 10, 11, 12, 13, 14, 15,  8,
   9,  9, 11, 11, 13, 13, 15, 15,  9,  9,
  10, 11, 10, 11, 14, 15, 14, 15, 10, 11, 10,
  ...
		

Crossrefs

Cf. A001316 (number of integers k such that T(n, k) = n in n-th row).
Cf. A350093 (row sums), A003986 (array).
Other triangles: A080099 (AND), A051933 (XOR), A265705 (IMPL), A102037 (CNIMPL).

Programs

  • Haskell
    import Data.Bits ((.|.))
    a080098 n k = n .|. k :: Int
    a080098_row n = map (a080098 n) [0..n]
    a080098_tabl = map a080098_row [0..]
    -- Reinhard Zumkeller, Aug 03 2014, Jul 05 2012
    
  • Mathematica
    T[n_, k_] := n ~BitOr~ k;
    Table[T[n, k], {n, 0, 12}, {k, 0, n}] // Flatten (* Jean-François Alcover, Dec 01 2021 *)
  • Python
    def T(n, k): return n | k
    print([T(n, k) for n in range(13) for k in range(n+1)]) # Michael S. Branicky, Dec 01 2021

A246674 Run Length Transform of A000225.

Original entry on oeis.org

1, 1, 1, 3, 1, 1, 3, 7, 1, 1, 1, 3, 3, 3, 7, 15, 1, 1, 1, 3, 1, 1, 3, 7, 3, 3, 3, 9, 7, 7, 15, 31, 1, 1, 1, 3, 1, 1, 3, 7, 1, 1, 1, 3, 3, 3, 7, 15, 3, 3, 3, 9, 3, 3, 9, 21, 7, 7, 7, 21, 15, 15, 31, 63, 1, 1, 1, 3, 1, 1, 3, 7, 1, 1, 1, 3, 3, 3, 7, 15, 1, 1, 1, 3, 1, 1, 3, 7, 3, 3, 3, 9, 7, 7, 15, 31, 3, 3, 3, 9, 3, 3, 9, 21, 3, 3, 3, 9, 9, 9, 21, 45, 7, 7, 7, 21, 7, 7, 21, 49, 15, 15, 15, 45, 31, 31, 63, 127, 1
Offset: 0

Views

Author

Antti Karttunen, Sep 08 2014

Keywords

Comments

a(n) can be also computed by replacing all consecutive runs of zeros in the binary expansion of n with * (multiplication sign), and then performing that multiplication, still in binary, after which the result is converted into decimal. See the example below.

Examples

			115 is '1110011' in binary. The run lengths of 1-runs are 2 and 3, thus a(115) = A000225(2) * A000225(3) = ((2^2)-1) * ((2^3)-1) = 3*7 = 21.
The same result can be also obtained more directly, by realizing that '111' and '11' are the binary representations of 7 and 3, and 7*3 = 21.
From _Omar E. Pol_, Feb 15 2015: (Start)
Written as an irregular triangle in which row lengths are the terms of A011782:
1;
1;
1,3;
1,1,3,7;
1,1,1,3,3,3,7,15;
1,1,1,3,1,1,3,7,3,3,3,9,7,7,15,31;
1,1,1,3,1,1,3,7,1,1,1,3,3,3,7,15,3,3,3,9,3,3,9,21,7,7,7,21,15,15,31,63;
...
Right border gives 1 together with the positive terms of A000225.
(End)
		

Crossrefs

Cf. A003714 (gives the positions of ones).
A001316 is obtained when the same transformation is applied to A000079, the powers of two.
Run Length Transforms of other sequences: A071053, A227349, A246588, A246595, A246596, A246660, A246661, A246685, A247282.

Programs

  • Mathematica
    f[n_] := 2^n - 1; Table[Times @@ (f[Length[#]]&) /@ Select[ Split[ IntegerDigits[n, 2]], #[[1]] == 1&], {n, 0, 100}] (* Jean-François Alcover, Jul 11 2017 *)
  • Python
    # uses RLT function in A278159
    def A246674(n): return RLT(n,lambda m: 2**m-1) # Chai Wah Wu, Feb 04 2022

Formula

For all n >= 0, a(A051179(n)) = A247282(A051179(n)) = A051179(n).

A082907 A modified Pascal's triangle, read by rows, and modified as follows: binomial(n,j) is replaced by gcd(2^n, binomial(n,j)), i.e., the largest power of 2 dividing binomial(n,j).

Original entry on oeis.org

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

Views

Author

Labos Elemer, Apr 23 2003

Keywords

Comments

If N is a power of 2, then the first N rows are invariant under all 6 symmetries of an equilateral triangle. - Paul Boddington, Dec 17 2003

Examples

			Triangle read by rows:
            1,
           1,1,
          1,2,1,
         1,1,1,1,
        1,4,2,4,1,
       1,1,2,2,1,1,
      1,2,1,4,1,2,1,
     1,1,1,1,1,1,1,1,
    1,8,4,8,2,8,4,8,1,
   1,1,4,4,2,2,4,4,1,1,
  ...
For n = -1 + 2^k, such rows consist of all 1's since all binomial coefficients C(n,j) are odd.
		

Crossrefs

Programs

  • Mathematica
    Flatten[Table[Table[GCD[2^n, Binomial[n, j]], {j, 0, n}], {n, 0, 25}], 1]
    f[n_] := Denominator[CatalanNumber[n - 1]/2^(n - 1)]; T[n_, k_] := f[n]/(f[k]*f[n - k]); Table[T[n, k], {n, 0, 7}, {k, 0, n}]//Flatten (* G. C. Greubel, Dec 24 2016 *)

Formula

From Paul Boddington, Dec 17 2003: (Start)
T(n, j) = c(n)/(c(j)*c(n-j)) where c(n)=A060818(n).
T(n, j) = (b(j)*b(n-j))/b(n) where b(n)=A001316(n) (Gould's sequence). (End)

Extensions

Edited by Jon E. Schoenfield, Dec 24 2016

A120738 a(n) = 4*n - A000120(n).

Original entry on oeis.org

0, 3, 7, 10, 15, 18, 22, 25, 31, 34, 38, 41, 46, 49, 53, 56, 63, 66, 70, 73, 78, 81, 85, 88, 94, 97, 101, 104, 109, 112, 116, 119, 127, 130, 134, 137, 142, 145, 149, 152, 158, 161, 165, 168, 173, 176, 180, 183, 190, 193, 197, 200, 205, 208, 212, 215, 221, 224, 228
Offset: 0

Views

Author

Paul Barry, Jun 29 2006

Keywords

Comments

Partial sums of A090739.
a(n) is also the increasing sequence of exponents of x in Product_{k > 1} (1 + x^(2^k - 1)). - Paul Pearson (ppearson(AT)rochester.edu), Aug 06 2008
Related to partial sums of the Ruler sequence A001511 by a(n) = A005187(2n), therefore {a(n)+1} are the indices of 1's in A252488. - M. F. Hasler, Jan 22 2015

Crossrefs

Programs

  • Magma
    A120738:= func< n | 4*n-(&+Intseq(n, 2)) >;
    [A120738(n): n in [0..100]]; // G. C. Greubel, Oct 20 2024
  • Maple
    a:=n->simplify(log[2](16^n/(add(modp(binomial(n,k),2),k=0..n))));
    a:=n->simplify(log[2](16^n/(2^(n-(padic[ordp](n!,2)))))); # Note: n-(padic[ordp](n!,2)) is the number of 1's in the binary expansion of n. - Paul Pearson (ppearson(AT)rochester.edu), Aug 06 2008
  • Mathematica
    Table[4 n - DigitCount[n, 2, 1], {n, 0, 58}] (* Michael De Vlieger, Nov 06 2016 *)
  • PARI
    {a(n) = if( n < 0, 0, 4*n - subst( Pol( binary( n ) ), x, 1) ) } /* Michael Somos, Aug 28 2007 */
    
  • PARI
    a(n) = 4*n - hammingweight(n); \\ Michel Marcus, Nov 06 2016
    
  • Python
    # Python 3.10
    def A120738(n): return (n<<2)-n.bit_count() # Chai Wah Wu, Jul 12 2022
    
  • Sage
    A120738 = lambda n: 4*n - sum(n.digits(2))
    print([A120738(n) for n in (0..58)]) # Peter Luschny, Nov 06 2016
    

Formula

a(n) = log_2(16^n/A001316(n)). [This was the original definition.]
a(n) = 2n + A005187(n).
a(n) = 3n + A011371(n).
a(n) = 4n - log_2(A001316(n)).
a(n) = log_2(A061549(n)).
2^a(n) = 16^n/A001316(n) = A061549(n).
a(n) = A086343(n) + A001511(n) for n>0. - Alford Arnold, Mar 23 2009
2^a(n) = abs(A067624(n)/A117972(n)). - Johannes W. Meijer, Jul 06 2009
a(n) = Sum_{k>=0} (A030308(n,k)*A000225(k+2)). - Philippe Deléham, Oct 16 2011
a(n) = A005187(2n). - M. F. Hasler, Jan 22 2015

Extensions

Definition simplified by M. F. Hasler, Dec 29 2012
Previous Showing 71-80 of 226 results. Next