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-10 of 18 results. Next

A121496 Run lengths of successive numbers in A068225.

Original entry on oeis.org

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

Views

Author

Rick L. Shepherd, Aug 03 2006

Keywords

Comments

A000027 and A103889 are bisections.

Examples

			The fifth run of successive numbers in A068225 is 8, 9, 10 with run length three so a(5) = 3.
		

Crossrefs

Programs

  • Mathematica
    Rest@ CoefficientList[Series[x (1 + x - x^3 + x^4)/((1 - x)^2*(1 + x) (1 + x^2)), {x, 0, 75}], x] (* Michael De Vlieger, Oct 02 2017 *)
  • PARI
    a(n) = if(n%2==1,(n+1)/2,if(n%4==0,(n/2)-1,(n/2)+1))
    for(n=1,80,print1(a(n),", "))
    
  • PARI
    Vec(x*(1+x-x^3+x^4)/((1-x)^2*(1+x)*(1+x^2)) + O(x^100)) \\ Colin Barker, Apr 08 2016

Formula

a(2*k-1) = k, a(4*k) = 2*k-1, a(4*k-2) = 2*k, for k >= 1.
From Colin Barker, Apr 08 2016: (Start)
a(n) = a(n-1) + a(n-4) - a(n-5) for n > 5.
G.f.: x*(1+x-x^3+x^4) / ((1-x)^2*(1+x)*(1+x^2)). (End)
a(n) = (2*n+1-4*cos(n*Pi/2)-cos(n*Pi))/4. - Wesley Ivan Hurt, Oct 02 2017

A054569 a(n) = 4*n^2 - 6*n + 3.

Original entry on oeis.org

1, 7, 21, 43, 73, 111, 157, 211, 273, 343, 421, 507, 601, 703, 813, 931, 1057, 1191, 1333, 1483, 1641, 1807, 1981, 2163, 2353, 2551, 2757, 2971, 3193, 3423, 3661, 3907, 4161, 4423, 4693, 4971, 5257, 5551, 5853, 6163, 6481, 6807, 7141, 7483, 7833, 8191
Offset: 1

Views

Author

Keywords

Comments

Move in 1-7 direction in a spiral organized like A068225 etc.
Third row of A082039. - Paul Barry, Apr 02 2003
Inverse binomial transform of A036826. - Paul Barry, Jun 11 2003
Equals the "middle sequence" T(2*n,n) of the Connell sequence A001614 as a triangle. - Johannes W. Meijer, May 20 2011
Ulam's spiral (SW spoke). - Robert G. Wilson v, Oct 31 2011

Crossrefs

Sequences on the four axes of the square spiral: Starting at 0: A001107, A033991, A007742, A033954; starting at 1: A054552, A054556, A054567, A033951.
Sequences on the four diagonals of the square spiral: Starting at 0: A002939 = 2*A000384, A016742 = 4*A000290, A002943 = 2*A014105, A033996 = 8*A000217; starting at 1: A054554, A053755, A054569, A016754.
Sequences obtained by reading alternate terms on the X and Y axes and the two main diagonals of the square spiral: Starting at 0: A035608, A156859, A002378 = 2*A000217, A137932 = 4*A002620; starting at 1: A317186, A267682, A002061, A080335.

Programs

Formula

a(n+1) = 4*n^2 + 2*n + 1. - Paul Barry, Apr 02 2003
a(n) = 4*n^2 - 6*n+3 - 3*0^n (with leading zero). - Paul Barry, Jun 11 2003
Binomial transform of [1, 6, 8, 0, 0, 0, ...]. - Gary W. Adamson, Dec 28 2007
a(n) = 8*n + a(n-1) - 10 (with a(1)=1). - Vincenzo Librandi, Aug 07 2010
From Colin Barker, Mar 23 2012: (Start)
a(n) = 3*a(n-1) - 3*a(n-2) + a(n-3).
G.f.: x*(1+x)*(1+3*x)/(1-x)^3. (End)
a(n) = A000384(n) + A000384(n-1). - Bruce J. Nicholson, May 07 2017
E.g.f.: -3 + (3 - 2*x + 4*x^2)*exp(x). - G. C. Greubel, Jul 04 2019
Sum_{n>=1} 1/a(n) = A339237. - R. J. Mathar, Jan 22 2021

Extensions

Edited by Frank Ellermann, Feb 24 2002

A054554 a(n) = 4*n^2 - 10*n + 7.

Original entry on oeis.org

1, 3, 13, 31, 57, 91, 133, 183, 241, 307, 381, 463, 553, 651, 757, 871, 993, 1123, 1261, 1407, 1561, 1723, 1893, 2071, 2257, 2451, 2653, 2863, 3081, 3307, 3541, 3783, 4033, 4291, 4557, 4831, 5113, 5403, 5701, 6007, 6321, 6643, 6973, 7311, 7657, 8011, 8373, 8743
Offset: 1

Views

Author

Keywords

Comments

Move in 1-3 direction in a spiral organized like A068225 etc.
Equals binomial transform of [1, 2, 8, 0, 0, 0, ...]. - Gary W. Adamson, May 03 2008
Ulam's spiral (NE spoke). - Robert G. Wilson v, Oct 31 2011
Number of ternary strings of length 2*(n-1) that have one or no 0's, one or no 1's, and an even number of 2's. For n=2, the 3 strings of length 2 are 01, 10 and 22. For n=3, the 13 strings of length 4 are the 12 permutations of 0122 and 2222. - Enrique Navarrete, Jul 25 2025

Crossrefs

Cf. A014105.
Sequences on the four axes of the square spiral: Starting at 0: A001107, A033991, A007742, A033954; starting at 1: A054552, A054556, A054567, A033951.
Sequences on the four diagonals of the square spiral: Starting at 0: A002939 = 2*A000384, A016742 = 4*A000290, A002943 = 2*A014105, A033996 = 8*A000217; starting at 1: A054554, A053755, A054569, A016754.
Sequences obtained by reading alternate terms on the X and Y axes and the two main diagonals of the square spiral: Starting at 0: A035608, A156859, A002378 = 2*A000217, A137932 = 4*A002620; starting at 1: A317186, A267682, A002061, A080335.

Programs

Formula

a(n) = 8*n + a(n-1) - 14 with n > 1, a(1)=1. - Vincenzo Librandi, Aug 07 2010
G.f.: -x*(7*x^2+1)/(x-1)^3. - Colin Barker, Sep 21 2012
For n > 2, a(n) = A014105(n) + A014105(n-1). - Bruce J. Nicholson, May 07 2017
From Leo Tavares, Feb 21 2022: (Start)
a(n) = A003215(n-2) + 2*A000217(n-1). See Hexagonal Dual Rays illustration in links.
a(n) = A227776(n-1) - 4*A000217(n-1). (End)
a(k+1) = 4k^2 - 2k + 1 in the Numberphile video. - Frank Ellermann, Mar 11 2020
E.g.f.: exp(x)*(7 - 6*x + 4*x^2) - 7. - Stefano Spezia, Apr 24 2024

Extensions

Edited by Frank Ellermann, Feb 24 2002

A054556 a(n) = 4*n^2 - 9*n + 6.

Original entry on oeis.org

1, 4, 15, 34, 61, 96, 139, 190, 249, 316, 391, 474, 565, 664, 771, 886, 1009, 1140, 1279, 1426, 1581, 1744, 1915, 2094, 2281, 2476, 2679, 2890, 3109, 3336, 3571, 3814, 4065, 4324, 4591, 4866, 5149, 5440, 5739, 6046, 6361, 6684, 7015, 7354, 7701, 8056, 8419, 8790
Offset: 1

Views

Author

Keywords

Comments

Move in 1-4 direction in a spiral organized like A068225 etc.
Equals binomial transform of [1, 3, 8, 0, 0, 0, ...]. - Gary W. Adamson, Apr 30 2008
Ulam's spiral (N spoke). - Robert G. Wilson v, Oct 31 2011
Also, numbers of the form m*(4*m+1)+1 for nonpositive m. - Bruno Berselli, Jan 06 2016

Crossrefs

Cf. A266883: m*(4*m+1)+1 for m = 0,-1,1,-2,2,-3,3,...
Sequences on the four axes of the square spiral: Starting at 0: A001107, A033991, A007742, A033954; starting at 1: A054552, A054556, A054567, A033951.
Sequences on the four diagonals of the square spiral: Starting at 0: A002939 = 2*A000384, A016742 = 4*A000290, A002943 = 2*A014105, A033996 = 8*A000217; starting at 1: A054554, A053755, A054569, A016754.
Sequences obtained by reading alternate terms on the X and Y axes and the two main diagonals of the square spiral: Starting at 0: A035608, A156859, A002378 = 2*A000217, A137932 = 4*A002620; starting at 1: A317186, A267682, A002061, A080335.

Programs

Formula

a(n)^2 = Sum_{i = 0..2*(4*n-5)} (4*n^2-13*n+9+i)^2*(-1)^i = ((n-1)*(4*n-5)+1)^2. - Bruno Berselli, Apr 29 2010
From Harvey P. Dale, Aug 21 2011: (Start)
a(0)=1, a(1)=4, a(2)=15; for n > 2, a(n) = 3*a(n-1) - 3*a(n-2) + a(n-3).
G.f.: -x*(6*x^2+x+1)/(x-1)^3. (End)
From Franck Maminirina Ramaharo, Mar 09 2018: (Start)
a(n) = binomial(2*n - 2, 2) + 2*(n - 1)^2 + 1.
a(n) = A000384(n-1) + A058331(n-1).
a(n) = A130883(n-1) + A001105(n-1). (End)
E.g.f.: exp(x)*(6 - 5*x + 4*x^2) - 6. - Stefano Spezia, Apr 24 2024

Extensions

Edited by Frank Ellermann, Feb 24 2002
Incorrect formula deleted by N. J. A. Sloane, Aug 02 2009

A054567 a(n) = 4*n^2 - 7*n + 4.

Original entry on oeis.org

1, 6, 19, 40, 69, 106, 151, 204, 265, 334, 411, 496, 589, 690, 799, 916, 1041, 1174, 1315, 1464, 1621, 1786, 1959, 2140, 2329, 2526, 2731, 2944, 3165, 3394, 3631, 3876, 4129, 4390, 4659, 4936, 5221, 5514, 5815, 6124, 6441, 6766, 7099, 7440, 7789, 8146, 8511, 8884
Offset: 1

Views

Author

Keywords

Comments

The number 1 is placed in the middle of a sheet of squared paper and the numbers 2, 3, 4, 5, 6, etc. are written in a clockwise spiral around 1, as in A068225 etc. This sequence is read off along one of the rays from 1.
Ulam's spiral (W spoke of A054552). - Robert G. Wilson v, Oct 31 2011
Also, numbers of the form m*(4*m+1)+1 for nonnegative m. - Bruno Berselli, Jan 06 2016
The sequence forms the 1x2 diagonal of the square maze arrangement in A081344. - Jarrod G. Sage, Jul 17 2024

Crossrefs

Cf. A266883: m*(4*m+1)+1 for m = 0,-1,1,-2,2,-3,3,...
Sequences on the four axes of the square spiral: Starting at 0: A001107, A033991, A007742, A033954; starting at 1: A054552, A054556, A054567, A033951.
Sequences on the four diagonals of the square spiral: Starting at 0: A002939 = 2*A000384, A016742 = 4*A000290, A002943 = 2*A014105, A033996 = 8*A000217; starting at 1: A054554, A053755, A054569, A016754.
Sequences obtained by reading alternate terms on the X and Y axes and the two main diagonals of the square spiral: Starting at 0: A035608, A156859, A002378 = 2*A000217, A137932 = 4*A002620; starting at 1: A317186, A267682, A002061, A080335.

Programs

Formula

a(n) = 8*n+a(n-1)-11 for n>1, a(1)=1. - Vincenzo Librandi, Aug 07 2010
a(n) = A204674(n-1) / n. - Reinhard Zumkeller, Jan 18 2012
From Colin Barker, Oct 25 2014: (Start)
a(n) = 3*a(n-1)-3*a(n-2)+a(n-3).
G.f.: -x*(4*x^2+3*x+1) / (x-1)^3. (End)
E.g.f.: exp(x)*(4 - 3*x + 4*x^2) - 4. - Stefano Spezia, Apr 24 2024
a(n) = A016742(n-1) + n. - Jarrod G. Sage, Jul 17 2024

Extensions

Edited by Frank Ellermann, Feb 24 2002
Typo fixed by Charles R Greathouse IV, Oct 28 2009

A068608 Path of a knight's tour on an infinite chessboard.

Original entry on oeis.org

1, 10, 3, 16, 19, 22, 9, 12, 15, 18, 7, 24, 11, 14, 5, 20, 23, 2, 13, 4, 17, 6, 21, 8, 25, 50, 27, 54, 31, 60, 35, 64, 67, 40, 71, 74, 45, 78, 49, 52, 29, 56, 59, 34, 63, 66, 39, 70, 43, 76, 47, 80, 51, 28, 55, 58, 33, 62, 37, 68
Offset: 0

Views

Author

Hans Secelle and Albrecht Heeffer (albrecht.heeffer(AT)pandora.be), Mar 09 2002

Keywords

Comments

One of eight possible knight's tours. Squares are numbered in a clockwise spiral. Enumerates all positive integers.
A description of the method to construct the tour is provided in A306659. - Hugo Pfoertner, May 11 2019

Crossrefs

Programs

  • PARI
    \\Ellermann's clockwise square spiral, first step (0,0) -> (0,1)
    y=vector(10000);L=0;d=1;n=0;
    for(r=1, 100, d=-d; k=floor(r/2)*d; for(j=1, L++, y[n++]=k); forstep(j=k-d, -floor((r+1)/2)*d+d, -d, y[n++]=j));
    x=vector(10100);L=1;d=-1;n=0;
    for(r=1, 100, d=-d; k=floor(r/2)*d; for(j=1, L++, x[n++]=-k); forstep(j=k-d, -floor((r+1)/2)*d+d, -d, x[n++]=-j));
    \\ Position in spiral
    findpos(i,j)={my(size=(2*max(abs(i),abs(j))+1)^2);forstep(k=size,1,-1, if(i==x[k]&&j==y[k], return(k)))};
    atan2(y,x)=if(x>0,atan(y/x),if(x==0,if(y>0,Pi/2,-Pi/2),if(y>=0,atan(y/x)+Pi,atan(y/x)-Pi)));
    angle(v,w)=atan2(v[1]*w[2]-v[2]*w[1],v[1]*w[1]+v[2]*w[2]);
    move=[2,1;1,2;-1,2;-2,1;-2,-1;-1,-2;1,-2;2,-1]; \\ 8 Knight moves
    m=6;b=matrix(2*m+1, 2*m+1, i, j, 0);setb(pos)={b[pos[1]+m+1, pos[2]+m+1]=1};
    getb(pos)=b[pos[1]+m+1, pos[2]+m+1];
    inring(n, p)=!(abs(p[1])angmin, jmin=j; angmin=adiff;jlast=j)))));if(jmin>0,p+=move[jmin,];setb(p);););p+=move[jlast,];setb(p)); \\ Hugo Pfoertner, May 11 2019

A068613 Path of a knight's tour on an infinite chessboard.

Original entry on oeis.org

1, 24, 7, 18, 15, 12, 9, 22, 19, 16, 3, 10, 23, 20, 5, 14, 11, 8, 21, 6, 17, 4, 13, 2, 25, 80, 47, 76, 43, 70, 39, 66, 63, 34, 59, 56, 29, 52, 49, 78, 45, 74, 71, 40, 67, 64, 35, 60, 31, 54, 27, 50, 79, 46, 75, 72, 41, 68, 37, 62
Offset: 0

Views

Author

Hans Secelle and Albrecht Heeffer (albrecht.heeffer(AT)pandora.be), Mar 09 2002

Keywords

Comments

One of eight possible knight's tours. Squares are numbered in a clockwise spiral. Enumerates all positive integers.

Crossrefs

A020703 Take the sequence of natural numbers (A000027) and reverse successive subsequences of lengths 1,3,5,7,...

Original entry on oeis.org

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

Views

Author

N. J. A. Sloane, May 02 2000

Keywords

Comments

Arrange A000027, the natural numbers, into a (square) spiral, say clockwise as shown in A068225. Read the numbers from the resulting counterclockwise spiral of the same shape that also begins with 1 and this sequence results. - Rick L. Shepherd, Aug 04 2006
Contribution from Hieronymus Fischer, Apr 30 2012: (Start)
The sequence may also be defined as follows: a(1)=1, a(n)=m^2 (where m^2 is the least square > a(k) for 1<=k
A reordering of the natural numbers.
The sequence is self-inverse in that a(a(n))=n.
(End)

Examples

			a(2)=4=2^2, since 2^2 is the least square >2=a(1) and the minimal number not yet in the sequence is 2>1=a(1);
a(8)=6=a(7)-1, since the minimal number not yet in the sequence (=5) is <=7=a(7).
		

References

  • R. Honsberger, "Ingenuity in Mathematics", Table 10.4 on page 87.
  • Suggested by correspondence with Michael Somos.

Crossrefs

A self-inverse permutation of the natural numbers.

Programs

  • Mathematica
    Flatten[Table[Range[n^2,(n-1)^2+1,-1],{n,10}]] (* Harvey P. Dale, Jan 10 2016 *)
    With[{nn=20},Flatten[Reverse/@TakeList[Range[nn^2],Range[1,nn,2]]]] (* Requires Mathematica version 11 or later *) (* Harvey P. Dale, Jan 28 2019 *)
  • PARI
    a(n)=local(t); if(n<1,0,t=sqrtint(n-1); 2*(t^2+t+1)-n)

Formula

Contribution from Hieronymus Fischer, Apr 30 2012: (Start)
a(n)=a(n-1)-1, if a(n-1)-1 > 0 is not in the set {a(k)| 1<=k
a(n)=n for n=k(k+1)+1, k>=0.
a(n+1)=(sqrt(a(n)-1)+2)^2, if a(n)-1 is a square, a(n+1)=a(n)-1, else.
a(n)=2*(floor(sqrt(n-1))+1)*floor(sqrt(n-1))-n+2. (End)

A068610 Path of a knight's tour on an infinite chessboard.

Original entry on oeis.org

1, 18, 7, 24, 11, 14, 5, 20, 23, 10, 3, 16, 19, 22, 9, 12, 15, 6, 21, 8, 25, 2, 13, 4, 17, 66, 39, 70, 43, 76, 47, 80, 51, 28, 55, 58, 33, 62, 37, 68, 41, 72, 75, 46, 79, 50, 27, 54, 31, 60, 35, 64, 67, 40, 71, 74, 45, 78, 49, 52
Offset: 0

Author

Hans Secelle and Albrecht Heeffer (albrecht.heeffer(AT)pandora.be), Mar 09 2002

Keywords

Comments

One of eight possible knight's tours. Squares are numbered in a clockwise spiral. Enumerates all positive integers.

A068609 Path of a knight's tour on an infinite chessboard.

Original entry on oeis.org

1, 14, 5, 20, 23, 10, 3, 16, 19, 22, 9, 12, 15, 18, 7, 24, 11, 4, 17, 6, 21, 8, 25, 2, 13, 58, 33, 62, 37, 68, 41, 72, 75, 46, 79, 50, 27, 54, 31, 60, 35, 64, 67, 40, 71, 74, 45, 78, 49, 52, 29, 56, 59, 34, 63, 66, 39, 70, 43, 76
Offset: 0

Author

Hans Secelle and Albrecht Heeffer (albrecht.heeffer(AT)pandora.be), Mar 09 2002

Keywords

Comments

One of eight possible knight's tours. Squares are numbered in a clockwise spiral. Enumerates all positive integers.

Extensions

a(56), which had been shown as 37, corrected to 39 by Kevin Ryde, Jan 17 2012
Showing 1-10 of 18 results. Next