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-3 of 3 results.

A246036 Expansion of (1+4*x)/((1+2*x)*(1-4*x)).

Original entry on oeis.org

1, 6, 20, 88, 336, 1376, 5440, 21888, 87296, 349696, 1397760, 5593088, 22368256, 89481216, 357908480, 1431666688, 5726601216, 22906535936, 91625881600, 366504050688, 1466015154176, 5864062713856, 23456246661120, 93824995033088, 375299963355136, 1501199886974976, 6004799480791040, 24019198057381888
Offset: 0

Views

Author

N. J. A. Sloane, Aug 21 2014

Keywords

Comments

Also, fourth moments of Rudin-Shapiro polynomials (see Doche, Doche-Habsieger, Ekhad papers). - Doron Zeilberger, Apr 15 2016

Crossrefs

Programs

  • Magma
    I:=[1,6]; [n le 2 select I[n] else 2*Self(n-1)+8*Self(n-2): n in [1..30]]; // Vincenzo Librandi, Aug 22 2014
    
  • Mathematica
    CoefficientList[Series[(1+4x)/((1+2x)(1-4x)), {x, 0, 50}], x] (* Vincenzo Librandi, Aug 22 2014 *)
  • PARI
    Vec((1+4*x)/((1+2*x)*(1-4*x)) + O(x^100)) \\ Colin Barker, Aug 22 2014
    
  • PARI
    apply( A246036(n)=(4^(1+n)-(-2)^n)/3, [0..30]) \\ M. F. Hasler, Sep 18 2020
    
  • SageMath
    A246036= BinaryRecurrenceSequence(2,8,1,6)
    [A246036(n) for n in range(41)] # G. C. Greubel, Mar 08 2023

Formula

a(n) = 2*a(n-1) + 8*a(n-2).
a(n) = (4^(1+n) - (-2)^n)/3. - Colin Barker, Aug 22 2014
a(n) = A054881(n+3)/8. - L. Edson Jeffery, Apr 22 2015
a(n) = A003683(n+2)/2 and the above formula follow from the explicit expression for a(n), cf. second formula. - M. F. Hasler, Sep 11 2020
a(n) = 2^n*A001045(n+2). - R. J. Mathar, Mar 08 2021

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

Original entry on oeis.org

1, 7, 7, 29, 7, 49, 29, 103, 7, 49, 49, 203, 29, 203, 103, 373, 7, 49, 49, 203, 49, 343, 203, 721, 29, 203, 203, 841, 103, 721, 373, 1407, 7, 49, 49, 203, 49, 343, 203, 721, 49, 343, 343, 1421, 203, 1421, 721, 2611, 29, 203, 203, 841, 203, 1421, 841, 2987, 103, 721, 721, 2987, 373, 2611, 1407, 5277
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 575 (see Ekhad-Sloane-Zeilberger "Odd-Rule Cellular Automata on the Square Grid" link).
Run Length Transform of A246038.
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, X, 0]
[X, X, X]
which contains a(1) = 7 ON cells.
		

Crossrefs

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

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)+1 mod 2;
    OddCA(f, 70);
  • Mathematica
    (* f = A246038 *) f[0]=1; f[1]=7; f[2]=29; f[3]=103; f[4]=373; f[n_] := f[n] = 8 f[n-4] + 8 f[n-3] + 3 f[n-1]; Table[Times @@ (f[Length[#]]&) /@ Select[Split[IntegerDigits[n, 2]], #[[1]] == 1&], {n, 0, 63}] (* Jean-François Alcover, Jul 12 2017 *)

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

Original entry on oeis.org

1, 9, 9, 37, 9, 65, 37, 157, 9, 81, 65, 237, 37, 293, 157, 713, 9, 81, 81, 333, 65, 473, 237, 1077, 37, 333, 293, 1129, 157, 1285, 713, 2737, 9, 81, 81, 333, 81, 585, 333, 1413, 65, 585, 473, 1733, 237, 1933, 1077, 4337, 37, 333, 333, 1369, 293, 2125, 1129, 4969, 157, 1413, 1285, 5041, 713, 5561, 2737, 11421, 9, 81
Offset: 0

Views

Author

N. J. A. Sloane, Aug 26 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 (a cross containing 9 cells), and in which a cell is ON iff there was an odd number of ON cells in the neighborhood at the previous generation.

Examples

			Here is the neighborhood:
[0, 0, X, 0, 0]
[0, 0, X, 0, 0]
[X, X, X, X, X]
[0, 0, X, 0, 0]
[0, 0, X, 0, 0]
which contains a(1) = 9 ON cells.
The second and third generations are:
[0, 0, 0, 0, X, 0, 0, 0, 0]
[0, 0, 0, 0, 0, 0, 0, 0, 0]
[0, 0, 0, 0, X, 0, 0, 0, 0]
[0, 0, 0, 0, 0, 0, 0, 0, 0]
[X, 0, X, 0, X, 0, X, 0, X]  (again with 9 ON cells)
[0, 0, 0, 0, 0, 0, 0, 0, 0]
[0, 0, 0, 0, X, 0, 0, 0, 0]
[0, 0, 0, 0, 0, 0, 0, 0, 0]
[0, 0, 0, 0, X, 0, 0, 0, 0]
[0, 0, 0, 0, 0, 0, X, 0, 0, 0, 0, 0, 0]
[0, 0, 0, 0, 0, 0, X, 0, 0, 0, 0, 0, 0]
[0, 0, 0, 0, X, X, 0, X, X, 0, 0, 0, 0]
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
[0, 0, X, 0, 0, X, X, X, 0, 0, X, 0, 0]
[0, 0, X, 0, X, 0, 0, 0, X, 0, X, 0, 0]
[X, X, 0, 0, X, 0, X, 0, X, 0, 0, X, X] (with 37 ON cells)
[0, 0, X, 0, X, 0, 0, 0, X, 0, X, 0, 0]
[0, 0, X, 0, 0, X, X, X, 0, 0, X, 0, 0]
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
[0, 0, 0, 0, X, X, 0, X, X, 0, 0, 0, 0]
[0, 0, 0, 0, 0, 0, X, 0, 0, 0, 0, 0, 0]
[0, 0, 0, 0, 0, 0, X, 0, 0, 0, 0, 0, 0]
The terms can be arranged into blocks of sizes 1,1,2,4,8,16,32,...:
1,
9,
9, 37,
9, 65, 37, 157,
9, 81, 65, 237, 37, 293, 157, 713,
9, 81, 81, 333, 65, 473, 237, 1077, 37, 333, 293, 1129, 157, 1285, 713, 2737,
9, 81, 81, 333, 81, 585, 333, 1413, 65, 585, 473, 1733, 237, 1933, 1077, 4337, 37, 333, 333, 1369, 293, 2125, 1129, 4969, 157, 1413, 1285, 5041, 713, 5561, 2737, 11421, ...
The final terms in the rows are A246315.
		

Crossrefs

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

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^2+1/x+1+x+x^2+1/y^2+1/y+y+y^2;
    OddCA(f, 70);
  • Mathematica
    c[f_] := f /. {x -> 1, y -> 1};
    OddCA[f_, M_] := Module[{a = {}, f2, p = 1}, f2 = PolynomialMod[f, 2]; Do[ AppendTo[a, c[p]]; Print[a]; p = PolynomialMod[p f2, 2], {n, 0, M}]; a];
    f = 1/x^2 + 1/x + 1 + x + x^2 + 1/y^2 + 1/y + y + y^2;
    OddCA[f, 70] (* Jean-François Alcover, May 24 2020, after Maple *)

Formula

The values of a(n) for n in A247647 (or A247648) determine all the values, as follows. Parse the binary expansion of n into terms from A247647 separated by at least two zeros: m_1 0...0 m_2 0...0 m_3 ... m_r 0...0. Ignore any number (one or more) of trailing zeros. Then a(n) = a(m_1)*a(m_2)*...*a(m_r). For example, n = 37_10 = 100101_2 is parsed into 1.00.101, and so a(37) = a(1)*a(5) = 9*65 = 585. This is a generalization of the Run Length Transform.
Showing 1-3 of 3 results.