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

A059169 Number of partitions of n into 3 parts which form the sides of a nondegenerate isosceles triangle.

Original entry on oeis.org

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

Views

Author

Floor van Lamoen, Jan 13 2001

Keywords

Comments

Also number of 0's in n-th row of triangle in A071026. - Hans Havermann, May 26 2002
Exponent of 2 in factorization of A030436(n-1) and A026655(n-1). First differences of A001971. - Ralf Stephan, Mar 21 2004
Conjecture: this is 0 followed by A026922. - R. J. Mathar, Oct 05 2008 [See the g.f. given there by Michael Somos and the one given below for the proof. - Wolfdieter Lang, May 10 2017]
a(n+1) is for n >= 0 the number of integers k in the left-sided open interval ((n+1)/4, floor(n/2)]. This is needed for the number of zeros of Chebyshev S polynomials in the open interval (-sqrt(2), sqrt(2)) given in A285869. - Wolfdieter Lang, May 10 2017

Examples

			Consider the number 13. The following partitions give a nondegenerate triangle: 4 4 5; 3 5 5; 1 6 6; 2 5 6; 3 4 6. Since the first three partitions represent isosceles triangles, we have A059169(13) = 3.
G.f. = x^3 + x^5 + x^6 + 2*x^7 + x^8 + 2*x^9 + 2*x^10 + 3*x^11 + 2*x^12 + ...
		

Crossrefs

Essentially the same as A008624.
Cf. A178804.

Programs

  • Haskell
    a059169 n = a059169_list !! (n-1)
    a059169_list = map abs $ zipWith (-) (tail a178804_list) a178804_list
    -- Reinhard Zumkeller, Nov 15 2014
    
  • Magma
    [Floor((n-1)/2) - Floor(n/4): n in [1..80]]; // G. C. Greubel, Mar 08 2018
  • Maple
    a[1] := 0: a[2] := 0: a[3] := 1: a[4] := 0: a[5] := 1: for n from 6 to 300 do a[n] := a[n-1] + a[n-4] - a[n-5]: end do: seq(a[n], n=1..82);
    a := n -> A005044(n) - A005044(n-6): A005044 := n-> floor((1/48)*(n^2 + 3*n + 21 + (-1)^(n-1)*3*n)): seq(a(n), n = 1..82); # Johannes W. Meijer, Oct 10 2013
  • Mathematica
    CoefficientList[Series[x^2 (1 - x + x^2)/(1 - x - x^4 + x^5), {x, 0, 100}], x] (* Vincenzo Librandi, Aug 15 2013 *)
    LinearRecurrence[{1,0,0,1,-1},{0,0,1,0,1},100] (* Harvey P. Dale, Feb 09 2015 *)
    a[ n_] := Quotient[ n - 1, 2] - Quotient[ n, 4]; (* Michael Somos, May 05 2015 *)
  • PARI
    {a(n) = (n - 1) \ 2 - (n \ 4)}; /* Michael Somos, Oct 14 2008 */
    
  • PARI
    {a(n) = if( n<1, -a(3 - n), polcoeff( x^3 * (1 - x + x^2) / (1 - x - x^4 + x^5) + x * O(x^n), n))}; /* Michael Somos, Oct 14 2008 */
    

Formula

a(2*n + 2) = a(2*n - 1) = A004526(n).
a(n) = A005044(n) - A005044(n-6).
From Vladeta Jovovic, Dec 29 2001: (Start)
a(n) = a(n-1) + a(n-4) - a(n-5).
G.f.: x^3*(1 - x + x^2)/(1 - x - x^4 + x^5). (End)
The g.f. can also be written as x^3 * (1 + x^3) / ((1 - x^2) * (1 - x^4)). - Michael Somos, May 05 2015
Euler transform of length 6 sequence [0, 1, 1, 1, 0, -1]. - Michael Somos, Oct 14 2008
a(n) = -a(3 - n) for all n in Z. - Michael Somos. Oct 14 2008
a(n) = abs(floor((n-1)*(-1)^n/4)). - Wesley Ivan Hurt, Oct 22 2013
a(n) = abs(A178804(n+1) - A178804(n)). - Reinhard Zumkeller, Nov 15 2014
a(n) = floor(n/2) - floor(n/4) - (1 if n even). - David Pasino, Jun 17 2016
E.g.f.: (4 - sin(x) - cos(x) + x*sinh(x) + (x - 3)*cosh(x))/4. - Ilya Gutkovskiy, Jun 21 2016
a(n) = floor((n-1)/2) - floor(n/4), n >= 0 (from the preceding a(n) formula). - Wolfdieter Lang, May 08 2017
a(n) = (2*n - 3 - 2*cos(n*Pi/2) - 3*cos(n*Pi) - 2*sin(n*Pi/2))/8. - Wesley Ivan Hurt, Oct 01 2017
a(n) = Sum_{i=1..floor((n-1)/2)} (n-i-1) mod 2. - Wesley Ivan Hurt, Nov 17 2017

Extensions

More terms from Sascha Kurz, Mar 25 2002

A083219 a(n) = n - 2*floor(n/4).

Original entry on oeis.org

0, 1, 2, 3, 2, 3, 4, 5, 4, 5, 6, 7, 6, 7, 8, 9, 8, 9, 10, 11, 10, 11, 12, 13, 12, 13, 14, 15, 14, 15, 16, 17, 16, 17, 18, 19, 18, 19, 20, 21, 20, 21, 22, 23, 22, 23, 24, 25, 24, 25, 26, 27, 26, 27, 28, 29, 28, 29, 30, 31, 30, 31, 32, 33, 32, 33, 34, 35, 34, 35, 36, 37, 36, 37, 38
Offset: 0

Views

Author

Reinhard Zumkeller, Apr 22 2003

Keywords

Comments

Conjecture: number of roots of P(x) = x^n - x^(n-1) - x^(n-2) - ... - x - 1 in the left half-plane. - Michel Lagneau, Apr 09 2013
a(n) is n+2 with its second least significant bit removed (see A021913(n+2) for that bit). - Kevin Ryde, Dec 13 2019

Crossrefs

Cf. A083220, A129756, A162751 (second highest bit removed).
Essentially the same as A018837.

Programs

Formula

a(n) = A083220(n)/2.
a(n) = a(n-1) + n mod 2 + (n mod 4 - 1)*(1 - n mod 2), a(0) = 0.
G.f.: x*(1+x+x^2-x^3)/((1-x)^2*(1+x)*(1+x^2)). - R. J. Mathar, Aug 28 2008
a(n) = n - A129756(n). - Michel Lagneau, Apr 09 2013
Bisection: a(2*k) = 2*floor((n+2)/4), a(2*k+1) = a(2*k) + 1, k >= 0. - Wolfdieter Lang, May 08 2017
a(n) = (2*n + 3 - 2*cos(n*Pi/2) - cos(n*Pi) - 2*sin(n*Pi/2))/4. - Wesley Ivan Hurt, Oct 02 2017
a(n) = A162330(n+2) - 1 = A285869(n+3) - 1. - Kevin Ryde, Dec 13 2019
E.g.f.: ((1 + x)*cosh(x) - cos(x) + (2 + x)*sinh(x) - sin(x))/2. - Stefano Spezia, May 27 2021
Sum_{n>=1} (-1)^(n+1)/a(n) = 2*log(2) - 1. - Amiram Eldar, Aug 21 2023

A285872 a(n) is the number of zeros of the Chebyshev S(n, x) polynomial (A049310) in the open interval (-sqrt(3), +sqrt(3)).

Original entry on oeis.org

0, 1, 2, 3, 4, 3, 4, 5, 6, 7, 8, 7, 8, 9, 10, 11, 12, 11, 12, 13, 14, 15, 16, 15, 16, 17, 18, 19, 20, 19, 20, 21, 22, 23, 24, 23, 24, 25, 26, 27, 28, 27, 28, 29, 30, 31, 32, 31, 32, 33, 34, 35, 36, 35, 36, 37, 38, 39, 40, 39, 40, 41, 42, 43, 44, 43, 44, 45
Offset: 0

Views

Author

Wolfdieter Lang, May 12 2017

Keywords

Comments

See a May 06 2017 comment on A049310 where these problems are considered which originated in a conjecture by Michel Lagneau (see A008611) on Fibonacci polynomials.

Examples

			n = 3: S(3, x) = x*(-2 + x^2), with all three zeros (-sqrt(2), 0, +sqrt(2)) in the interval (-sqrt(3), +sqrt(3)).
n = 4: S(4, x) = 1 - 3*x^2 + x^4, all four zeros  (-phi, -1/phi, 1/phi, phi) with phi = (1 + sqrt(5))/2, approximately 1.618, lie in the interval.
n = 6, two zeros of  S(6, x) = -1 + 6*x^2 - 5*x^4 + x^6 are out of the interval (-sqrt(3), +sqrt(3)), namely - 1.8019... and +1.8019... .
		

Crossrefs

Cf. A008611(n-1) (1), A049310, A285869 (sqrt(2)), A285870.

Programs

  • Magma
    m:=80; R:=PowerSeriesRing(Integers(), m); Coefficients(R!(x*(1+x+x^2+x^3-x^4+x^5)/((1-x)^2*(1+x)*(1-x+x^2)*(1+x+x^2)))); // G. C. Greubel, Mar 08 2018
  • Mathematica
    CoefficientList[Series[x*(1+x+x^2+x^3-x^4+x^5)/((1-x)^2*(1+x)*(1-x+x^2)*(1+x+x^2)), {x, 0, 50}], x] (* G. C. Greubel, Mar 08 2018 *)
  • PARI
    concat(0, Vec(x*(1 + x + x^2 + x^3 - x^4 + x^5) / ((1 - x)^2*(1 + x)*(1 - x + x^2)*(1 + x + x^2)) + O(x^100))) \\ Colin Barker, May 18 2017
    

Formula

a(n) = 2*b(n) if n is even and 1 + 2*b(n) if n is odd with b(n) = floor(n/2) - floor((n+1)/6) = A285870(n). See the g.f. for {b(n)}_{n>=0} there.
From Colin Barker, May 18 2017: (Start)
G.f.: x*(1 + x + x^2 + x^3 - x^4 + x^5) / ((1 - x)^2*(1 + x)*(1 - x + x^2)*(1 + x + x^2)).
a(n) = a(n-1) + a(n-6) - a(n-7) for n>6.
(End)

A285870 a(n) = floor(n/2) - floor((n+1)/6), n >= 0.

Original entry on oeis.org

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

Views

Author

Wolfdieter Lang, May 12 2017

Keywords

Comments

This is the number of integers k in the (left-sided open) interval ((n+1)/6, floor(n/2)]. This sequence is used in A285872(n), the number of zeros of Chebyshev's S(n, x) polynomial (A049310) in the open interval (-sqrt(3), +sqrt(3)).

Crossrefs

Programs

  • Magma
    [Floor(n/2)-Floor((n+1)/6): n in [0..100]]; // Vincenzo Librandi, May 15 2017
    
  • Mathematica
    Table[Floor[n/2] - Floor[(n + 1)/6], {n, 0, 60}] (* or *)
    CoefficientList[Series[(x^2/((1 + x) (1 - x)^2)) (1 - x^3/((1 + x + x^2) (1 - x + x^2))), {x, 0, 60}], x] (* Michael De Vlieger, May 13 2017 *)
  • PARI
    concat(vector(2), Vec(x^2*(1 + x^2 - x^3 + x^4) / ((1 - x)^2*(1 + x)*(1 - x + x^2)*(1 + x + x^2)) + O(x^100))) \\ Colin Barker, May 18 2017

Formula

a(n) = floor(n/2) - floor((n+1)/6), n >= 0.
G.f.: (x^2/((1+x)*(1-x)^2))*(1-x^3/((1+x+x^2)*(1-x+x^2))).
a(n) = a(n-1) + a(n-6) - a(n-7) for n>6. - Colin Barker, May 18 2017

A286717 a(n) is the number of zeros of the Chebyshev S(n, x) polynomial (A049310) in the open interval (-phi, +phi), with the golden section phi = (1 + sqrt(5))/2.

Original entry on oeis.org

0, 1, 2, 3, 2, 3, 4, 5, 6, 5, 6, 7, 8, 9, 8, 9, 10, 11, 12, 11, 12, 13, 14, 15, 14, 15, 16, 17, 18, 17, 18, 19, 20, 21, 20, 21, 22, 23, 24, 23, 24, 25, 26, 27, 26, 27, 28, 29, 30, 29, 30, 31, 32, 33, 32, 33, 34, 35, 36, 35, 36, 37, 38, 39, 38, 39, 40, 41, 42
Offset: 0

Views

Author

Wolfdieter Lang, May 13 2017

Keywords

Comments

See a May 06 2017 comment on A049310 where these problems are considered which originated in a conjecture by Michel Lagneau (see A008611) on Fibonacci polynomials.

Examples

			a(4) = 2: S(4, x) = 1+x^4-3*x^2, and only two of the four zeros -phi, -1/phi, +1/phi, phi are in the open interval (-phi, +phi), the other two are at the borders.
		

Crossrefs

Cf. A008611(n-1) (1), A285869 (sqrt(2)), A285872 (sqrt(3)).

Programs

  • Magma
    m:=80; R:=PowerSeriesRing(Integers(), m); [0] cat Coefficients(R!(x*(1+x+x^2-x^3+x^4)/((1-x)^2*(1+x+x^2+x^3+x^4)))); // G. C. Greubel, Mar 08 2018
  • Mathematica
    CoefficientList[Series[x*(1+x+x^2-x^3+x^4)/((1-x)^2*(1+x+x^2+x^3+x^4)), {x, 0, 50}], x] (* G. C. Greubel, Mar 08 2018 *)
    LinearRecurrence[{1,0,0,0,1,-1},{0,1,2,3,2,3},80] (* Harvey P. Dale, Aug 20 2020 *)
  • PARI
    concat(0, Vec(x*(1 + x + x^2 - x^3 + x^4) / ((1 - x)^2*(1 + x + x^2 + x^3 + x^4)) + O(x^100))) \\ Colin Barker, May 18 2017
    

Formula

a(n) = 2*b(n) if n is even and 1 + 2*b(n) if n is odd with b(n) = floor(n/2) - floor((n+1)/6) = A286716(n). See the g.f. for {b(n)}_{n>=0} there.
From Colin Barker, May 18 2017: (Start)
G.f.: x*(1 + x + x^2 - x^3 + x^4) / ((1 - x)^2*(1 + x + x^2 + x^3 + x^4)).
a(n) = a(n-1) + a(n-5) - a(n-6) for n>5.
(End)

A347171 Triangle read by rows where T(n,k) is the sum of Golay-Rudin-Shapiro terms GRS(j) (A020985) for j in the range 0 <= j < 2^n and having binary weight wt(j) = A000120(j) = k.

Original entry on oeis.org

1, 1, 1, 1, 2, -1, 1, 3, -1, 1, 1, 4, 0, 0, -1, 1, 5, 2, -2, 1, 1, 1, 6, 5, -4, 3, -2, -1, 1, 7, 9, -5, 3, -3, 3, 1, 1, 8, 14, -4, 0, 0, 2, -4, -1, 1, 9, 20, 0, -6, 6, -4, 0, 5, 1, 1, 10, 27, 8, -14, 12, -10, 8, -3, -6, -1, 1, 11, 35, 21, -22, 14, -10, 10, -11, 7, 7, 1
Offset: 0

Views

Author

Kevin Ryde, Aug 21 2021

Keywords

Comments

Doche and Mendès France form polynomials P_n(y) = Sum_{j=0..2^n-1} GRS(j) * y^wt(j) and here row n is the coefficients of P_n starting from the constant term, so P_n(y) = Sum_{k=0..n} T(n,k)*y^k. They conjecture that the number of real roots of P_n is A285869(n).
Row sum n is the sum of GRS terms from j = 0 to 2^n-1 inclusive, which Brillhart and Morton (Beispiel 6 page 129) show is A020986(2^n-1) = 2^ceiling(n/2) = A060546(n). The same follows by substituting y=1 in the P_n recurrence or the generating function.

Examples

			Triangle begins
        k=0 k=1 k=2 k=3 k=4 k=5 k=6 k=7
  n=0:   1
  n=1:   1,  1
  n=2:   1,  2, -1
  n=3:   1,  3, -1,  1
  n=4:   1,  4,  0,  0, -1
  n=5:   1,  5,  2, -2,  1,  1
  n=6:   1,  6,  5, -4,  3, -2, -1
  n=7:   1,  7,  9, -5,  3, -3,  3,  1
For T(5,3), those j in the range 0 <= j < 2^5 with wt(j) = 3 are
  j      =  7 11 13 14 19 21 22 25 26 28
  GRS(j) = +1 -1 -1 +1 -1 +1 -1 -1 -1 +1 total -2 = T(5,3)
		

Crossrefs

Cf. A020985 (GRS), A020986 (GRS partial sums), A000120 (binary weight), A285869.
Columns k=0..3: A000012, A001477, A000096, A275874.
Cf. A165326 (main diagonal), A248157 (second diagonal negated).
Cf. A060546 (row sums), A104969 (row sums squared terms).
Cf. A329301 (antidiagonal sums).
Cf. A104967 (rows reversed, up to signs).

Programs

  • PARI
    my(M=Mod('x, 'x^2-(1-'y)*'x-2*'y)); row(n) = Vecrev(subst(lift(M^n),'x,'y+1));

Formula

T(n,k) = T(n-1,k) - T(n-1,k-1) + 2*T(n-2,k-1) for n>=2, and taking T(n,k)=0 if k<0 or k>n.
T(n,k) = (-1)^k * A104967(n,n-k).
Row polynomial P_n(y) = (1-y)*P_{n-1}(y) + 2*y*P_{n-2}(y) for n>=2. [Doche and Mendès France]
G.f.: (1 + 2*x*y)/(1 + x*(y-1) - 2*x^2*y).
Column g.f.: C_k(x) = 1/(1-x) for k=0 and C_k(x) = x^k * (2*x-1)^(k-1) / (1-x)^(k+1) for k>=1.

A293990 a(n) = (3*n + ((n-2) mod 4))/2.

Original entry on oeis.org

1, 3, 3, 5, 7, 9, 9, 11, 13, 15, 15, 17, 19, 21, 21, 23, 25, 27, 27, 29, 31, 33, 33, 35, 37, 39, 39, 41, 43, 45, 45, 47, 49, 51, 51, 53, 55, 57, 57, 59, 61, 63, 63, 65, 67, 69, 69, 71, 73, 75, 75, 77, 79, 81, 81, 83, 85, 87, 87, 89, 91, 93, 93
Offset: 0

Views

Author

Dimitris Valianatos, Oct 21 2017

Keywords

Comments

The product (2/3) * (4/3) * (6/5) * (6/7) * (8/9) * (10/9) * (12/11) * (12/13) * ... = Pi/(2*sqrt(3)). The denominators are a(n) for n >= 1 and numerators are a(n-1) + A093148(n) for n >= 1 -> [2, 4, 6, 6, 8, 10, 12, 12, ...].
Let r(n) = (a(n)-1)/(a(n)+1) if a(n) mod 4 = 1, (a(n)+1)/(a(n)-1) otherwise; then Product_{n>=1} r(n) = (2/1) * (2/1) * (2/3) * (4/3) * (4/5) * (4/5) * (6/5) * (6/7) * ... = Pi*sqrt(3)/2 = 2.72069904635132677...
The odd numbers of partial sums this sequence, are identified with the A003215 sequence. Also the prime numbers that appear in partial sums in this sequence, are identified with the A002407 sequence.

Crossrefs

Programs

  • Magma
    [(3*n+((n-2) mod 4))/2 : n in [0..100]]; // Wesley Ivan Hurt, Oct 29 2017
  • Maple
    A293990:=n->(3*n+((n-2) mod 4))/2: seq(A293990(n), n=0..100); # Wesley Ivan Hurt, Oct 29 2017
  • Mathematica
    Table[(3*n + Mod[(n - 2), 4])/2, {n, 0, 100}] (* Wesley Ivan Hurt, Oct 29 2017 *)
    f[n_] := (3n + Mod[n - 2, 4])/2; Array[f, 65, 0] (* or *)
    LinearRecurrence[{1, 0, 0, 1, -1}, {1, 3, 3, 5, 7}, 65] (* or *)
    CoefficientList[ Series[(x^4 + 2x^3 + 2x + 1)/((x - 1)^2 (x^3 + x^2 + x + 1)), {x, 0, 64}], x] (* Robert G. Wilson v, Nov 28 2017 *)
  • PARI
    a(n) = (3*n + (n-2)%4) / 2
    
  • PARI
    Vec(x*(1 + 2*x + 2*x^3 + x^4) / ((1 - x)^2*(1 + x)*(1 + x^2)) + O(x^30)) \\ Colin Barker, Oct 21 2017
    
  • PARI
    first(n) = my(start=[1,3,3,5,7,9,9,11]); if(n<=8, return(start)); my(res=vector(n)); for (i=1, 8, res[i] = start[i]); for(i = 1, n-8 ,res[i+8] = res[i] + 12); res \\ David A. Corneth, Oct 21 2017
    

Formula

Sum_{n>=0} 1/a(n)^2 = 5*Pi^2/36 = 1.3707783890401886970... = 10*A086729.
(a(n) - n) * (-1)^(n+1) = A134967(n) for n >= 0.
a(n) - n = A162330(n) for n >= 0.
a(n) - n = A285869(n+1) for n >= 0.
a(n) + a(n+1) = A157932(n+2) for n >= 0.
a(n) + (2*n+1) = A047298(n+1) for n >= 0.
From Colin Barker, Oct 21 2017: (Start)
G.f.: x*(1 + 2*x + 2*x^3 + x^4) / ((1 - x)^2*(1 + x)*(1 + x^2)).
a(n) = a(n-1) + a(n-4) - a(n-5) for n > 5.
(End)
a(n + 8) = a(n) + 12. - David A. Corneth, Oct 21 2017
a(4*k+4) * a(4*k+3) - a(4*k+2) * a(4*k+1) = 2*A063305(k+3) for k >= 0.
Sum_{n>=0} 1/(a(n) + a(n+2))^2 = (4*Pi^2 - 27) / 108 = (A214549 - 1) / 4.

A330239 Minimum circular (strong) similarity of a length-n binary word.

Original entry on oeis.org

0, 0, 1, 2, 3, 4, 3, 4, 5, 6, 5, 6, 7, 8, 7, 8, 9, 10, 9, 10, 11, 12, 11, 12, 13, 14, 15, 14, 15, 16, 15, 16, 17, 18, 17, 18
Offset: 1

Views

Author

Jeffrey Shallit, Dec 06 2019

Keywords

Comments

The circular (strong) similarity of a word w is the maximum, over all nontrivial cyclic shifts x of w, of the number of positions where x and w agree.
The plausible identification of this sequence with A285869, A162330, A183041 is just illusory because a(27) = 15.
Circular (strong) similarity is basically a one-sided version of autocorrelation, where we only care about agreement of terms, not the difference between agreement and disagreement.

Examples

			For n = 7, one string achieving a(7) = 3 is 0001011.
		

Crossrefs

Programs

  • Python
    # see links for faster version
    from itertools import product
    def css(k, n):
        cs = ((k>>i) | ((((1<1 else 0
    print([a(n) for n in range(1, 16)]) # Michael S. Branicky, Jan 15 2024

Extensions

a(31)-a(36) from Michael S. Branicky, Jan 15 2024
Showing 1-8 of 8 results.