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 91-100 of 227 results. Next

A382725 Number of entries in the n-th row of Pascal's triangle not divisible by 8.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 5, 10, 9, 12, 11, 14, 14, 16, 5, 10, 13, 20, 13, 18, 20, 24, 11, 22, 20, 28, 22, 28, 28, 32, 5, 10, 13, 20, 17, 26, 28, 40, 13, 26, 26, 36, 28, 40, 40, 48, 11, 22, 28, 44, 28, 40, 44, 56, 22, 44, 40, 56, 44, 56, 56, 64, 5, 10, 13, 20, 17, 26, 28, 40, 17, 34, 34, 52, 36, 56, 56, 80, 13
Offset: 0

Views

Author

N. J. A. Sloane, Apr 23 2025

Keywords

Crossrefs

Programs

  • Python
    def A382725(n):
        n1 = n>>1
        n2 = n1>>1
        np = ~n
        n100 = (n2&(~n1)&np).bit_count()
        n110 = (n2&n1&np).bit_count()
        n10 = (n1&np).bit_count()
        return ((n100+1<<3)+(n110<<1)+n10*(n10+3))<>3 # Chai Wah Wu, Aug 10 2025

A382731 Total number of entries in rows 0,1,...,n of Pascal's triangle not divisible by 8.

Original entry on oeis.org

1, 3, 6, 10, 15, 21, 28, 36, 41, 51, 60, 72, 83, 97, 111, 127, 132, 142, 155, 175, 188, 206, 226, 250, 261, 283, 303, 331, 353, 381, 409, 441, 446, 456, 469, 489, 506, 532, 560, 600, 613, 639, 665, 701, 729, 769, 809, 857, 868, 890, 918, 962, 990, 1030, 1074, 1130, 1152, 1196, 1236, 1292, 1336, 1392, 1448, 1512, 1517, 1527
Offset: 0

Views

Author

N. J. A. Sloane, Apr 23 2025

Keywords

Crossrefs

Programs

  • Python
    def A382731(n):
        c = 0
        for m in range(n+1):
            n1 = m>>1
            n2 = n1>>1
            np = ~m
            n100 = (n2&(~n1)&np).bit_count()
            n110 = (n2&n1&np).bit_count()
            n10 = (n1&np).bit_count()
            c += ((n100+1<<3)+(n110<<1)+n10*(n10+3))<>3
        return c # Chai Wah Wu, Aug 10 2025

A014421 Odd elements in Pascal's triangle.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 3, 3, 1, 1, 1, 1, 5, 5, 1, 1, 15, 15, 1, 1, 7, 21, 35, 35, 21, 7, 1, 1, 1, 1, 9, 9, 1, 1, 45, 45, 1, 1, 11, 55, 165, 165, 55, 11, 1, 1, 495, 495, 1, 1, 13, 715, 1287, 1287, 715, 13, 1, 1, 91, 1001, 3003, 3003, 1001, 91, 1, 1, 15, 105, 455, 1365, 3003, 5005
Offset: 0

Views

Author

Keywords

Comments

The number of terms of the n-row is A001316(n). - Michel Marcus, Jan 11 2016

Examples

			Triangle starts:
1;
1, 1;
1, 1;
1, 3, 3, 1;
1, 1;
1, 5, 5, 1;
1, 15, 15, 1;
1, 7, 21, 35, 35, 21, 7, 1;
...
		

Crossrefs

Cf. A143333. [From Reinhard Zumkeller, Oct 24 2010]

Programs

  • Maple
    select(type, [seq(seq(binomial(n,k),k=0..n),n=0..20)],odd); # Robert Israel, Jan 11 2016
  • Mathematica
    Select[ Flatten[ Table[ Binomial[ n, i ], {n, 0, 20}, {i, 0, n} ] ], OddQ ]
  • PARI
    tabf(nn) = {for (n=0, nn, for (k=0, n, b = binomial(n, k); if (b % 2, print1(b, ", "))); print(););} \\ Michel Marcus, Jan 11 2016

Extensions

More terms from Erich Friedman
Keyword tabl replaced by tabf by Reinhard Zumkeller, Oct 21 2010
Offset changed to 0 by Michel Marcus, Jan 11 2016

A065040 Triangle read by rows: T(m,k) = exponent of the highest power of 2 dividing the binomial coefficient binomial(m,k).

Original entry on oeis.org

0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 2, 1, 2, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 2, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 2, 3, 1, 3, 2, 3, 0, 0, 0, 2, 2, 1, 1, 2, 2, 0, 0, 0, 1, 0, 3, 1, 2, 1, 3, 0, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 2, 1, 2, 0, 3, 2, 3, 0, 2, 1, 2, 0, 0, 0, 1, 1, 0, 0, 2, 2, 0, 0, 1, 1, 0, 0
Offset: 0

Views

Author

Claude Lenormand (hlne.lenormand(AT)voono.net), Nov 05 2001

Keywords

Comments

T(m,k) is the number of 'carries' that occur when adding k and m-k in base 2 using the traditional addition algorithm. - Tom Edgar, Jun 10 2014

Examples

			Triangle begins:
[0]
[0, 0]
[0, 1, 0]
[0, 0, 0, 0]
[0, 2, 1, 2, 0]
[0, 0, 1, 1, 0, 0]
[0, 1, 0, 2, 0, 1, 0]
[0, 0, 0, 0, 0, 0, 0, 0]
[0, 3, 2, 3, 1, 3, 2, 3, 0]
[0, 0, 2, 2, 1, 1, 2, 2, 0, 0]
[0, 1, 0, 3, 1, 2, 1, 3, 0, 1, 0]
... - _N. J. A. Sloane_, Aug 21 2021
		

Crossrefs

Programs

  • Maple
    A065040 := (n, k) -> padic[ordp](binomial(n, k), 2):
    seq(seq(A065040(n,k), k=0..n), n=0..13); # Peter Luschny, Aug 15 2017
  • Mathematica
    T[m_, k_] := IntegerExponent[Binomial[m, k], 2]; Table[T[m, k], {m, 0, 13}, {k, 0, m}] // Flatten (* Jean-François Alcover, Oct 06 2016 *)
  • PARI
    T(m,k)=hammingweight(k)+hammingweight(m-k)-hammingweight(m)
    for(m=0,9,for(k=0,m,print1(T(m,k)", "))) \\ Charles R Greathouse IV, Mar 26 2013

Formula

As an array f(i,j) = f(j,i) = T(i+j,j) read by antidiagonals: f(0,j) = 0, f(1,j) = A007814(j+1), f(i,j) = Sum_{k=0..i-1} (f(1,j+k) - f(1,k)). [corrected by Kevin Ryde, Oct 07 2021]
The n-th term a(n) is equal to the binomial coefficient binomial(m,k), where m = floor((1+sqrt(8*n+1))/2) - 1 and k = n - m(m+1)/2. Also a(n) = g(m) - g(k) - g(m-k), where g(x) = Sum_{i=1..floor(log_2(x))} floor(x/2^i), m = floor((1+sqrt(8*n+1))/2) - 1, k = n - m(m+1)/2. - Hieronymus Fischer, May 05 2007
T(m,k) <= log_2 m, for m > 0. - Charles R Greathouse IV, Mar 26 2013
T(m,k) = log_2(A082907(m,k)). - Tom Edgar, Jun 10 2014
From Antti Karttunen, Oct 28 2014: (Start)
a(n) = A007814(A007318(n)).
a(n) * A047999(n) = 0 and a(n) + A047999(n) > 0 for all n.
(End)

Extensions

Name clarified by Antti Karttunen, Oct 28 2014

A089898 Product of (digits of n each incremented by 1).

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 3, 6, 9, 12, 15, 18, 21, 24, 27, 30, 4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 6, 12, 18, 24, 30, 36, 42, 48, 54, 60, 7, 14, 21, 28, 35, 42, 49, 56, 63, 70, 8, 16, 24, 32, 40, 48, 56, 64
Offset: 0

Views

Author

Marc LeBrun, Nov 13 2003

Keywords

Comments

Sum of products of all subsets of digits of n (with the empty subset contributing 1).
Number of nonnegative values k such that the lunar sum of k and n is n.
First 100 values are 10 X 10 multiplication table, read by rows/columns.

Examples

			a(12)=6 since (1+1)*(2+1)=2*3=6 and since (1*2)+(1)+(2)+(1)=2+1+2+1=6 and since the lunar sum of 12 with any of the six values {0,1,2,10,11,12} is 12.
		

Crossrefs

Programs

  • Haskell
    a089898 n = if n < 10 then n + 1 else (d + 1) * a089898 n'
                where (n', d) = divMod n 10
    -- Reinhard Zumkeller, Jul 06 2014
  • Maple
    seq(convert(map(`+`,convert(n,base,10),1),`*`), n = 0 .. 1000); # Robert Israel, Nov 17 2014
  • Mathematica
    a089898[n_Integer] :=
    Prepend[Array[Times @@ (IntegerDigits[#] + 1) &, n], 1]; a089898[77] (* Michael De Vlieger, Dec 22 2014 *)
  • PARI
    a(n) = my(d=digits(n)); prod(i=1, #d, d[i]+1); \\ Michel Marcus, Apr 06 2014
    
  • PARI
    a(n) = vecprod(apply(x->x+1, digits(n))); \\ Michel Marcus, Feb 01 2023
    

Formula

a(n) = a(floor(n/10))*(1+(n mod 10)). - Robert Israel, Nov 17 2014
G.f. g(x) satisfies g(x) = (10*x^11 - 11*x^10 + 1)*g(x^10)/(x-1)^2. - Robert Israel, Nov 17 2014

A100307 Modulo 2 binomial transform of 3^n.

Original entry on oeis.org

1, 4, 10, 40, 82, 328, 820, 3280, 6562, 26248, 65620, 262480, 538084, 2152336, 5380840, 21523360, 43046722, 172186888, 430467220, 1721868880, 3529831204, 14119324816, 35298312040, 141193248160, 282472589764, 1129890359056
Offset: 0

Views

Author

Paul Barry, Dec 06 2004

Keywords

Comments

3^n may be retrieved through 3^n = Sum_{k=0..n} (-1)^A010060(n-k)*(binomial(n,k) mod 2)*a(k).

Crossrefs

Programs

  • Magma
    [(&+[3^k*(Binomial(n, k) mod 2): k in [0..n]]): n in [0..40]]; // G. C. Greubel, Feb 03 2023
    
  • Mathematica
    Table[Sum[Mod[Binomial[n,k],2]3^k,{k,0,n}],{n,0,40}] (* Harvey P. Dale, Aug 28 2013 *)
  • PARI
    a(n) = subst(lift((Mod(1,2)+'x)^n), 'x, 3); \\ Gheorghe Coserea, Jun 11 2016
    
  • Python
    def A100307(n): return sum((bool(~n&n-k)^1)*3**k for k in range(n+1)) # Chai Wah Wu, May 02 2023
  • Sage
    [sum((binomial(n,k)%2)*3^k for k in [0..n]) for n in [0..50]] # Tom Edgar, Oct 11 2015
    

Formula

a(n) = Sum_{k=0..n} (binomial(n, k) mod 2)*3^k.
From Vladimir Shevelev, Dec 26-27 2013: (Start)
Sum_{n>=0} 1/a(n)^r = Product_{k>=0} (1 + 1/(3^(2^k)+1)^r),
Sum_{n>=0} (-1)^A000120(n)/a(n)^r = Product_{k>=0} (1 - 1/(3^(2^k)+1)^r), where r > 0 is a real number.
In particular,
Sum_{n>=0} 1/a(n) = Product_{k>=0} (1 + 1/(3^(2^k)+1)) = 1.391980...;
Sum_{n>=0} (-1)^A000120(n)/a(n) = 2/3.
a(2^n) = 3^(2^n)+1, n >= 0.
Note that analogs of Stephan's limit formulas (see Shevelev link) reduce to the relations:
a(2^t*n+2^(t-1)) = 8*(3^(2^(t-1)+1))/(3^(2^(t-1))-1) * a(2^t*n+2^(t-1)-2), t >= 2.
In particular, for t=2,3,4, we have the following formulas:
a(4*n+2) = 10 * a(4*n),
a(8*n+4) = (41/5) * a(8*n+2),
a(16*n+8) = (3281/410) * a(16*n+6), etc. (End)
From Tom Edgar, Oct 11 2015: (Start)
a(n) = Product_{b_j != 0} a(2^j) where n = Sum_{j>=0} b_j*2^j is the binary representation of n.
a(2*k+1) = 4*a(2*k). (End)

A100308 Modulo 2 binomial transform of 5^n.

Original entry on oeis.org

1, 6, 26, 156, 626, 3756, 16276, 97656, 390626, 2343756, 10156276, 60937656, 244531876, 1467191256, 6357828776, 38146972656, 152587890626, 915527343756, 3967285156276, 23803710937656, 95520019531876, 573120117191256
Offset: 0

Views

Author

Paul Barry, Dec 06 2004

Keywords

Comments

5^n may be retrieved through 5^n = Sum_{k=0..n} (-1)^A010060(n-k) * (binomial(n,k) mod 2)*a(k).

Crossrefs

Programs

  • Magma
    [(&+[5^k*(Binomial(n, k) mod 2): k in [0..n]]): n in [0..40]]; // G. C. Greubel, Feb 03 2023
    
  • Maple
    f:= proc(n) local L,M;
       L:= convert(n,base,2);
       mul(1+5^(2^(k-1)), k = select(t -> L[t]=1, [$1..nops(L)]));
    end proc:
    map(f, [$0..30]); # Robert Israel, Aug 26 2018
  • Mathematica
    a[n_]:= Sum[Mod[Binomial[n, k], 2] 5^k, {k, 0, n}];
    Table[a[n], {n, 0, 30}] (* Jean-François Alcover, Sep 19 2018 *)
  • Python
    def A100308(n): return sum((bool(~n&n-k)^1)*5**k for k in range(n+1)) # Chai Wah Wu, May 02 2023
  • SageMath
    def A100308(n): return sum(5^k*(binomial(n, k)%2) for k in range(n+1))
    [A100308(n) for n in range(41)] # G. C. Greubel, Feb 03 2023
    

Formula

a(n) = Sum_{k=0..n} (binomial(n, k) mod 2)*5^k.
From Vladimir Shevelev, Dec 26-27 2013: (Start)
Sum_{n>=0} 1/a(n)^r = Product_{k>=0} (1 + 1/(5^(2^k)+1)^r),
Sum_{n>=0} (-1)^A000120(n)/a(n)^r = Product_{k>=0} (1 - 1/(5^(2^k)+1)^r), where r > 0 is a real number.
In particular,
Sum_{n>=0} 1/a(n) = Product_{k>=0} (1 + 1/(5^(2^k)+1)) = 1.2134769...;
Sum_{n>=0} (-1)^A000120(n)/a(n) = 0.8.
a(2^n) = 5^(2^n) + 1, n >= 0.
Note that analogs of Stephan's limit formulas (see Shevelev link) reduce to the relations:
a(2^t*n+2^(t-1)) = 24*(5^(2^(t-1)+1))/(5^(2^(t-1))-1) * a(2^t*n+2^(t-1)-2), t >= 2.
In particular, for t=2,3,4, we have the following formulas:
a(4*n+2) = 26 * a(4*n),
a(8*n+4) = (313/13) * a(8*n+2),
a(16*n+8) = (195313/8138) * a(16*n+6), etc. (End)

A134659 Total number of odd coefficients in (1+x+x^2)^k for k=0,...,n.

Original entry on oeis.org

1, 4, 7, 12, 15, 24, 29, 40, 43, 52, 61, 76, 81, 96, 107, 128, 131, 140, 149, 164, 173, 200, 215, 248, 253, 268, 283, 308, 319, 352, 373, 416, 419, 428, 437, 452, 461, 488, 503, 536, 545, 572, 599, 644, 659, 704, 737, 800, 805, 820, 835, 860, 875, 920, 945, 1000
Offset: 0

Views

Author

Steven Finch, Jan 25 2008

Keywords

Comments

a(n) = Sum_{k <= n} A071053(k)

Crossrefs

Programs

  • Mathematica
    Sum[PolynomialMod[(1+x+x^2)^k, 2] /. x->1, {k, 0, n-1}]

Extensions

Offset changed to 0 by N. J. A. Sloane, Feb 06 2015

A160468 Triangle of polynomial coefficients related to the o.g.f.s of the RES1 polynomials.

Original entry on oeis.org

1, 1, 2, 1, 17, 26, 2, 62, 192, 60, 1, 1382, 7192, 5097, 502, 2, 21844, 171511, 217186, 55196, 2036, 2, 929569, 10262046, 20376780, 9893440, 1089330, 16356, 4, 6404582, 94582204, 271154544, 215114420, 48673180, 2567568, 16376, 1
Offset: 1

Views

Author

Johannes W. Meijer, May 24 2009

Keywords

Comments

In A160464 we defined the ES1 matrix by ES1[2*m-1,n=1] and in A094665 it was shown that the n-th term of the coefficients of matrix row ES1[1-2*m,n] for m >= 1 can be generated with the RES1(1-2*m,n) polynomials.
We define the o.g.f.s. of these polynomials by GFRES1(z,1-2*m) = sum(RES1(1-2*m,n)*z^(n-1), n=1..infinity) for m >= 1. The general expression of the o.g.f.s. is GFRES1(z,1-2*m) = (-1)*RE(z,1-2*m)/(2*p(m-1)*(z-1)^(m)). The p(m-1), m >= 1, sequence is Gould's sequence A001316.
The coefficients of the RE(z,1-2*m) polynomials lead to the triangle given above.
The E(z,n) = numer(sum((-1)^(n+1)*k^n*z^(k-1), k=1..infinity)) polynomials with n >= 1, see the Maple algorithm, lead to the Eulerian numbers A008292.
Some of our results are conjectures based on numerical evidence.

Examples

			The first few rows are:
[1]
[1]
[2, 1]
[17, 26, 2]
[62, 192, 60, 1]
The first few polynomials RE(z,m) are:
RE(z,-1) = 1
RE(z,-3) = 1
RE(z,-5) = 2+z
RE(z,-7) = 17+26*z+2*z^2
The first few GFRES1(z,m) are:
GFRES1(z,-1) = -(1/1)*(1)/(2*(z-1)^1)
GFRES1(z,-3) = -(1/2)*(1)/(2*(z-1)^2)
GFRES1(z,-5) = -(1/2)*(2+z)/(2*(z-1)^3)
GFRES1(z,-7) = -(1/4)*(17+26*z+2*z^2)/(2*(z-1)^4)
		

Crossrefs

For the Eulerian numbers E(n, k) see A008292.
The p(n) sequence equals Gould's sequence A001316.
The first right hand column of the triangle equals A048896.
The first left hand column equals A160469.
The row sums equal the absolute values of A117972.

Programs

  • Maple
    nmax := 8; mmax := nmax: T(0, x) := 1: for i from 1 to nmax do dgr := degree(T(i-1, x), x): for na from 0 to dgr do c(na) := coeff(T(i-1, x), x, na) od: T(i-1, x+1) := 0: for nb from 0 to dgr do T(i-1, x+1) := T(i-1, x+1) + c(nb)*(x+1)^nb od: for nc from 0 to dgr do ECGP(i-1, nc+1) := coeff(T(i-1, x), x, nc) od: T(i, x) := expand((2*x+1)*(x+1)*T(i-1, x+1) - 2*x^2*T(i-1, x)) od: dgr := degree (T(nmax, x), x): kmax := nmax: for k from 1 to kmax do p := k: for m from 1 to k do E(m, k) := sum((-1)^(m-q)*(q^k)*binomial(k+1, m-q), q=1..m) od: fx(p) := (-1)^(p+1) * (sum(E(r, k)*z^(k-r), r=1..k))/(z-1)^(p+1): GF(-(2*p+1)) := sort(simplify(((-1)^p* 1/2^(p+1)) * sum(ECGP(k-1, k-s)*fx(k-s), s=0..k-1)), ascending): NUMGF(-(2*p+1)) := -numer(GF(-(2*p+1))): for n from 1 to mmax+1 do A(k+1, n) := coeff(NUMGF(-(2*p+1)), z, n-1) od: od: for m from 2 to mmax do A(1, m) := 0 od: A(1, 1) := 1: FT(1) := 1: for n from 1 to nmax do for m from 1 to n do FT((n)*(n-1)/2+m+1) := A(n+1, m) end do end do: a := n-> FT(n): seq(a(n), n = 1..(nmax+1)*(nmax)/2+1);
  • Mathematica
    T[ n_, k_] := Coefficient[a[2 n]/2^IntegerExponent[(2 n)!, 2], x, n + k];
    a[0] = a[1] = 1; a[ m_] := a[m] = With[{n = m - 1}, x Sum[ a[k] a[n - k] Binomial[n, k], {k, 0, n}]]; Join[{1}, Flatten@Table[T[n, k], {n, 1, 8}, {k, 0, n - 1}]] (* Michael Somos, Apr 22 2020 *)

Extensions

Edited by Johannes W. Meijer, Sep 23 2012

A160721 First differences of A160720.

Original entry on oeis.org

1, 4, 4, 12, 4, 12, 12, 28, 4, 12, 12, 28, 12, 28, 28, 60, 4, 12, 12, 28, 12, 28, 28, 60, 12, 28, 28, 60, 28, 60, 60, 124, 4, 12, 12, 28, 12, 28, 28, 60, 12, 28, 28, 60, 28, 60, 60, 124, 12, 28, 28, 60, 28, 60, 60, 124, 28, 60, 60, 124, 60, 124, 124, 252, 4, 12, 12, 28, 12, 28, 28
Offset: 1

Views

Author

Omar E. Pol, May 25 2009, May 29 2009

Keywords

Comments

This sequence is related to the Sierpinski triangle and to Gould's sequence A001316. - Omar E. Pol, Jul 23 2009
When written as a irregular triangle in which row lengths are A011782 it appears that right border gives A173033. - Omar E. Pol, Mar 20 2013

Examples

			From _Omar E. Pol_, Mar 20 2013 (Start):
Triangle begins:
1;
4;
4,12;
4,12,12,28;
4,12,12,28,12,28,28,60;
4,12,12,28,12,28,28,60,12,28,28,60,28,60,60,124;
4,12,12,28,12,28,28,60,12,28,28,60,28,60,60,124,12,28,28,60,28,60,60,124,28,60,60,124,60,124,124,252;
(End)
		

Crossrefs

Formula

a(1)=1. Observation: It appears that a(n) = 4*A038573(n-1), n>1. [From Omar E. Pol, Jul 23 2009]. This formula is correct! - N. J. A. Sloane, Jan 23 2016

Extensions

More terms from R. J. Mathar, Jul 14 2009
Previous Showing 91-100 of 227 results. Next