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 31-40 of 60 results. Next

A191666 Dispersion of A042964 (numbers congruent to 2 or 3 mod 4), by antidiagonals.

Original entry on oeis.org

1, 2, 4, 3, 7, 5, 6, 14, 10, 8, 11, 27, 19, 15, 9, 22, 54, 38, 30, 18, 12, 43, 107, 75, 59, 35, 23, 13, 86, 214, 150, 118, 70, 46, 26, 16, 171, 427, 299, 235, 139, 91, 51, 31, 17, 342, 854, 598, 470, 278, 182, 102, 62, 34, 20, 683, 1707, 1195, 939, 555, 363
Offset: 1

Views

Author

Clark Kimberling, Jun 11 2011

Keywords

Comments

Row 1: A005578
Row 2: A160113
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.

Examples

			Northwest corner:
1...2...3....6...11
4...7...14....27...54
5...10...19...38...75
8...15..30...59...118
8...18..35...70...139
		

Crossrefs

Programs

  • Mathematica
    (* Program generates the dispersion array T of the increasing sequence f[n] *)
    r = 40; r1 = 12;  c = 40; c1 = 12;
    a = 2; b = 3; 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}]  (* A042964: (2+4k,3+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}]] (* A191666 *)
    Flatten[Table[t[k, n - k + 1], {n, 1, c1}, {k, 1, n}]] (* A191666  *)

A213526 a(n) = 3*n AND n, where AND is the bitwise AND operator.

Original entry on oeis.org

0, 1, 2, 1, 4, 5, 2, 5, 8, 9, 10, 1, 4, 5, 10, 13, 16, 17, 18, 17, 20, 21, 2, 5, 8, 9, 10, 17, 20, 21, 26, 29, 32, 33, 34, 33, 36, 37, 34, 37, 40, 41, 42, 1, 4, 5, 10, 13, 16, 17, 18, 17, 20, 21, 34, 37, 40, 41, 42, 49, 52, 53, 58, 61, 64, 65, 66, 65, 68
Offset: 0

Views

Author

Alex Ratushnyak, Jun 13 2012

Keywords

Comments

Indices of 1's: A007583(n),
indices of 2's: A047849(n+1),
indices of 4's: A039301(n+2),
indices of 5's: A153643(n+3),
indices of 8's: A155701(n+2),
indices of 9's: A155701(n+2)+1 = A163868(n+2),
indices of 10's: A153643(n+4)+3^((n+1) mod 2),
indices of 13's: A039301(n+3)+3,
indices of 16's: A039301(n+3)+4,
indices of 17's: 17, 19, 27, 49, 51, 91, 177, 179, 347, 689, 691, 1371, 2737, 2739, 5467, 10929, 10931, 21851, 43697, 43699, 87387, 174769, 174771, 349531, 699057, 699059, 1398107, 2796209, 2796211, 5592411, 11184817, 11184819, 22369627, 44739249, 44739251, 89478491, ...
indices of 18's: A039301(n+3)+6,
n's such that a(n)<3: A005578, except the first term.

Programs

  • Maple
    a:= proc(n) local i, k, m, r;
          k, m, r:= n, 3*n, 0;
          for i from 0 while (m>0 or k>0) do
            r:= r +2^i* irem(m, 2, 'm') *irem(k, 2, 'k')
          od; r
        end:
    seq(a(n), n=0..100);  # Alois P. Heinz, Jun 22 2012
  • Mathematica
    Table[BitAnd[n, 3*n], {n, 0, 68}] (* Arkadiusz Wesolowski, Jun 23 2012 *)
  • PARI
    a(n)=bitand(n,3*n) \\ Charles R Greathouse IV, Feb 05 2013
  • Python
    for n in range(99):
        print(3*n & n, end=',')
    

A241684 The total number of rectangles appearing in the Thue-Morse sequence logical matrices after n stages.

Original entry on oeis.org

0, 0, 4, 8, 32, 120, 464, 1848, 7312, 29240, 116624, 466488, 1864592, 7458360, 29827984, 119311928, 477225872, 1908903480, 7635526544, 30542106168, 122168075152, 488672300600, 1954687804304, 7818751217208, 31274999276432, 125099997105720, 500399966053264, 2001599864213048
Offset: 0

Views

Author

Kival Ngaokrajang, Apr 27 2014

Keywords

Comments

a(n) is the total number of non-isolated "1s" (consecutive 1s on 2 rows, 1 column or 1 row, 2 columns) that appear as rectangles in the Thue-Morse logical matrices after n stages. See links for more details.

Crossrefs

Cf. A010060.

Programs

  • Magma
    [(8+3*2^n+2*4^n+(-1)^n*(24-2^n))/18: n in [0..30]]; // Vincenzo Librandi, Sep 29 2017
  • Mathematica
    CoefficientList[Series[-4*x^2*(8*x^3 - 5*x^2 - 2*x + 1)/((x - 1)*(x + 1)*(2*x - 1)*(2*x + 1)*(4*x - 1)), {x, 0, 50}], x] (* G. C. Greubel, Sep 28 2017 *)
  • PARI
    x='x+O('x^50); concat([0,0], Vec(-4*x^2*(8*x^3-5*x^2-2*x+1)/((x-1)*(x+1)*(2*x-1)*(2*x+1)*(4*x-1)))) \\ G. C. Greubel, Sep 28 2017
    

Formula

a(n) = A007590(A005578(n+1)) - (A139598(A000975(n-2)) + A007590(A000975(n-1))).
G.f.: -4*x^2*(8*x^3-5*x^2-2*x+1) / ((x-1)*(x+1)*(2*x-1)*(2*x+1)*(4*x-1)). - Colin Barker, Apr 27 2014
a(n) = (8 + 3*2^n + 2*4^n + (-1)^n*(24 - 2^n))/18, n>0. - R. J. Mathar, May 04 2014

Extensions

Terms a(21) onward added by G. C. Greubel, Sep 28 2017

A085281 Expansion of (1 - 3*x + x^2)/((1-2*x)*(1-3*x)).

Original entry on oeis.org

1, 2, 5, 13, 35, 97, 275, 793, 2315, 6817, 20195, 60073, 179195, 535537, 1602515, 4799353, 14381675, 43112257, 129271235, 387682633, 1162785755, 3487832977, 10462450355, 31385253913, 94151567435, 282446313697, 847322163875, 2541932937193, 7625731702715, 22877060890417, 68630914235795, 205892205836473
Offset: 0

Views

Author

Paul Barry, Jun 25 2003

Keywords

Comments

Binomial transform of A005578.
Binomial transform is A085282.

Crossrefs

Programs

  • Magma
    [3^n/3+2^n/2+0^n/6: n in [0..40]]; // Vincenzo Librandi, May 29 2011
    
  • Mathematica
    a[n_]:=3^n/3 + 2^n/2; Flatten[Join[{1, Array[a, 50]}]] (* or *)
    CoefficientList[Series[(1 - 3*x + x^2)/((1-2*x)*(1-3*x)), {x, 0, 50}], x] (* Stefano Spezia, Sep 09 2018 *)
    LinearRecurrence[{5,-6},{1,2,5},40] (* Harvey P. Dale, Jun 14 2022 *)
  • SageMath
    def A085281(n): return 2^(n-1) +3^(n-1) +int(n==0)/6
    [A085281(n) for n in range(41)] # G. C. Greubel, Nov 11 2024

Formula

a(n) = 3^(n-1) + 2^(n-1) + 0^n/6.
a(n) = A007689(n-1), n > 0. - R. J. Mathar, Sep 12 2008
E.g.f.: (1/6)*(1 + 3*exp(2*x) + 2*exp(3*x)). - G. C. Greubel, Nov 11 2024

A107910 A107909(n+1) - A107909(n).

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 2, 1, 1, 1, 3, 1, 2, 1, 1, 1, 1, 1, 2, 1, 3, 1, 1, 1, 2, 1, 1, 6, 1, 1, 3, 1, 2, 1, 1, 1, 1, 1, 2, 1, 3, 1, 1, 6, 1, 1, 2, 1, 1, 1, 3, 1, 2, 1, 1, 11, 1, 2, 1, 1, 6, 1, 1, 3, 1, 2, 1, 1, 1, 1, 1, 2, 1, 3, 1, 1, 6, 1, 1, 2, 1, 11, 1, 1, 2, 1, 3, 1, 1, 1, 2, 1, 1, 6
Offset: 0

Views

Author

Reinhard Zumkeller, May 28 2005

Keywords

Comments

For n>0 A005578 gives record-values: a(A023548(n+2))=A005578(n), a(m) < A005578(n) for m < A023548(n).

A166692 Triangle T(n,k) read by rows: T(n,k) = 2^(k-1), k>0, T(n,0) = (n+1) mod 2.

Original entry on oeis.org

1, 0, 1, 1, 1, 2, 0, 1, 2, 4, 1, 1, 2, 4, 8, 0, 1, 2, 4, 8, 16, 1, 1, 2, 4, 8, 16, 32, 0, 1, 2, 4, 8, 16, 32, 64, 1, 1, 2, 4, 8, 16, 32, 64, 128, 0, 1, 2, 4, 8, 16, 32, 64, 128, 256, 1, 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 0, 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024
Offset: 0

Views

Author

Paul Curtz, Oct 18 2009

Keywords

Comments

Variant of A166918.

Examples

			Triangle begins as:
  1;
  0, 1;
  1, 1, 2;
  0, 1, 2, 4;
  1, 1, 2, 4, 8;
  0, 1, 2, 4, 8, 16;
		

Crossrefs

Programs

  • Magma
    A166692:= func< n,k | k eq 0 select ((n+1) mod 2) else 2^(k-1) >;
    [A166692(n,k): k in [0..n], n in [0..15]]; // G. C. Greubel, Apr 24 2023
    
  • Mathematica
    Join[{1,0},Flatten[Riffle[Table[2^Range[0,n],{n,0,10}],{1,0}]]] (* Harvey P. Dale, Jan 18 2015 *)
  • SageMath
    def A166692(n,k): return ((n+1)%2) if (k==0) else 2^(k-1)
    flatten([[A166692(n,k) for k in range(n+1)] for n in range(16)]) # G. C. Greubel, Apr 24 2023

Formula

T(2n, k) = A011782(k).
T(2n+1, k) = A131577(k).
Sum_{k=0..n} T(n,k) = A051049(n).
From G. C. Greubel, Apr 24 2023: (Start)
T(2*n, n) = A011782(n).
Sum_{k=0..n} (-1)^k*T(n, k) = (-1)^n * A005578(n).
Sum_{k=0..n} T(n-k, k) = A106624(n). (End)

Extensions

More terms from Harvey P. Dale, Jan 18 2015

A178746 Binary counter with intermittent bits. Starting at zero the counter attempts to increment by 1 at each step but each bit in the counter alternately accepts and rejects requests to toggle.

Original entry on oeis.org

0, 1, 3, 6, 6, 7, 13, 12, 12, 13, 15, 26, 26, 27, 25, 24, 24, 25, 27, 30, 30, 31, 53, 52, 52, 53, 55, 50, 50, 51, 49, 48, 48, 49, 51, 54, 54, 55, 61, 60, 60, 61, 63, 106, 106, 107, 105, 104
Offset: 0

Views

Author

David Scambler, Jun 08 2010

Keywords

Comments

A simple scatter plot reveals a self-similar structure that resembles flying geese.
Ignoring the initial zero term, split the sequence into rows of increasing binary magnitude such that the terms in row m satisfy 2^m <= a(n) < 2^(m+1).
0: 1,
1: 3,
2: 6,6,7,
3: 13,12,12,13,15,
4: 26,26,27,25,24,24,25,27,30,30,31,
5: 53,52,52,53,55,50,50,51,49,48,48,49,51,54,54,55,61,60,60,61,63,
Then,
Row m starts at n = A005578(m+1) in the original sequence
The first term in row m is A081254(m)
The last term in row m is 2^(m+1)-1
The number of terms in row m is A001045(m+1)
The number of distinct terms in row m is A005578(m)
The number of ascending runs in row m is A005578(m)
The number of non-ascending runs in row m is A005578(m)
The number of descending runs in row m is A052950(m)
The number of non-descending runs in row m is A005578(m-1)
The sum of terms in row m is A178747(m)
The total number of '1' bits in the terms of row n is A178748(m)

Examples

			0 -> low bit toggles -> 1 -> should be 2 but low bit does not toggle -> 3 -> should be 4 but 2nd-lowest bit does not toggle -> 6 -> should be 7 but low bit does not toggle -> 6 -> low bit toggles -> 7
		

Crossrefs

Cf. A178747 sum of terms in rows of a(n), A178748 total number of '1' bits in the terms of rows of a(n).

Programs

  • PARI
    seq(n)={my(a=vector(n+1), f=0, p=0); for(i=2, #a, my(b=bitxor(p+1,p)); f=bitxor(f,b); p=bitxor(p, bitand(b,f)); a[i]=p); a} \\ Andrew Howroyd, Mar 03 2020

Formula

If n is a power of 2, a(n) = n*3/2. Lim(a(n)/n) = 3/2.

A214613 Abelian complexity function of ordinary paperfolding word (A014707).

Original entry on oeis.org

2, 3, 4, 3, 4, 5, 4, 3, 4, 5, 6, 5, 4, 5, 4, 3, 4, 5, 6, 5, 6, 7, 6, 5, 6, 5, 6, 5, 6, 5, 4, 3, 4, 5, 6, 5, 6, 7, 6, 5, 6, 7, 8, 7, 6, 7, 6, 5, 6, 7, 6, 5, 6, 7, 6, 5, 6, 7, 6, 5, 6, 5, 4, 3, 4, 5, 6, 5, 6, 7, 6, 5, 6, 7, 8, 7, 6, 7, 6, 5, 6, 7
Offset: 1

Views

Author

N. J. A. Sloane, Mar 08 2013

Keywords

Comments

k first appears at position A005578(k-1). - Charlie Neder, Mar 03 2019

Crossrefs

Formula

From Charlie Neder, Mar 03 2019 [Corrected by Kevin Ryde, Sep 05 2020]: (Start)
Madill and Rampersad provide the following recurrence:
a(1) = 2,
a(4n) = a(2n),
a(4n+2) = a(2n+1) + 1,
a(16n+1) = a(8n+1),
a(16n+{3,7,9,13}) = a(2n+1) + 2,
a(16n+5) = a(4n+1) + 2,
a(16n+11) = a(4n+3) + 2,
a(16n+15) = a(2n+2) + 1. (End)

Extensions

a(21)-a(82) from Charlie Neder, Mar 03 2019

A241685 The total number of squares and rectangles appearing in the Thue-Morse sequence logical matrices after n stages.

Original entry on oeis.org

0, 2, 4, 18, 60, 242, 924, 3698, 14620, 58482, 233244, 932978, 3729180, 14916722, 59655964, 238623858, 954451740, 3817806962, 15271053084, 61084212338, 244336150300, 977344601202, 3909375608604
Offset: 0

Views

Author

Kival Ngaokrajang, Apr 27 2014

Keywords

Comments

a(n) is the total number of unit squares (A241682), 2 X 2 squares (A241683), 2 X 1 and 1 X 2 rectangles (A241684) that appear in the Thue-Morse logical matrices after n stages. See links for more details.

Crossrefs

Cf. A010060.

Programs

  • Mathematica
    Table[Floor[(2^(n + 2) + 3 - (-1)^n)^2/72], {n, 0, 50}] (* G. C. Greubel, Sep 29 2017 *)
  • PARI
    {for (n=1,50, b=(2^(n+1)+3+(-1)^n)/6; a=floor(b^2/2); print1(a,","))}

Formula

a(n) = A007590(A005578(n+1)).
Empirical g.f.: -2*x*(4*x^3-4*x^2-2*x+1) / ((x-1)*(x+1)*(2*x-1)*(2*x+1)*(4*x-1)). - Colin Barker, Apr 27 2014
a(n) = floor((2^(n + 2) + 3 - (-1)^n)^2/72). - G. C. Greubel, Sep 29 2017

A135229 Triangle A000012(signed) * A103451 * A007318, read by rows.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 2, 2, 1, 1, 2, 4, 3, 1, 1, 3, 6, 7, 4, 1, 1, 3, 9, 13, 11, 5, 1, 1, 4, 12, 22, 24, 16, 6, 1, 1, 4, 16, 34, 46, 40, 22, 7, 1, 1, 5, 20, 50, 80, 86, 62, 29, 8, 1
Offset: 0

Views

Author

Gary W. Adamson, Nov 23 2007

Keywords

Comments

row sums = A005578 starting (1, 2, 3, 6, 11, 22, 43, 86, ...).

Examples

			First few rows of the triangle are:
  1;
  1, 1;
  1, 1,  1;
  1, 2,  2,  1;
  1, 2,  4,  3,  1;
  1, 3,  6,  7,  4,  1;
  1, 3,  9, 13, 11,  5,  1;
  1, 4, 12, 22, 24, 16,  6, 1;
  1, 4, 16, 34, 46, 40, 22, 7, 1;
...
		

Crossrefs

Programs

  • Magma
    function T(n,k)
      if k eq 0 then return 1;
      else return (&+[Binomial(n-2*j-1, k-1): j in [0..Floor((n-1)/2)]]);
      end if; return T; end function;
    [T(n,k): k in [0..n], n in [0..12]]; // G. C. Greubel, Nov 20 2019
    
  • Maple
    T:= proc(n, k) option remember;
          if k=0 then 1
        else add(binomial(n-2*j-1, k-1), j=0..floor((n-1)/2))
          fi; end:
    seq(seq(T(n, k), k=0..n), n=0..12); # G. C. Greubel, Nov 20 2019
  • Mathematica
    T[n_, k_]:= T[n, k]= If[k==0, 1, Sum[Binomial[n-1-2*j, k-1], {j, 0, Floor[(n-1)/2]}]]; Table[T[n, k], {n,0,12}, {k,0,n}]//Flatten (* G. C. Greubel, Nov 20 2019 *)
  • PARI
    T(n,k) = if(k==0, 1, sum(j=0, (n-1)\2, binomial( n-2*j-1, k-1)) ); \\ G. C. Greubel, Nov 20 2019
    
  • Sage
    @CachedFunction
    def T(n, k):
        if (k==0): 1
        else: return sum(binomial(n-2*j-1, k-1) for j in (0..floor((n-1)/2)))
    [[T(n, k) for k in (0..n)] for n in (0..12)] # G. C. Greubel, Nov 20 2019

Formula

T(n,k) = A000012(signed) * A103451 * A007318 as infinite lower triangular matrices, where A000012(signed) = (1; -1,1; 1,-1,1; ...).
T(n,k) = Sum_{j=0..floor((n-1)/2)} binomial(n-2*j-1, k-1), with T(n,0) = 1. - G. C. Greubel, Nov 20 2019

Extensions

Offset changed by G. C. Greubel, Nov 20 2019
Previous Showing 31-40 of 60 results. Next