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

A065775 Array T read by diagonals: T(i,j)=least number of knight's moves on a chessboard (infinite in all directions) needed to move from (0,0) to (i,j).

Original entry on oeis.org

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

Views

Author

Stewart Gordon, Dec 05 2001

Keywords

Examples

			From _Clark Kimberling_, Dec 20 2010: (Start)
T(i,j) for -2<=i<=2 and -2<=j<=2:
  4 1 2 1 4=T(2,2)
  1 2 3 2 1=T(2,1)
  2 3 0 3 2=T(2,0)
  1 2 3 2 1=T(2,-1)
  4 1 2 1 4=T(2,-2)
Corner of the array, T(i,j) for i>=0, j>=0: [Corrected Oct 14 2016]
  0 3 2 3 2 3 4...
  3 2 1 2 3 4 3...
  2 1 4 3 2 3 4...
  3 2 3 2 3 4 2... (End)
		

Crossrefs

Identical to A049604 except for T(1, 1).
For number of knight's moves to various subsets of the chessboard, see A018837, A183041-A183053.

Formula

From Clark Kimberling, Dec 20 2010: (Start)
T(i,j) is given in cases:
Case 1: row 0
T(0,0)=0, T(1,0)=3, and for m>=1,
T(4m-2,0)=2m, T(4m-1,0)=2m+1, T(4m,0)=2m,
T(4m+1,0)=2m+1.
Case 2: row 1
T(0,1)=3, T(1,1)=2, and for m>=1,
T(4m-2,1)=2m-1, T(4m-1,1)=2m, T(4m,1)=2m+1,
T(4m+1,1)=2m+2.
Case 3: columns 0 and 1
(column 0 = row 0); (column 1 = row 1).
Case 4: For i>=2 and j>=2,
T(i,j)=1+min{T(i-2,j-1),T(i-1,j-2)}.
Cases 1-4 determine T in the 1st quadrant;
all other T(i,j) are easily obtained by symmetry. (End)

A018837 Number of steps for knight to reach (n,0) on infinite chessboard.

Original entry on oeis.org

0, 3, 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, 39, 38, 39, 40, 41, 40, 41, 42, 43
Offset: 0

Views

Author

Keywords

Comments

The knight starts at (0,0) and we count the least number of steps. Row 1 of the array at A065775. - Clark Kimberling, Dec 20 2010
Apparently also the minimum number of steps of the (1,3)-leaper to reach (n,n) starting at (0,0). - R. J. Mathar, Jan 05 2018

Examples

			a(1)=3 counts these moves: (0,0) to (2,1) to (0,2) to (1,0). - _Clark Kimberling_, Dec 20 2010
		

Crossrefs

Cf. A065775, A183041-A183053, A083219 (essentially the same).
Cf. A018840 for the (2,3)-leaper.

Programs

  • Mathematica
    CoefficientList[Series[x (3 - x + x^2 - x^3 - 2 x^4 + 2 x^5)/((1-x)^2 (1+x) (1+x^2)), {x, 0, 100}], x] (* Vincenzo Librandi, Jan 06 2018 *)
    Array[Which[#==1,3,True,(#+Mod[#,4])/2]&,100,0] (* Elisha Hollander, Aug 05 2021 *)
  • PARI
    concat([0], Vec( x*(3-x+x^2-x^3-2*x^4+2*x^5)/((1-x)^2*(1+x)*(1+x^2)) + O(x^166) ) ) \\ Joerg Arndt, Sep 10 2014
    
  • Python
    def a(n): return 3 if n == 1 else (n + n % 4) // 2 # Elisha Hollander, Aug 05 2021

Formula

a(n) = 2[ (n+2)/4 ] if n even, 2[ (n+1)/4 ]+1 if n odd (n >= 8).
G.f.: x*(3-x+x^2-x^3-2*x^4+2*x^5)/((1-x)^2*(1+x)*(1+x^2)). a(n)=A083219(n), n<>1. - R. J. Mathar, Dec 15 2008
T(0,0)=0, T(1,0)=3, and for m>=1, T(4m-2,0)=2m, T(4m-1,0)=2m+1, T(4m,0)=2m, T(4m+1,0)=2m+1 where T(.,.) = A065775(.,.). - Clark Kimberling, Dec 20 2010
Sum_{n>=1} (-1)^n/a(n) = 5/3 - 2*log(2). - Amiram Eldar, Sep 10 2023

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

Original entry on oeis.org

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

Views

Author

Wolfdieter Lang, May 10 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.

Crossrefs

Programs

  • Mathematica
    Table[2 (Floor[n/2] - Floor[(n + 1)/4]) + Boole[OddQ@ n], {n, 0, 52}] (* Michael De Vlieger, May 10 2017 *)
  • PARI
    concat(0, Vec(x*(1 + x - x^2 + x^3) / ((1 - x)^2*(1 + x)*(1 + x^2)) + O(x^100))) \\ Colin Barker, May 18 2017

Formula

a(n) = 2*b(n) if n is even, else a(n) = 1 + 2*b(n), with b(n) = floor(n/2) - floor((n + 1)/4) = A059169(n+1).
G.f. for {b(n)}: Sum_{n>=0} b(n)*x^n = x^2*(1 - x + x^2)/((1 - x)*(1 - x^4)) (see A059169).
From Colin Barker, May 18 2017: (Start)
G.f.: x*(1 + x - x^2 + x^3) / ((1 - x)^2*(1 + x)*(1 + x^2)).
a(n) = a(n-1) + a(n-4) - a(n-5) for n>4.
(End)
a(n) = A162330(n-1) for n >= 2. - Michel Marcus, Nov 01 2017
Sum_{n>=1} (-1)^(n+1)/a(n) = 2*log(2) (A016627). - Amiram Eldar, Sep 17 2023
a(n) = A183041(n-1) for n>=2. - R. J. Mathar, May 13 2025

A162330 Blocks of 4 numbers of the form 2k, 2k-1, 2k, 2k+1, k=1,2,3,4,...

Original entry on oeis.org

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

Views

Author

Juri-Stepan Gerasimov, Jul 01 2009

Keywords

Comments

This illustrates the infinite product Pi/2 = Product_{k>=1} ((2*k)/(2k-1))*((2k)/(2k+1)): read the 4 terms of numerator and denominator of the factor in the product in that order shown.
Number of roots of the polynomial 1+x+x^2+...+x^(n+1) = (x^(n+2)-1)/(x-1) in the left half plane. - Michel Lagneau, Oct 30 2012

Crossrefs

Programs

Formula

a(n) = a(n-1) + a(n-4) - a(n-5).
G.f.: x*(2-x+x^2+x^3-x^4)/((1+x)*(1+x^2)*(1-x)^2).
a(n) = n + 1 - 2*floor( (n+2)/4 ). - M. F. Hasler, Nov 01 2012
a(n) = (2*n + 3 - (-1)^n + 2*(-1)^((2*n - 1 + (-1)^n)/4))/4. - Luce ETIENNE, Mar 08 2016
Sum_{n>=1} (-1)^n/a(n) = 2*log(2) - 1. - Amiram Eldar, Sep 10 2023

Extensions

Edited by R. J. Mathar, Sep 16 2009

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