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

A115361 Inverse of matrix (1,x)-(x,x^2) (expressed in Riordan array notation).

Original entry on oeis.org

1, 1, 1, 0, 0, 1, 1, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1
Offset: 0

Views

Author

Paul Barry, Jan 21 2006

Keywords

Comments

Row sums are the 'ruler function' A001511. Columns are stretched Fredholm-Rueppel sequences (A036987). Inverse is A115359.
Eigensequence of triangle A115361 = A018819 starting with offset 1: (1, 2, 2, 4, 4, 6, 6, 10, 10, 14, 14, 20, 20, ...). - Gary W. Adamson, Nov 21 2009
From Gary W. Adamson, Nov 27 2009: (Start)
A115361 * [1, 2, 3, ...] = A129527 = (1, 3, 3, 7, 5, 9, 7, 15, ...).
(A115361)^(-1) * [1, 2, 3, ...] = A115359 * [1, 2, 3, ...] = A026741 starting /Q (1, 1, 3, 2, 5, 3, 7, 4, 9, ...). (End)
This is the lower-left triangular part of the inverse of the infinite matrix A_{ij} = [i=j] - [i=2j], its upper-right part (above / right to the diagonal) being zero. The n-th row has 1 in column n/2^i, i = 0, 1, ... as long as this is an integer. - M. F. Hasler, May 13 2018
The rows are the reversed binary expansions of A127804. - Tilman Piesk, Jun 10 2025

Examples

			Triangle begins:
  1;
  1,1;
  0,0,1;
  1,1,0,1;
  0,0,0,0,1;
  0,0,1,0,0,1;
  0,0,0,0,0,0,1;
  1,1,0,1,0,0,0,1;
  0,0,0,0,0,0,0,0,1;
  0,0,0,0,1,0,0,0,0,1;
  0,0,0,0,0,0,0,0,0,0,1;
		

Crossrefs

Programs

  • Maple
    A115361 := proc(n,k)
        for j from 0 do
            if k+(2*j-1)*(k+1) > n then
                return 0 ;
            elif k+(2^j-1)*(k+1) = n then
                return 1 ;
            end if;
        end do;
    end proc: # R. J. Mathar, Jul 14 2012
  • Mathematica
    (*recurrence*)
    Clear[t]
    t[1, 1] = 1;
    t[n_, k_] :=
    t[n, k] =
      If[k == 1, Sum[t[n, k + i], {i, 1, 2 - 1}],
       If[Mod[n, k] == 0, t[n/k, 1], 0], 0]
    Flatten[Table[Table[t[n, k], {k, 1, n}], {n, 14}]] (* Mats Granvik, Jun 26 2014 *)
  • PARI
    tabl(nn) = {T = matrix(nn, nn, n, k, n--; k--; if ((n==k), 1, if (n==2*k+1, -1, 0))); Ti = T^(-1); for (n=1, nn, for (k=1, n, print1(Ti[n, k], ", ");); print(););} \\ Michel Marcus, Mar 28 2015
    
  • PARI
    A115361_row(n,v=vector(n))={until(bittest(n,0)||!n\=2,v[n]=1);v} \\ Yields the n-th row (of length n). - M. F. Hasler, May 13 2018
    
  • PARI
    T(n,k)={if(n%k, 0, my(e=valuation(n/k,2)); n/k==1<Andrew Howroyd, Aug 03 2018
    
  • Python
    # translation of Maple code by R. J. Mathar
    def a115361(n, k):
        j = 0
        while True:
            if k + (2*j - 1) * (k + 1) > n:
                return 0
            elif k + (2**j - 1) * (k + 1) == n:
                return 1
            else:
                j += 1  #  Tilman Piesk, Jun 10 2025

Formula

Number triangle whose k-th column has g.f. x^k*sum{j>=0} x^((2^j-1)*(k+1)).
T(n,k) = A209229((n+1)/(k+1)) for k+1 divides n+1, T(n,k) = 0 otherwise. - Andrew Howroyd, Aug 05 2018

A045654 Number of 2n-bead balanced binary strings, rotationally equivalent to complement.

Original entry on oeis.org

1, 2, 6, 8, 22, 32, 72, 128, 278, 512, 1056, 2048, 4168, 8192, 16512, 32768, 65814, 131072, 262656, 524288, 1049632, 2097152, 4196352, 8388608, 16781384, 33554432, 67117056, 134217728, 268451968, 536870912, 1073774592, 2147483648, 4295033110, 8589934592
Offset: 0

Views

Author

Keywords

Examples

			From _Andrew Howroyd_, Jul 06 2025: (Start)
The a(1) = 2 length 2 balanced binary strings are: 01, 10.
The a(2) = 6 strings are: 0101, 1010, 0011, 0110, 1100, 1001.
The a(3) = 8 strings are: 010101, 101010, 000111, 001110, 011100, 111000, 110001, 100011. (End)
		

Crossrefs

Programs

  • Maple
    a:= proc(n) option remember;
          2^n+`if`(n::even and n>0, a(n/2), 0)
        end:
    seq(a(n), n=0..33);  # Alois P. Heinz, Jul 01 2025
  • PARI
    a(n)={if(n==0, 1, my(s=0); while(n%2==0, s+=2^n; n/=2); s + 2^n)} \\ Andrew Howroyd, Sep 22 2019
    
  • Python
    def A045654(n): return sum(1<<(n>>k) for k in range((~n & n-1).bit_length()+1)) if n else 1 # Chai Wah Wu, Jul 22 2024

Formula

a(0)=1, a(2n) = a(n)+2^(2n), a(2n+1) = 2^(2n+1). - Ralf Stephan, Jun 07 2003
G.f.: 1/(1-x) + sum(k>=0, t(1+2t-2t^2)/(1-t^2)/(1-2t), t=x^2^k). - Ralf Stephan, Aug 30 2003
For n >= 1, a(n) = Sum_{k=0..A007814(n)} 2^(n/2^k). - David W. Wilson, Jan 01 2012
Inverse Moebius transform of A045663. - Andrew Howroyd, Sep 15 2019
a(n) = 2*A127804(n-1) for n > 0. - Tilman Piesk, Jul 05 2025
a(n) = Sum_{k=1..n} 2 * n * A385665(n,k) / k. - Tilman Piesk, Jul 07 2025

A187767 Number of bicolored cyclic patterns n X n.

Original entry on oeis.org

0, 2, 3, 10, 15, 35, 63, 138, 255, 527, 1023, 2083, 4095, 8255, 16383, 32906, 65535, 131327, 262143, 524815, 1048575, 2098175, 4194303, 8390691, 16777215, 33558527, 67108863, 134225983, 268435455, 536887295, 1073741823, 2147516554, 4294967295, 8590000127, 17179869183
Offset: 1

Views

Author

Giovanni Resta, Jan 04 2013

Keywords

Comments

A bicolored cyclic pattern is a 0-1 n x n matrix where the j-th row is equal to the first row rotated to the left by (j-1)*k places, with 1 <= k <= n a parameter. For example, with first row = 0110 we have
.
. (k=1) 0 1 1 0 (k=2) 0 1 1 0 (k=3) 0 1 1 0 (k=4) 0 1 1 0
. 1 1 0 0 1 0 0 1 0 0 1 1 0 1 1 0
. 1 0 0 1 0 1 1 0 1 0 0 1 0 1 1 0
. 0 0 1 1 1 0 0 1 1 1 0 0 0 1 1 0
The (2^n-2)*n matrices so obtained are reduced considering equivalent those obtained exchanging 0's and 1's and those which produce the same pattern, apart translation.

Examples

			a(4)=10 is represented below. See Links for more examples.
. 1000 0100 0010 0001 0101 1010 1001 0110 1100 0011
. 0100 0001 0100 0001 0101 0101 1100 1100 0011 0011
. 0010 0100 1000 0001 0101 1010 0110 1001 1100 0011
. 0001 0001 0001 0001 0101 0101 0011 0011 0011 0011
		

Crossrefs

The number of patterns made of vertical stripes only is A056295(n).

Programs

  • Mathematica
    cyPatt[n_]:=Block[{b,c},c[v_,q_:1]:=Table[RotateLeft[v,i q],{i,n}]; b=Union[(First@Union[c@#,c[1-#]])& /@ IntegerDigits[Range[2^n/2-1], 2,n]]; Union@Flatten[Table[c[e,j],{j,n},{e,b}],1]];
    (*count*) a[n_] := Length@cyPatt@n; Print["Seq = ",a/@Range[12]];
    (*show*) showP[p_] := GraphicsGrid@Partition[ArrayPlot/@p,8,8,1,Null];
    showP[cyPatt[6]]
  • PARI
    b(n)=sumdiv(n,d,(d%2)*(moebius(d)*2^(n/d)))/(2*n);
    a(n)=sumdiv(n,d,d*b(d)) - 1; \\ Andrew Howroyd, Jun 02 2017

Formula

a(1) = 0; a(n) = 2^(n-1)-1 if n is odd, 2^(n-1)+a(n/2) if n is even (conjectured).
a(n) = -1 + Sum_{d|n} d*A000048(d). - Andrew Howroyd, Jun 02 2017

Extensions

a(22)-a(35) from Andrew Howroyd, Jun 02 2017

A011946 Number of Barlow packings with group P63/mmc(S) that repeat after 4n layers.

Original entry on oeis.org

1, 2, 3, 8, 15, 30, 63, 128, 252, 510, 1023, 2040, 4095, 8190, 16365, 32768, 65535, 131040, 262143, 524280, 1048509, 2097150, 4194303, 8388480, 16777200, 33554430, 67108608, 134217720, 268435455, 536870370, 1073741823, 2147483648, 4294966269, 8589934590
Offset: 1

Views

Author

Keywords

Comments

Conjecture: Mobius transform of A127804. - R. J. Mathar, Sep 14 2011
a(n) = n*A000048(n), where A000048(n) = number of n-bead necklaces with beads of 2 colors and primitive period n, when turning over is not allowed but the two colors can be interchanged. - Paul D. Hanna, Dec 21 2016

Examples

			G.f. = x + 2*x^2 + 3*x^3 + 8*x^4 + 15*x^5 + 30*x^6 + 63*x^7 + 128*x^8 + ...
		

Crossrefs

Cf. A195095 (same sequence).

Programs

  • Mathematica
    a[n_] := DivisorSum[n, MoebiusMu[#] * 2^(n/#-1) &, OddQ[#] &]; Array[a, 35] (* Amiram Eldar, Aug 29 2023 *)
  • PARI
    {a(n)=polcoeff(sum(m=1,n,-moebius(2*m)*x^m/(1-2*x^m+x*O(x^n))^1),n)}
    for(n=1,30,print1(a(n),", ")) \\ Paul D. Hanna, Sep 08 2011
    
  • PARI
    {a(n) =  sumdiv(n,d, if(d%2==1, moebius(d) * 2^(n/d-1) ) )}
    for(n=1,30,print1(a(n),", ")) \\ Paul D. Hanna, Sep 08 2011
  • Python
    a = lambda n: sum([sympy.mobius(d)*(2**(sympy.floor((2*n//d+1)/2)-1)) for d in sympy.divisors(n) if d%2==1])
    

Formula

From Paul D. Hanna, Sep 08 2011 (merged from duplicate A195095 Feb 06 2024): (Start)
G.f.: Sum_{n>=1} -moebius(2*n)*x^n/(1 - 2*x^n).
a(2^n) = 2^(2^n - 1).
a(p) = 2^(p-1) for odd prime p.
(End)
a(n) = floor(2^(n-1)/n)*n unless n=3k, k>4. - M. F. Hasler, Sep 08 2011
G.f.: Sum_{n>=1} moebius(2*n-1)*x^(2*n-1)/(1 - 2*x^(2*n-1)). - Mamuka Jibladze, Dec 04 2016
a(n) = Sum_{d|n, d odd} moebius(d) * 2^(n/d - 1), where moebius(n) = A008683(n). - Paul D. Hanna, Dec 21 2016, Bartosz Naskrecki, Jan 06 2024
Conjecture: a(n) = A045683(2n). - R. J. Mathar, Apr 15 2024

Extensions

More terms from Bartosz Naskrecki, Jan 06 2024

A127803 Inverse of number triangle A(n,k) = 1/(2*2^n-1) if k <= n <= 2k, 0 otherwise.

Original entry on oeis.org

1, 0, 3, 0, -3, 7, 0, 3, -7, 15, 0, 0, 0, -15, 31, 0, -3, 7, 0, -31, 63, 0, 0, 0, 0, 0, -63, 127, 0, 3, -7, 15, 0, 0, -127, 255, 0, 0, 0, 0, 0, 0, 0, -255, 511, 0, 0, 0, -15, 31, 0, 0, 0, -511, 1023, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1023, 2047
Offset: 0

Views

Author

Paul Barry, Jan 29 2007

Keywords

Comments

Row sums are A127804.

Examples

			Triangle begins
  1;
  0,  3;
  0, -3,  7;
  0,  3, -7,  15;
  0,  0,  0, -15,  31;
  0, -3,  7,   0, -31,  63;
  0,  0,  0,   0,   0, -63,  127;
  0,  3, -7,  15,   0,   0, -127,  255;
  0,  0,  0,   0,   0,   0,    0, -255,  511;
  0,  0,  0, -15,  31,   0,    0,    0, -511,  1023;
  0,  0,  0,   0,   0,   0,    0,    0,    0, -1023, 2047;
  ...
Inverse of
  1;
  0, 1/3;
  0, 1/7, 1/7;
  0,  0,  1/15, 1/15;
  0,  0,  1/31, 1/31,  1/31;
  0,  0,   0,   1/63,  1/63,  1/63;
  0,  0,   0,   1/127, 1/127, 1/127,  1/127;
  0,  0,   0,    0,    1/255, 1/255,  1/255,  1/255;
  0,  0,   0,    0,    1/511, 1/511,  1/511,  1/511,  1/511;
  0,  0,   0,    0,     0,    1/1023, 1/1023, 1/1023, 1/1023, 1/1023;
  0,  0,   0,    0,     0,    1/2047, 1/2047, 1/2047, 1/2047, 1/2047, 1/2047;
  ...
		

Crossrefs

Cf. A127804.

Programs

  • Maple
    A127803 := proc(n,k)
        A := Matrix(n+1,n+1) ;
        for r from 0 to n do
        for c from 0 to n do
            if c <= r and r <= 2*c then
                A[r+1,c+1] := 1/(2*2^r-1) ;
            else
                A[r+1,c+1] := 0 ;
            end if;
        end do:
        end do:
        Ainv := LinearAlgebra[MatrixInverse](A) ;
        Ainv[n+1,k+1] ;
    end proc:
    seq(seq( A127803(n,k),k=0..n),n=0..12) ; # R. J. Mathar, Feb 12 2024
  • Mathematica
    rows = 11;
    A[n_, k_] := If[k <= n, If[n <= 2 k, 1/(2*2^n - 1), 0], 0];
    T = Table[A[n, k], {n, 0, rows-1}, {k, 0, rows-1}] // Inverse;
    Table[T[[n, k]], {n, 1, rows}, {k, 1, n}] // Flatten (* Jean-François Alcover, Jul 03 2018 *)
  • PARI
    B(n,k) = if(k<=n,if(n<=2*k,1/(2*2^n-1),0),0);
    lista(nn) = {my(m = matrix(nn, nn, n, k, B(n-1,k-1))^(-1)); for (n=1, nn, for (k=1, n, print1(m[n,k], ", ");); print(););} \\ Michel Marcus, Jul 03 2018

A128807 A115361 * A007318.

Original entry on oeis.org

1, 2, 1, 1, 2, 1, 3, 4, 3, 1, 1, 4, 6, 4, 1, 2, 7, 11, 10, 5, 1, 1, 6, 15, 20, 15, 6, 1, 4, 11, 24, 36, 35, 21, 7, 1, 1, 8, 28, 56, 70, 56, 28, 8, 1, 2, 13, 42, 88, 127, 126, 84, 36, 9, 1
Offset: 0

Views

Author

Gary W. Adamson, Apr 06 2007

Keywords

Comments

Row sums = A127804: (1, 3, 4, 11, 16, 36, 64, ...). Left column = the Ruler sequence, A001511: (1, 2, 1, 3, 1, 2, 1, 4, ...). A129262 = A007318 * A115361.

Examples

			First few rows of the triangle:
  1;
  2,  1;
  1,  2,  1;
  3,  4,  3,  1;
  1,  4,  6,  4,  1;
  2,  7, 11, 10,  5,  1;
  1,  6, 15, 20, 15,  6,  1;
  4, 11, 24, 36, 35, 21,  7,  1;
  ...
		

Crossrefs

Formula

A115361 * A007318 as infinite lower triangular matrices.
Showing 1-6 of 6 results.