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 21-30 of 43 results. Next

A134660 Number of odd coefficients in (1 + x + x^2 + x^3)^n.

Original entry on oeis.org

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

Views

Author

Steven Finch, Jan 25 2008

Keywords

Examples

			From _Omar E. Pol_, Mar 01 2015: (Start)
Written as an irregular triangle in which the row lengths are the terms of A011782, the sequence begins:
1;
4;
4,4;
4,16,4,8;
4,16,16,4,4,16,8,16;
4,16,16,16,16,64,4,8,4,16,16,8,8,32,16,32;
4,16,16,16,16,64,16,32,16,64,64,4,4,16,8,16,4,16,16,16,16,64,8,16,8,32,32,16,16,64,32,64;
...
(End)
		

Crossrefs

Programs

  • Maple
    seq(igcd(4^n,binomial(4*n,n)),n=0..77); # Peter Luschny, Nov 08 2011
  • Mathematica
    PolynomialMod[(1+x+x^2+x^3)^n, 2] /. x->1
    A036555 = Total /@ IntegerDigits[3 Range[0, 100], 2]; Table[2^A036555[[n]], {n, 1, 20}] (* or *) Table[GCD[4^n, Binomial[4*n, n]], {n, 0, 50}] (* G. C. Greubel, Dec 31 2017 *)
  • PARI
    a(n) = {my(pol= Pol([1,1,1,1], xx)*Mod(1,2)); subst(lift(pol^n), xx, 1);} \\ Michel Marcus, Mar 01 2015
    
  • PARI
    a(n) = 2^hammingweight(3*n); \\ Joerg Arndt, Mar 10 2015

Formula

a(n) = 2^A036555(n).
a(n) = gcd(4^n, C(4*n, n)). - Peter Luschny, Nov 08 2011

A134661 Number of odd coefficients in (1 + x + x^3)^n.

Original entry on oeis.org

1, 3, 3, 7, 3, 9, 7, 13, 3, 9, 9, 19, 7, 21, 13, 27, 3, 9, 9, 21, 9, 27, 19, 35, 7, 21, 21, 41, 13, 39, 27, 55, 3, 9, 9, 21, 9, 27, 21, 39, 9, 27, 27, 55, 19, 57, 35, 73, 7, 21, 21, 49, 21, 63, 41, 75, 13, 39, 39, 79, 27, 81, 55, 109, 3, 9, 9, 21, 9, 27, 21, 39, 9, 27, 27, 57, 21, 63, 39
Offset: 0

Views

Author

Steven Finch, Jan 25 2008

Keywords

Examples

			From _Omar E. Pol_, Mar 01 2015: (Start)
Written as an irregular triangle in which the row lengths are the terms of A011782, the sequence begins:
1;
3;
3,7;
3,9,7,13;
3,9,9,19,7,21,13,27;
3,9,9,21,9,27,19,35,7,21,21,41,13,39,27,55;
3,9,9,21,9,27,21,39,9,27,27,55,19,57,35,73,7,21,21,49,21,63,41,75,13,39,39,79,27,81,55,109;
3,9,9,21,9,27,21,39,9,27,27,57,21,63,39...
...
Note that in each row a fraction of the first terms are equal to 3 times the beginning of the sequence itself. For rows 0-6 the fractions are: 0, 1, 1/2, 1/2, 3/8, 3/8, 11/32. Apparently the fractions converge to a constant.
(End)
		

Crossrefs

Programs

  • Mathematica
    PolynomialMod[(1+x+x^3)^n, 2] /. x->1
  • PARI
    a(n) = {my(pol= Pol([1,0,1,1], xx)*Mod(1,2)); subst(lift(pol^n), xx, 1);} \\ Michel Marcus, Mar 01 2015

A245565 a(n) = Product_{i in row n of A245562} Pell(i+1).

Original entry on oeis.org

1, 2, 2, 5, 2, 4, 5, 12, 2, 4, 4, 10, 5, 10, 12, 29, 2, 4, 4, 10, 4, 8, 10, 24, 5, 10, 10, 25, 12, 24, 29, 70, 2, 4, 4, 10, 4, 8, 10, 24, 4, 8, 8, 20, 10, 20, 24, 58, 5, 10, 10, 25, 10, 20, 25, 60, 12, 24, 24, 60, 29, 58, 70, 169, 2, 4, 4, 10, 4, 8, 10, 24, 4, 8, 8, 20, 10, 20, 24, 58, 4, 8, 8, 20, 8, 16
Offset: 0

Views

Author

N. J. A. Sloane, Aug 10 2014; revised Sep 05 2014

Keywords

Comments

This is the Run Length Transform of S(n) = Pell(n+1) (cf. A000129).
The Run Length Transform of a sequence {S(n), n>=0} is defined to be the sequence {T(n), n>=0} given by T(n) = Product_i S(i), where i runs through the lengths of runs of 1's in the binary expansion of n. E.g. 19 is 10011 in binary, which has two runs of 1's, of lengths 1 and 2. So T(19) = S(1)*S(2). T(0)=1 (the empty product).

Crossrefs

Programs

  • Maple
    A000129 := proc(n) option remember; if n <=1 then n; else 2*A000129(n-1)+A000129(n-2); fi; end;
    ans:=[];
    for n from 0 to 100 do lis:=[]; t1:=convert(n,base,2); L1:=nops(t1);
    out1:=1; c:=0;
    for i from 1 to L1 do
       if out1 = 1 and t1[i] = 1 then out1:=0; c:=c+1;
       elif out1 = 0 and t1[i] = 1 then c:=c+1;
       elif out1 = 1 and t1[i] = 0 then c:=c;
       elif out1 = 0 and t1[i] = 0 then lis:=[c,op(lis)]; out1:=1; c:=0;
       fi;
       if i = L1 and c>0 then lis:=[c,op(lis)]; fi;
                       od:
    a:=mul(A000129(i+1), i in lis);
    ans:=[op(ans),a];
    od:
    ans;

A247282 Run Length Transform of A001317.

Original entry on oeis.org

1, 1, 1, 3, 1, 1, 3, 5, 1, 1, 1, 3, 3, 3, 5, 15, 1, 1, 1, 3, 1, 1, 3, 5, 3, 3, 3, 9, 5, 5, 15, 17, 1, 1, 1, 3, 1, 1, 3, 5, 1, 1, 1, 3, 3, 3, 5, 15, 3, 3, 3, 9, 3, 3, 9, 15, 5, 5, 5, 15, 15, 15, 17, 51, 1, 1, 1, 3, 1, 1, 3, 5, 1, 1, 1, 3, 3, 3, 5, 15, 1, 1, 1, 3, 1, 1, 3, 5, 3, 3, 3, 9, 5, 5, 15, 17, 3, 3, 3, 9, 3, 3, 9, 15, 3, 3, 3, 9, 9, 9, 15, 45
Offset: 0

Views

Author

Antti Karttunen, Sep 22 2014

Keywords

Comments

The Run Length Transform of a sequence {S(n), n>=0} is defined to be the sequence {T(n), n>=0} given by T(n) = Product_i S(i), where i runs through the lengths of runs of 1's in the binary expansion of n. E.g. 19 is 10011 in binary, which has two runs of 1's, of lengths 1 and 2. So T(19) = S(1)*S(2). T(0)=1 (the empty product).
This sequence is obtained by applying Run Length Transform to the right-shifted version of the sequence A001317: 1, 3, 5, 15, 17, 51, 85, 255, 257, ...

Examples

			115 is '1110011' in binary. The run lengths of 1-runs are 2 and 3, thus a(115) = A001317(2-1) * A001317(3-1) = 3*5 = 15.
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,5;
1,1,1,3,3,3,5,15;
1,1,1,3,1,1,3,5,3,3,3,9,5,5,15,17;
1,1,1,3,1,1,3,5,1,1,1,3,3,3,5,15,3,3,3,9,3,3,9,15,5,5,5,15,15,15,17,51;
...
Right border gives 1 together with A001317.
(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, A246674, A246685.

Programs

  • Mathematica
    a1317[n_] := FromDigits[ Table[ Mod[Binomial[n-1, k], 2], {k, 0, n-1}], 2];
    Table[ Times @@ (a1317[Length[#]]&) /@ Select[Split[IntegerDigits[n, 2]], #[[1]] == 1&], {n, 0, 100}] (* Jean-François Alcover, Jul 11 2017 *)
  • Python
    # uses RLT function from A278159
    def A247282(n): return RLT(n,lambda m: int(''.join(str(int(not(~(m-1)&k))) for k in range(m)),2)) # Chai Wah Wu, Feb 04 2022

Formula

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

A253065 Number of odd terms in f^n, where f = 1+x+x^2+x^2*y+x^2/y.

Original entry on oeis.org

1, 5, 5, 17, 5, 25, 17, 65, 5, 25, 25, 85, 17, 85, 65, 229, 5, 25, 25, 85, 25, 125, 85, 325, 17, 85, 85, 289, 65, 325, 229, 813, 5, 25, 25, 85, 25, 125, 85, 325, 25, 125, 125, 425, 85, 425, 325, 1145, 17, 85, 85, 289, 85, 425, 289, 1105, 65, 325, 325, 1105, 229, 1145, 813, 2945, 5, 25, 25, 85
Offset: 0

Views

Author

N. J. A. Sloane, Jan 26 2015

Keywords

Comments

This is the number of ON cells in a certain 2-D CA in which the neighborhood of a cell is defined by f, and in which a cell is ON iff there was an odd number of ON cells in the neighborhood at the previous generation.
This is the odd-rule cellular automaton defined by OddRule 171 (see Ekhad-Sloane-Zeilberger "Odd-Rule Cellular Automata on the Square Grid" link).

Examples

			Here is the neighborhood f:
[0, 0, X]
[X, X, X]
[0, 0, X]
which contains a(1) = 5 ON cells.
		

Crossrefs

Other CA's that use the same rule but with different cell neighborhoods: A160239, A102376, A071053, A072272, A001316, A246034, A246035, A253064, A253066.
Cf. A253067.

Programs

  • Maple
    C:=f->subs({x=1, y=1}, f);
    # Find number of ON cells in CA for generations 0 thru M defined by rule
    # that cell is ON iff number of ON cells in nbd at time n-1 was odd
    # where nbd is defined by a polynomial or Laurent series f(x, y).
    OddCA:=proc(f, M) global C; local n, a, i, f2, p;
    f2:=simplify(expand(f)) mod 2;
    a:=[]; p:=1;
    for n from 0 to M do a:=[op(a), C(p)]; p:=expand(p*f2) mod 2; od:
    lprint([seq(a[i], i=1..nops(a))]);
    end;
    f:=1+x+x^2+x^2*y+x^2/y;
    OddCA(f, 130);
  • Mathematica
    (* f = A253067 *) f[0]=1; f[1]=5; f[2]=17; f[3]=65; f[4]=229; f[5]=813; f[n_] := f[n] = 8 f[n-5] + 6 f[n-4] + 13 f[n-3] + 5 f[n-2] + f[n-1]; Table[Times @@ (f[Length[#]]&) /@ Select[s = Split[IntegerDigits[n, 2]], #[[1]] == 1&], {n, 0, 67}] (* Jean-François Alcover, Jul 12 2017 *)

Formula

This is the Run Length Transform of A253067.

A253066 Number of odd terms in f^n, where f = 1/x+1+x+1/y+y/x+x*y.

Original entry on oeis.org

1, 6, 6, 28, 6, 36, 28, 112, 6, 36, 36, 168, 28, 168, 112, 456, 6, 36, 36, 168, 36, 216, 168, 672, 28, 168, 168, 784, 112, 672, 456, 1816, 6, 36, 36, 168, 36, 216, 168, 672, 36, 216, 216, 1008, 168, 1008, 672, 2736, 28, 168, 168, 784, 168, 1008, 784, 3136, 112, 672, 672, 3136, 456, 2736, 1816, 7288
Offset: 0

Views

Author

N. J. A. Sloane, Jan 29 2015

Keywords

Comments

This is the number of ON cells in a certain 2-D CA in which the neighborhood of a cell is defined by f, and in which a cell is ON iff there was an odd number of ON cells in the neighborhood at the previous generation.
This is the odd-rule cellular automaton defined by OddRule 275 (see Ekhad-Sloane-Zeilberger "Odd-Rule Cellular Automata on the Square Grid" link).

Examples

			Here is the neighborhood f:
[X, 0, X]
[X, X, X]
[0, X, 0]
which contains a(1) = 6 ON cells.
		

Crossrefs

Other CA's that use the same rule but with different cell neighborhoods: A160239, A102376, A071053, A072272, A001316, A246034, A246035, A253064, A253065.
Cf. A253068.

Programs

  • Maple
    C:=f->subs({x=1, y=1}, f);
    # Find number of ON cells in CA for generations 0 thru M defined by rule
    # that cell is ON iff number of ON cells in nbd at time n-1 was odd
    # where nbd is defined by a polynomial or Laurent series f(x, y).
    OddCA:=proc(f, M) global C; local n, a, i, f2, p;
    f2:=simplify(expand(f)) mod 2;
    a:=[]; p:=1;
    for n from 0 to M do a:=[op(a), C(p)]; p:=expand(p*f2) mod 2; od:
    lprint([seq(a[i], i=1..nops(a))]);
    end;
    f:=1/x+1+x+1/y+y/x+x*y;
    OddCA(f, 130);
  • Mathematica
    (* f = A253068 *) f[0] = 1; f[n_] := ((-2)^n + 4^(n+2)-8)/9; Table[Times @@ (f[Length[#]]&) /@ Select[s = Split[IntegerDigits[n, 2]], #[[1]] == 1 &], {n, 0, 63}] (* Jean-François Alcover, Jul 12 2017 *)

Formula

This is the Run Length Transform of A253068.

A134662 Number of odd coefficients in (1 + x + x^4)^n.

Original entry on oeis.org

1, 3, 3, 9, 3, 7, 9, 17, 3, 9, 7, 21, 9, 17, 17, 33, 3, 9, 9, 27, 7, 17, 21, 43, 9, 27, 17, 51, 17, 35, 33, 67, 3, 9, 9, 27, 9, 21, 27, 51, 7, 21, 17, 51, 21, 41, 43, 83, 9, 27, 27, 81, 17, 43, 51, 113, 17, 51, 35, 105, 33, 67, 67, 137, 3, 9, 9, 27, 9, 21, 27, 51, 9, 27, 21, 63, 27, 51
Offset: 0

Views

Author

Steven Finch, Jan 25 2008

Keywords

Examples

			From _Omar E. Pol_, Mar 01 2015: (Start)
Written as an irregular triangle in which the row lengths are the terms of A011782, the sequence begins:
1;
3;
3,9;
3,7,9,17;
3,9,7,21,9,17,17,33;
3,9,9,27,7,17,21,43,9,27,17,51,17,35,33,67;
3,9,9,27,9,21,27,51,7,21,17,51,21,41,43,83,9,27,27,81,17,43,51,113,17,51,35,105,33,67,67,137;
Thanks to _Michel Marcus_ we can see the first few terms of the next four rows as shown below:
3,9,9,27,9,21,27,51,9,27,21,63,27,51,51,99,7,21,...
3,9,9,27,9,21,27,51,9,27,21,63,27,51,51,99,9,27,27,...
3,9,9,27,9,21,27,51,9,27,21,63,27,51,51,99,9,27,27,81,...
3,9,9,27,9,21,27,51,9,27,21,63,27,51,51,99,9,27,27,81,21,...
...
Apparently in each row the first quarter of the terms (and no more) are equal to 3 times the beginning of the sequence itself (comment corrected after Sloane's comment in A247649, Mar 03 2015).
(End)
		

Crossrefs

Cf. A071053.

Programs

  • Mathematica
    Table[PolynomialMod[(1+x+x^4)^n,2]/.x->1,{n,0,80}]
    Table[Count[CoefficientList[Expand[(1+x+x^4)^n],x],?OddQ],{n,0,80}] (* _Harvey P. Dale, Apr 15 2012 *)
  • PARI
    a(n) = {my(pol = (xx^4 + xx + 1)*Mod(1,2)); subst(lift(pol^n), xx, 1);} \\ Michel Marcus, Mar 01 2015
    
  • PARI
    tabf(nn, k=16) = {nbpt = 0; for (n=0, nn, if (n==0, nbt = 1, nbt = 2^(n-1)); for (m=nbpt, nbpt+nbt-1, if (m-nbpt >k, k++; break); print1(nbopd(m), ",");); print(); nbpt += nbt;);} \\ Michel Marcus, Mar 03 2015

Extensions

First Mathematica program corrected by Harvey P. Dale, Apr 15 2012

A246037 Number of odd terms in f^n, where f = (1/x+1+x)*(1/y+y).

Original entry on oeis.org

1, 6, 6, 20, 6, 36, 20, 88, 6, 36, 36, 120, 20, 120, 88, 336, 6, 36, 36, 120, 36, 216, 120, 528, 20, 120, 120, 400, 88, 528, 336, 1376, 6, 36, 36, 120, 36, 216, 120, 528, 36, 216, 216, 720, 120, 720, 528, 2016, 20, 120, 120, 400, 120, 720, 400, 1760, 88, 528, 528, 1760, 336, 2016, 1376, 5440
Offset: 0

Views

Author

N. J. A. Sloane, Aug 21 2014

Keywords

Comments

This is the number of ON cells in a certain 2-D CA in which the neighborhood of a cell is defined by f, and in which a cell is ON iff there was an odd number of ON cells in the neighborhood at the previous generation.
This is the odd-rule cellular automaton defined by OddRule 077 (see Ekhad-Sloane-Zeilberger "Odd-Rule Cellular Automata on the Square Grid" link).
Run Length Transform of A246036.
The Run Length Transform of a sequence {S(n), n>=0} is defined to be the sequence {T(n), n>=0} given by T(n) = Product_i S(i), where i runs through the lengths of runs of 1's in the binary expansion of n. E.g. 19 is 10011 in binary, which has two runs of 1's, of lengths 1 and 2. So T(19) = S(1)*S(2). T(0)=1 (the empty product).

Examples

			Here is the neighborhood:
[X, X, X]
[0, 0, 0]
[X, X, X]
which contains a(1) = 6 ON cells.
		

Crossrefs

Other CA's that use the same rule but with different cell neighborhoods: A160239, A102376, A071053, A072272, A001316, A246034, A246035.
Cf. A246036.

Programs

  • Maple
    C:=f->subs({x=1, y=1}, f);
    # Find number of ON cells in CA for generations 0 thru M defined by rule
    # that cell is ON iff number of ON cells in nbd at time n-1 was odd
    # where nbd is defined by a polynomial or Laurent series f(x, y).
    OddCA:=proc(f, M) global C; local n, a, i, f2, p;
    f2:=simplify(expand(f)) mod 2;
    a:=[]; p:=1;
    for n from 0 to M do a:=[op(a), C(p)]; p:=expand(p*f2) mod 2; od:
    lprint([seq(a[i], i=1..nops(a))]);
    end;
    f:=(1/x+1+x)*(1/y+y);
    OddCA(f, 70);
  • Mathematica
    (* f = A246036 *) f[0] = 1; f[n_] := (4^(n+1)-(-2)^n)/3; Table[Times @@ (f[Length[#]]&) /@ Select[s = Split[IntegerDigits[n, 2]], #[[1]] == 1&], {n, 0, 63}] (* Jean-François Alcover, Jul 12 2017 *)

A255485 Number of odd terms in expansion of (1 + x + x^2 + x^4)^n.

Original entry on oeis.org

1, 4, 4, 8, 4, 12, 8, 14, 4, 16, 12, 24, 8, 24, 14, 30, 4, 16, 16, 32, 12, 36, 24, 44, 8, 32, 24, 48, 14, 46, 30, 60, 4, 16, 16, 32, 16, 48, 32, 56, 12, 48, 36, 72, 24, 76, 44, 92, 8, 32, 32, 64, 24, 72, 48, 88, 14, 56, 46, 92, 30, 96, 60, 118, 4, 16, 16, 32, 16, 48, 32, 56, 16, 64, 48, 96
Offset: 0

Views

Author

N. J. A. Sloane, Feb 28 2015

Keywords

Crossrefs

Programs

  • Maple
    r1:=proc(f) local g,n; g:=n->nops(expand(f^n) mod 2); [seq(g(n),n=0..90)]; end;
    r1(1+x+x^2+x^4);
    # Alternative:
    P:= 1:
    for n from 0 to 100 do
      A[n]:= nops(P);
      P:= expand(P*(1+x+x^2+x^4)) mod 2;
    od:
    seq(A[i],i=0..100); # Robert Israel, Jan 07 2018
  • Mathematica
    a[n_] := Count[(List @@ Expand[(1+x+x^2+x^4)^n]) /. x -> 1, _?OddQ]; a[0] = 1;
    Table[a[n], {n, 0, 100}] (* Jean-François Alcover, Feb 06 2023 *)
  • PARI
    a(n) = {my(pol=(1+x+x^2+x^4)*Mod(1,2)); subst(lift(pol^n), x, 1);} \\ Michel Marcus, Mar 01 2015

Formula

From Robert Israel, Jan 07 2018: (Start)
a(2*n) = a(n).
a(8*n+1) = 4*a(n). (End)

A255486 Number of odd terms in expansion of (1+x+x^3+x^4)^n.

Original entry on oeis.org

1, 4, 4, 10, 4, 12, 10, 18, 4, 16, 12, 28, 10, 28, 18, 38, 4, 16, 16, 40, 12, 40, 28, 52, 10, 40, 28, 64, 18, 52, 38, 74, 4, 16, 16, 40, 16, 48, 40, 72, 12, 48, 40, 96, 28, 88, 52, 108, 10, 40, 40, 100, 28, 96, 64, 120, 18, 72, 52, 120, 38
Offset: 0

Views

Author

N. J. A. Sloane, Mar 01 2015

Keywords

Crossrefs

Programs

  • Maple
    r1:=proc(f) local g,n; g:=n->nops(expand(f^n) mod 2); [seq(g(n),n=0..90)]; end;
    r1(1+x+x^2+x^3);
  • Mathematica
    a[n_] := Count[(List @@ Expand[(1+x+x^3+x^4)^n]) /. x -> 1, _?OddQ]; a[0] = 1;
    Table[a[n], {n, 0, 60}] (* Jean-François Alcover, Apr 04 2017 *)
  • PARI
    a(n) = {my(pol=(1+x+x^3+x^4)*Mod(1,2)); subst(lift(pol^n), x, 1);} \\ Michel Marcus, Mar 01 2015
Previous Showing 21-30 of 43 results. Next