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 10 results.

A253085 a(n) = A247649(A247647(n)).

Original entry on oeis.org

5, 7, 17, 19, 19, 31, 25, 61, 71, 41, 71, 77, 71, 91, 77, 107, 121, 85, 113, 103, 217, 251, 125, 251, 281, 121, 185, 151, 251, 289, 151, 281, 307, 251, 335, 281, 311, 349, 289, 373, 307, 383, 445, 247, 445, 487, 289, 397, 331, 389, 439, 331, 463, 409, 773, 895, 457, 895, 997, 349
Offset: 1

Views

Author

N. J. A. Sloane, Feb 06 2015

Keywords

Comments

The terms of A247649 are products of terms from this subsequence.
It would be nice to have a characterization of this sequence that is independent of A247649.

Crossrefs

A255490 The subsequence A247649(2^n-1).

Original entry on oeis.org

1, 5, 7, 19, 25, 77, 103, 307, 409, 1229, 1639, 4915, 6553, 19661, 26215, 78643, 104857, 314573, 419431, 1258291, 1677721, 5033165, 6710887, 20132659, 26843545, 80530637, 107374183, 322122547, 429496729, 1288490189, 1717986919, 5153960755
Offset: 0

Views

Author

N. J. A. Sloane, Mar 03 2015

Keywords

Comments

Note that A247649 is not the Run Length Transform of this sequence - compare A253085.

Crossrefs

Programs

  • Mathematica
    LinearRecurrence[{0,3,0,4}, {1,5,7,19}, 40] (* Georg Fischer, Aug 18 2021 *)

Formula

G.f.: (1+5*x+4*x^2+4*x^3)/(1-3*x^2-4*x^4).

A255654 Partial sums of A247649.

Original entry on oeis.org

1, 6, 11, 18, 23, 40, 47, 66, 71, 96, 113, 132, 139, 170, 189, 214, 219, 244, 269, 304, 321, 382, 401, 472, 479, 514, 545, 586, 605, 676, 701, 778, 783, 808, 833, 868, 893, 978, 1013, 1108, 1125, 1210, 1271, 1342, 1361, 1452, 1523, 1600, 1607, 1642, 1677, 1726, 1757, 1864, 1905, 2026, 2045, 2140, 2211, 2296, 2321, 2434, 2511, 2614
Offset: 0

Views

Author

Omar E. Pol, Mar 01 2015

Keywords

Crossrefs

Cf. A247649.

Programs

  • Python
    from itertools import islice, count
    import sympy
    def A225654gen(): # generator of terms
        from sympy.abc import x
        f, g, blist, c = 1/x**2+1/x+1+x+x**2, 1, [1], 1
        yield c
        for n in count(1):
            s = [int(d,2) for d in bin(n)[2:].split('00') if d != '']
            g = (g*f).expand(modulus=2)
            if len(s) == 1:
                blist.append(g.subs(x,1))
            else:
                blist.append(prod(blist[d] for d in s))
            c += blist[-1]
            yield c
    A225654_list = list(islice(A225654gen(),26)) # Chai Wah Wu, Dec 23 2021

A247648 Numbers whose binary expansion begins and ends with 1 and does not contain two adjacent zeros.

Original entry on oeis.org

1, 3, 5, 7, 11, 13, 15, 21, 23, 27, 29, 31, 43, 45, 47, 53, 55, 59, 61, 63, 85, 87, 91, 93, 95, 107, 109, 111, 117, 119, 123, 125, 127, 171, 173, 175, 181, 183, 187, 189, 191, 213, 215, 219, 221, 223, 235, 237, 239, 245, 247, 251, 253
Offset: 1

Views

Author

N. J. A. Sloane, Sep 25 2014

Keywords

Comments

Decimal equivalents of A247647.
A265716(a(n)) = A265705(2*a(n),a(n)) = 2*a(n). - Reinhard Zumkeller, Dec 15 2015
The viabin numbers of the integer partitions having distinct parts (for the definition of viabin number see comment in A290253). For example, 109 is in the sequence because it is the viabin number of the integer partition [5,4,2]; 121 is not in the sequence because it is the viabin number of the integer partition [5,4,4]. - Emeric Deutsch, Aug 29 2017

Examples

			109 is in the sequence because its binary expansion is 1101101.
		

Crossrefs

Cf. A247875 (complement).

Programs

  • Haskell
    import Data.Set (singleton, deleteFindMin, insert)
    a247648 n = a247648_list !! (n-1)
    a247648_list = f $ singleton 1 where
       f s = x : f (insert (4 * x + 1) $ insert (2 * x + 1) s')
             where (x, s') = deleteFindMin s
    -- Reinhard Zumkeller, Sep 25 2014
    
  • Maple
    vitopart := proc (n) local L, i, j, N, p, t: N := 2*n: L := ListTools:-Reverse(convert(N, base, 2)): j := 0: for i to nops(L) do if L[i] = 0 then j := j+1: p[j] := numboccur(L[1 .. i], 1) end if end do: sort([seq(p[t], t = 1 .. j)], `>=`) end proc: a := proc (n) if n = 1 then 1 elif `mod`(n, 2) = 0 then a((1/2)*n) elif `mod`(n, 2) = 1 and `mod`((1/2)*n-1/2, 2) = 0 then a((1/2)*n-1/2)+1 else a((1/2)*n-1/2) end if end proc: A := {}: for n to 254 do if a(n) = nops(vitopart(n)) then A := `union`(A, {n}) else end if end do: A; # program is based on my comment; the command vitopart(n) yields the integer partition having viabin number n. # Emeric Deutsch, Aug 29 2017
  • Mathematica
    Select[Range@ 256, And[First@ # == Last@ # == 1, NoneTrue[Map[Length, Select[Split[#], First@ # == 0 &]], # > 1 &]] &@ IntegerDigits[#, 2] &] (* Michael De Vlieger, Aug 29 2017 *)
  • PARI
    isok(k) = if (k%2, my(b=binary(k)); #select(x->(x==0), vector(#b-1, k, b[k]+b[k+1])) == 0); \\ Michel Marcus, Jun 15 2024
  • Python
    A247648_list = [n for n in range(1,10**5) if n % 2 and not '00' in bin(n)]
    # Chai Wah Wu, Sep 25 2014
    

A247647 Binary numbers that begin and end with 1 and do not contain two adjacent zeros.

Original entry on oeis.org

1, 11, 101, 111, 1011, 1101, 1111, 10101, 10111, 11011, 11101, 11111, 101011, 101101, 101111, 110101, 110111, 111011, 111101, 111111, 1010101, 1010111, 1011011, 1011101, 1011111, 1101011, 1101101, 1101111, 1110101, 1110111, 1111011, 1111101, 1111111, 10101011, 10101101, 10101111, 10110101, 10110111, 10111011, 10111101
Offset: 1

Views

Author

N. J. A. Sloane, Sep 25 2014

Keywords

Crossrefs

See A247648 for the decimal equivalents.

Programs

  • Haskell
    a247647 = a007088 . a247648  -- Reinhard Zumkeller, Sep 25 2014
  • Mathematica
    With[{upto=500},Map[FromDigits,Select[IntegerString[Range[1,upto,2],2],StringFreeQ[#,"00"]&]]] (* Paolo Xausa, Dec 06 2023 *)
  • Python
    A247647_list = [int(bin(n)[2:]) for n in range(1,10**5) if n % 2 and not '00' in bin(n)]
    # Chai Wah Wu, Sep 25 2014
    

Formula

a(n) = A007088(A247648(n)).

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

Original entry on oeis.org

1, 6, 6, 12, 6, 16, 12, 24, 6, 36, 16, 32, 12, 36, 24, 48, 6, 36, 36, 72, 16, 56, 32, 64, 12, 72, 36, 72, 24, 68, 48, 96, 6, 36, 36, 72, 36, 96, 72, 144, 16, 96, 56, 112, 32, 100, 64, 128, 12, 72, 72, 144, 36, 120, 72, 144, 24, 144, 68, 136
Offset: 0

Views

Author

N. J. A. Sloane, Mar 01 2015

Keywords

Comments

All the following are of the same type: A001316, A071053, A134660, A134661, A134662, A255485, A247649, A255486. It would be nice to have some unifying formula or recurrence. (Restating the definition, these are the Hamming weights of the n-th powers of the corresponding polynomials over GF(2). - Joerg Arndt, Mar 02 2015)

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;
6;
6,12;
6,16,12,24;
6,36,16,32,12,36,24,48;
6,36,36,72,16,56,32,64,12,72,36,72,24,68,48,96;
6,36,36,72,36,96,72,144,16,96,56,112,32,100,64,128,12,72,72,144,36,120,72,144,24,144,68,136...
...
In each row the first quarter of the terms (and no more) are equal to 6 times the beginning of the sequence itself (corrected after Sloane's comment in A247649, Mar 03 2015).
(End)
		

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[CoefficientList[(1 + x + x^2 + x^3 + x^4 + x^5)^n, x], _?OddQ];
    Table[a[n], {n, 0, 90}] (* Jean-François Alcover, Apr 06 2017 *)
  • PARI
    a(n) = {my(pol=(1+x+x^2+x^3+x^4+x^5)*Mod(1,2)); subst(lift(pol^n), x, 1);} \\ Michel Marcus, Mar 01 2015

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

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

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.

A247650 Number of terms in expansion of f^n mod 2, where f = (1/x^2+1/x+1+x+x^2)*(1/y^2+1/y+1+y+y^2) mod 2.

Original entry on oeis.org

1, 25, 25, 49, 25, 289, 49, 361, 25, 625, 289, 361, 49, 961, 361, 625, 25, 625, 625, 1225, 289, 3721, 361, 5041, 49, 1225, 961, 1681, 361, 5041, 625, 5929, 25, 625, 625, 1225, 625, 7225, 1225, 9025, 289, 7225, 3721, 5041, 361, 8281, 5041, 5929, 49, 1225
Offset: 0

Views

Author

N. J. A. Sloane, Sep 25 2014

Keywords

Comments

This is the number of cells that are ON after n generations in a two-dimensional cellular automaton defined by the odd-neighbor rule where the neighborhood consists of a 5X5 block of contiguous cells.

Crossrefs

Programs

  • Python
    import sympy
    from operator import mul
    from functools import reduce
    x, y = sympy.symbols('x y')
    f = ((1/x**2+1/x+1+x+x**2)*(1/y**2+1/y+1+y+y**2)).expand(modulus=2)
    A247650_list, g = [1], 1
    for n in range(1, 101):
        s = [int(d, 2) for d in bin(n)[2:].split('00') if d != '']
        g = (g*f).expand(modulus=2)
        if len(s) == 1:
            A247650_list.append(g.subs([(x, 1), (y, 1)]))
        else:
            A247650_list.append(reduce(mul, (A247650_list[d] for d in s)))
    # Chai Wah Wu, Sep 25 2014

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) = 25*289 = 7225. This is a generalization of the Run Length Transform.
Showing 1-10 of 10 results.