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 42 results. Next

A086784 Number of non-trailing zeros in binary representation of n.

Original entry on oeis.org

0, 0, 0, 0, 0, 1, 0, 0, 0, 2, 1, 1, 0, 1, 0, 0, 0, 3, 2, 2, 1, 2, 1, 1, 0, 2, 1, 1, 0, 1, 0, 0, 0, 4, 3, 3, 2, 3, 2, 2, 1, 3, 2, 2, 1, 2, 1, 1, 0, 3, 2, 2, 1, 2, 1, 1, 0, 2, 1, 1, 0, 1, 0, 0, 0, 5, 4, 4, 3, 4, 3, 3, 2, 4, 3, 3, 2, 3, 2, 2, 1, 4, 3, 3, 2, 3, 2, 2, 1, 3, 2, 2, 1, 2, 1, 1, 0, 4, 3, 3, 2, 3
Offset: 0

Views

Author

Reinhard Zumkeller, Aug 03 2003

Keywords

Comments

a(n) is also the number of parts smaller than the largest part in the integer partition having viabin number n. The viabin number of an integer partition is defined in the following way. Consider the southeast border of the Ferrers board of the integer partition and consider the binary number obtained by replacing each east step with 1 and each north step, except the last one, with 0. The corresponding decimal form is, by definition, the viabin number of the given integer partition. "Viabin" is coined from "via binary". For example, consider the integer partition [2,2,2,1]. The southeast border of its Ferrers board yields 10100, leading to the viabin number 20. - Emeric Deutsch Jul 24 2017

Examples

			a(34) = 3; indeed the binary representation of 34 is 100010, having 3 non-trailing zeros. - _Emeric Deutsch_ Jul 24 2017
		

Crossrefs

Cf. A007088.

Programs

  • Maple
    a := proc (n) local b, c: b := proc (n) if `mod`(n, 2) = 0 then 1+b((1/2)*n) else 0 end if end proc: c := proc (n) if n = 0 then 2 elif n = 1 then 0 elif `mod`(n, 2) = 0 then 1+c((1/2)*n) else c((1/2)*n-1/2) end if end proc: if n = 0 then 0 else c(n)-b(n) end if end proc: seq(a(n), n = 0 .. 101); # b and c are the Maple programs for A007814 and A023416, respectively. - Emeric Deutsch Jul 24 2017
  • Mathematica
    A086784[n_] := If[n == 0, 0, DigitCount[n, 2, 0] - IntegerExponent[n, 2]];
    Array[A086784, 100, 0] (* Paolo Xausa, Oct 01 2024 *)
  • PARI
    a(n)=if(n==0,0,exponent(n)+1-hammingweight(n)-valuation(n,2)); \\ Antoine Mathys, Nov 20 2024
  • Python
    def A086784(n): return bin(n>>(~n & n-1).bit_length())[2:].count('0') if n else 0 # Chai Wah Wu, Oct 14 2022
    

Formula

a(n) = A023416(n) - A007814(n) for n>0.
a(2^n) = a(A000079(n)) = 0; a(2^n - 1) = a(A000225(n)) = 0;
a(2^n + 1) = a(A000051(n)) = n - 1;
a(3*2^n - 1) = a(A055010(n)) = 1 for n>0;
a(2^n - 3) = a(A036563(n)) = 1, for n>2;
a((4^n - 1)/3) = a(A002450(n)) = n.
a(n) = if n mod 4 = 1 then a(floor(n/4)) + A007814(floor(n/2)) else a(floor(n/2)); a(0) = a(1) = 0.

A182461 a(n) = 3*a(n-1) - 2*a(n-2) with a(0)=16 and a(1)=40.

Original entry on oeis.org

16, 40, 88, 184, 376, 760, 1528, 3064, 6136, 12280, 24568, 49144, 98296, 196600, 393208, 786424, 1572856, 3145720, 6291448, 12582904, 25165816, 50331640, 100663288, 201326584, 402653176, 805306360, 1610612728, 3221225464, 6442450936, 12884901880
Offset: 0

Views

Author

Odimar Fabeny, Apr 30 2012

Keywords

Comments

Number of vertices into building blocks of 3d objects with 4 vertices.

Examples

			a(0) = 4+8+4;
a(1) = 4+8+16+8+4;
a(2) = 4+8+16+32+16+8+4;
a(3) = 4+8+16+32+64+32+16+8+4.
		

Crossrefs

Programs

  • Mathematica
    CoefficientList[Series[-((8 (x - 2))/(2 x^2 - 3 x + 1)), {x, 0, 40}], x] (* Vincenzo Librandi, Jun 02 2014 *)

Formula

a(n) = a(n-1)*2 + 8.
G.f.: 16 + 40*x + 88*x^2 + 184*x^3 + 376*x^4 + 760*x^5 + 1528*x^6 + ...
a(n) = 8 * A055010(n+1). [Joerg Arndt, Jun 01 2014]
G.f.: -((8*(x - 2))/(2*x^2 - 3*x + 1)). - Vincenzo Librandi, Jun 02 2014

A275726 A275725-polynomials evaluated at x=2: a(n) = A048675(A275725(n)).

Original entry on oeis.org

1, 2, 5, 3, 4, 3, 11, 10, 7, 4, 5, 4, 9, 7, 7, 4, 6, 4, 8, 7, 6, 4, 5, 4, 23, 22, 21, 19, 20, 19, 15, 14, 9, 5, 6, 5, 11, 8, 9, 5, 8, 5, 9, 8, 7, 5, 6, 5, 19, 18, 15, 12, 13, 12, 15, 14, 9, 5, 6, 5, 13, 11, 9, 5, 7, 5, 12, 11, 8, 5, 6, 5, 17, 15, 15, 12, 14, 12, 13, 11, 9, 5, 7, 5, 11, 8, 9, 5, 8, 5, 10, 8, 8, 5, 7, 5
Offset: 0

Views

Author

Antti Karttunen, Aug 09 2016

Keywords

Crossrefs

Cf. A275833 (indices of odd terms), A275834 (of even terms).

Programs

Formula

a(n) = A048675(A275725(n)).
Other identities:
For n >= 1, a(n!) = A055010(n).

A290114 Decimal representation of the diagonal from the origin to the corner of the n-th stage of growth of the two-dimensional cellular automaton defined by "Rule 643", based on the 5-celled von Neumann neighborhood.

Original entry on oeis.org

1, 3, 5, 11, 23, 47, 95, 191, 383, 767, 1535, 3071, 6143, 12287, 24575, 49151, 98303, 196607, 393215, 786431, 1572863, 3145727, 6291455, 12582911, 25165823, 50331647, 100663295, 201326591, 402653183, 805306367, 1610612735, 3221225471, 6442450943, 12884901887
Offset: 0

Views

Author

Robert Price, Jul 19 2017

Keywords

Comments

Initialized with a single black (ON) cell at stage zero.

References

  • S. Wolfram, A New Kind of Science, Wolfram Media, 2002; p. 170.

Crossrefs

Essentially the same as A153893, A083329, A055010, A052940, A266550.

Programs

  • Mathematica
    CAStep[rule_, a_] := Map[rule[[10 - #]] &, ListConvolve[{{0, 2, 0},{2, 1, 2}, {0, 2, 0}}, a, 2],{2}];
    code = 643; stages = 128;
    rule = IntegerDigits[code, 2, 10];
    g = 2 * stages + 1; (* Maximum size of grid *)
    a = PadLeft[{{1}}, {g, g}, 0,Floor[{g, g}/2]]; (* Initial ON cell on grid *)
    ca = a;
    ca = Table[ca = CAStep[rule, ca], {n, 1, stages + 1}];
    PrependTo[ca, a];
    (* Trim full grid to reflect growth by one cell at each stage *)
    k = (Length[ca[[1]]] + 1)/2;
    ca = Table[Table[Part[ca[[n]] [[j]],Range[k + 1 - n, k - 1 + n]], {j, k + 1 - n, k - 1 + n}], {n, 1, k}];
    Table[FromDigits[Part[ca[[i]] [[i]], Range[i, 2 * i - 1]], 10], {i, 1, stages - 1}]

Formula

For n>1, a(n) = 3*2^(n-1)-1.
a(n) = A266550(n+2) for n > 1. - Georg Fischer, Oct 30 2018
a(n) = 2*a(n-1) + 1 for n=1 and n>=3. - Gennady Eremin, Aug 26 2023
From Chai Wah Wu, Apr 02 2024: (Start)
a(n) = 3*a(n-1) - 2*a(n-2) for n > 3.
G.f.: (2*x^3 - 2*x^2 + 1)/((x - 1)*(2*x - 1)). (End)

A191664 Dispersion of A014601 (numbers >2, congruent to 0 or 3 mod 4), by antidiagonals.

Original entry on oeis.org

1, 3, 2, 7, 4, 5, 15, 8, 11, 6, 31, 16, 23, 12, 9, 63, 32, 47, 24, 19, 10, 127, 64, 95, 48, 39, 20, 13, 255, 128, 191, 96, 79, 40, 27, 14, 511, 256, 383, 192, 159, 80, 55, 28, 17, 1023, 512, 767, 384, 319, 160, 111, 56, 35, 18, 2047, 1024, 1535, 768, 639
Offset: 1

Views

Author

Clark Kimberling, Jun 11 2011

Keywords

Comments

Row 1: A000225 (-1+2^n)
Row 2: A000079 (2^n)
Row 3: A055010
Row 4: 3*A000079
Row 5: A153894
Row 6: 5*A000079
Row 7: A086224
Row 8: A005009
Row 9: A052996
For a background discussion of dispersions, see A191426.
...
Each of the sequences (4n, n>2), (4n+1, n>0), (3n+2, n>=0), generates a dispersion. Each complement (beginning with its first term >1) also generates a dispersion. The six sequences and dispersions are listed here:
...
A191663=dispersion of A042948 (0 or 1 mod 4 and >1)
A054582=dispersion of A005843 (0 or 2 mod 4 and >1; evens)
A191664=dispersion of A014601 (0 or 3 mod 4 and >1)
A191665=dispersion of A042963 (1 or 2 mod 4 and >1)
A191448=dispersion of A005408 (1 or 3 mod 4 and >1, odds)
A191666=dispersion of A042964 (2 or 3 mod 4)
...
EXCEPT for at most 2 initial terms (so that column 1 always starts with 1):
A191663 has 1st col A042964, all else A042948
A054582 has 1st col A005408, all else A005843
A191664 has 1st col A042963, all else A014601
A191665 has 1st col A014601, all else A042963
A191448 has 1st col A005843, all else A005408
A191666 has 1st col A042948, all else A042964
...
There is a formula for sequences of the type "(a or b mod m)", (as in the Mathematica program below):
If f(n)=(n mod 2), then (a,b,a,b,a,b,...) is given by
a*f(n+1)+b*f(n), so that "(a or b mod m)" is given by
a*f(n+1)+b*f(n)+m*floor((n-1)/2)), for n>=1.
This sequence is a permutation of the natural numbers. - L. Edson Jeffery, Aug 13 2014

Examples

			Northwest corner:
1...3...7....15...31
2...4...8....16...32
5...11..23...47...95
6...12..24...48...96
9...19..39...79...159
		

Crossrefs

Programs

  • Mathematica
    (* Program generates the dispersion array T of the increasing sequence f[n] *)
    r = 40; r1 = 12;  c = 40; c1 = 12;
    a = 3; b = 4; m[n_] := If[Mod[n, 2] == 0, 1, 0];
    f[n_] := a*m[n + 1] + b*m[n] + 4*Floor[(n - 1)/2]
    Table[f[n], {n, 1, 30}]  (* A014601(n+2): (4+4k,5+4k) *)
    mex[list_] := NestWhile[#1 + 1 &, 1, Union[list][[#1]] <= #1 &, 1, Length[Union[list]]]
    rows = {NestList[f, 1, c]};
    Do[rows = Append[rows, NestList[f, mex[Flatten[rows]], r]], {r}];
    t[i_, j_] := rows[[i, j]];
    TableForm[Table[t[i, j], {i, 1, 10}, {j, 1, 10}]] (* A191664 *)
    Flatten[Table[t[k, n - k + 1], {n, 1, c1}, {k, 1, n}]] (* A191664  *)
    (* Clark Kimberling, Jun 11 2011 *)
    Grid[Table[2^k*(2*Floor[(n + 1)/2] - 1) - Mod[n, 2], {n, 12}, {k, 12}]] (* L. Edson Jeffery, Aug 13 2014 *)

A196168 In binary representation of n: replace each 0 with 1, and each 1 with 10.

Original entry on oeis.org

1, 2, 5, 10, 11, 22, 21, 42, 23, 46, 45, 90, 43, 86, 85, 170, 47, 94, 93, 186, 91, 182, 181, 362, 87, 174, 173, 346, 171, 342, 341, 682, 95, 190, 189, 378, 187, 374, 373, 746, 183, 366, 365, 730, 363, 726, 725, 1450, 175, 350, 349, 698, 347, 694, 693, 1386
Offset: 0

Views

Author

Reinhard Zumkeller, Oct 28 2011

Keywords

Comments

All terms are numbers with no two adjacent zeros in binary representation, cf. A003754;
a(odd) = even and a(even) = odd;
A023416(a(n)) <= A000120(a(n)), equality iff n = 2^k - 1 for k > 0;
A055010(n+1) = A196168(A000079(n));
A000120(a(n)) = A070939(n);
A023416(a(n)) = A000120(n);
A070939(a(n)) = A070939(n) + A000120(n).

Examples

			n =  7 ->  111 ->  101010 ->  a(7) = 42;
n =  8 -> 1000 ->   10111 ->  a(8) = 23;
n =  9 -> 1001 ->  101110 ->  a(9) = 46;
n = 10 -> 1010 ->  101101 -> a(10) = 45;
n = 11 -> 1011 -> 1011010 -> a(11) = 90;
n = 12 -> 1100 ->  101011 -> a(12) = 43.
		

Crossrefs

Programs

  • Haskell
    import Data.List (unfoldr)
    a196168 0 = 1
    a196168 n = foldl (\v b -> (2 * v + 1)*(b + 1)) 0 $ reverse $ unfoldr
       (\x -> if x == 0 then Nothing else Just $ swap $ divMod x 2) n
       where r v b = (2 * v + 1)*(b+1)
    
  • Mathematica
    Table[FromDigits[Flatten[IntegerDigits[n,2]/.{{0->1,1->{1,0}}}],2],{n,0,120}] (* Harvey P. Dale, Dec 12 2017 *)
  • Python
    def a(n):
        b = bin(n)[2:]
        return int(b.replace('1', 't').replace('0', '1').replace('t', '10'), 2)
    print([a(n) for n in range(56)]) # Michael S. Branicky, Oct 28 2021

Formula

n = Sum_{i=0..1} b(i)*2^i with 0 <= b(i) <= 1, L >= 0, then a(n) = h(0,L) with h(v,i) = if i > L then v, otherwise h((2*v+1)*(b(i)+1),i-1).
From Jeffrey Shallit, Oct 28 2021: (Start)
a(n) satisfies the recurrences:
a(2n+1) = 2*a(2n)
a(4n) = -2*a(n) + 3*a(2n)
a(8n+2) = -8*a(n) + 8*a(2n) + a(4n+2)
a(8n+6) = -4*a(2n) + 5*a(4n+2)
which shows that a(n) is a 2-regular sequence. (End)

A099258 Inverse of A099257.

Original entry on oeis.org

1, 3, 2, 4, 6, 7, 8, 9, 5, 10, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 11, 22, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 23, 46, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73
Offset: 1

Views

Author

Reinhard Zumkeller, Oct 09 2004

Keywords

Comments

Permutation of the natural numbers;
a(A033484(n)) = A033484(n);
a(A033484(n) - 1) = A033484(n)/2 = A055010(n).

Formula

a(n) = if n = 3*2^k - 2 then n else (if n = 3*2^k - 3 then (n + 1)/2 else n + 1).

A266550 Independence number of the n-Mycielski graph.

Original entry on oeis.org

1, 1, 2, 5, 11, 23, 47, 95, 191, 383, 767, 1535, 3071, 6143, 12287, 24575, 49151, 98303, 196607, 393215, 786431, 1572863, 3145727, 6291455, 12582911, 25165823, 50331647, 100663295, 201326591, 402653183, 805306367, 1610612735, 3221225471, 6442450943, 12884901887
Offset: 1

Views

Author

Eric W. Weisstein, Dec 31 2015

Keywords

Crossrefs

Programs

  • Magma
    [1,1] cat [-1+3*2^(n-3): n in [3..40]]; // Vincenzo Librandi, Jan 01 2016
    
  • Magma
    I:=[1,1,2,5]; [n le 4 select I[n] else 3*Self(n-1)-2*Self(n-2): n in [1..40]]; // Vincenzo Librandi, Jan 01 2016
  • Mathematica
    Table[Piecewise[{{-1 + 3 2^(n - 3), n > 2}}, 1], {n, 35}]
    CoefficientList[Series[1 + x*(1 - x + x^2)/((1 - x)*(1 - 2*x)), {x, 0, 35}], x] (* Vincenzo Librandi, Jan 01 2016 *)

Formula

a(1) = 1, a(2) = 1; for n>2, a(n) = -1 + 3*2^(n-3) = A083329(n-2) = A055010(n-2) = A153893(n-3).
G.f.: x + x^2*(1 - x + x^2)/((1 - x)*(1 - 2*x)).
a(n) = 3*a(n-1)-2*a(n-2) for n>2. - Vincenzo Librandi, Jan 01 2016
a(n) = A052940(n-3) for n > 3. - Georg Fischer, Oct 23 2018
E.g.f.: (3*exp(2*x) - 8*exp(x) + 5 + 10*x+ 2*x^2)/8. - Stefano Spezia, Sep 14 2024

A332997 a(n) = A000120(A332995(n)).

Original entry on oeis.org

0, 1, 1, 1, 1, 2, 1, 2, 1, 1, 2, 3, 1, 1, 2, 2, 1, 2, 1, 2, 2, 2, 3, 4, 1, 2, 1, 1, 2, 3, 2, 3, 1, 1, 2, 3, 1, 1, 2, 2, 2, 3, 2, 3, 3, 3, 4, 5, 1, 1, 2, 2, 1, 2, 1, 1, 2, 2, 3, 4, 2, 2, 3, 3, 1, 2, 1, 2, 2, 2, 3, 4, 1, 2, 1, 1, 2, 3, 2, 3, 2, 2, 3, 4, 2, 2, 3, 3, 3, 4, 3, 4, 4, 4, 5, 6, 1, 2, 1, 1, 2, 3, 2, 3, 1, 1
Offset: 0

Views

Author

Antti Karttunen, Mar 05 2020

Keywords

Comments

It seems that a(A055010(n)) = n for all n >= 0, and apart from n=1, A055010 seems to give the first occurrence of each n in this sequence.

Crossrefs

Programs

Formula

a(n) = A000120(A332995(n)) = A332897(A332817(n)).
a(n) = A000120(n) - A332998(n).

A086652 a(n) = A000225(n+3)-A052955(n).

Original entry on oeis.org

6, 13, 28, 58, 120, 244, 496, 1000, 2016, 4048, 8128, 16288, 32640, 65344, 130816, 261760, 523776, 1047808, 2096128, 4192768, 8386560, 16774144, 33550336, 67102720, 134209536, 268423168, 536854528, 1073717248, 2147450880
Offset: 0

Views

Author

Marco Matosic, Jul 27 2003

Keywords

Crossrefs

Programs

  • Maple
    f:=n->2^(n+3)-((5-(-1)^n)/2)*2^((2*n-1+(-1)^n)/4);

Formula

a(2n) = A006516(n+2); a(2n+1) = A086221(n+1).
G.f.: ( 6+x-10*x^2 ) / ( (2*x-1)*(2*x^2-1) ). - R. J. Mathar, Sep 15 2012
a(n) = 2^(n+3)-((5-(-1)^n)/2)*2^((2*n-1+(-1)^n)/4). - Luce ETIENNE, Sep 23 2014

Extensions

Edited and extended by David Wasserman, Feb 17 2005
Previous Showing 21-30 of 42 results. Next