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 21-30 of 56 results. Next

A080335 Diagonal in square spiral or maze arrangement of natural numbers.

Original entry on oeis.org

1, 5, 9, 17, 25, 37, 49, 65, 81, 101, 121, 145, 169, 197, 225, 257, 289, 325, 361, 401, 441, 485, 529, 577, 625, 677, 729, 785, 841, 901, 961, 1025, 1089, 1157, 1225, 1297, 1369, 1445, 1521, 1601, 1681, 1765, 1849, 1937, 2025, 2117, 2209, 2305, 2401, 2501
Offset: 0

Views

Author

Paul Barry, Mar 19 2003

Keywords

Comments

Interleaves the odd squares A016754 with (1+4n^2), A053755.
Squares of positive integers (plus 1 if n is odd). - Wesley Ivan Hurt, Oct 10 2013
a(n) is the maximum total number of queens that can coexist without attacking each other on an [n+3] X [n+3] chessboard, when the lone queen is in the most vulnerable position on the board. Specifically, the lone queen will placed in any center position, facing an opponent's "army" of size a(n)-1 == A137932(n+2). - Bob Selcoe, Feb 12 2015
a(n) is also the edge chromatic number of the complement of the (n+2) X (n+2) rook graph. - Eric W. Weisstein, Jan 31 2024

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) = (3 + 4*n + 2*n^2 - (-1)^n)/2.
a(2*n) = A016754(n), a(2*n+1) = A053755(n+1).
E.g.f.: exp(x)*(2 + 3*x + x^2) - cosh(x). The sequence 1,1,5,9,... is given by n^2+(1+(-1)^n)/2 with e.g.f. exp(1+x+x^2)*exp(x)-sinh(x). - Paul Barry, Sep 02 2003 and Sep 19 2003
a(0)=1, a(1)=5, a(2)=9, a(3)=17, a(n) = 2*a(n-1) - 2*a(n-3) + a(n-4). - Harvey P. Dale, Jan 29 2012
a(n)+(-1)^n = A137928(n+1). - Philippe Deléham, Feb 17 2012
G.f.: (1 + 3*x - x^2 + x^3)/((1-x)^3*(1+x)). - Colin Barker, Mar 18 2012
a(n) = A000035(n) + A000290(n+1). - Wesley Ivan Hurt, Oct 10 2013
From Bob Selcoe, Feb 12 2015: (Start)
a(n) = A137932(n+2) + 1.
a(n) = (n+1)^2 when n is even; a(n) = (n+1)^2 + 1 when n is odd.
a(n) = A002378(n+2) - A047238(n+3) + 1.
(End)
Sum_{n>=0} 1/a(n) = Pi*coth(Pi/2)/4 + Pi^2/8 - 1/2. - Amiram Eldar, Jul 07 2022

A137932 Terms in an n X n spiral that do not lie on its principal diagonals.

Original entry on oeis.org

0, 0, 0, 4, 8, 16, 24, 36, 48, 64, 80, 100, 120, 144, 168, 196, 224, 256, 288, 324, 360, 400, 440, 484, 528, 576, 624, 676, 728, 784, 840, 900, 960, 1024, 1088, 1156, 1224, 1296, 1368, 1444, 1520, 1600, 1680, 1764, 1848, 1936, 2024, 2116, 2208, 2304, 2400, 2500, 2600, 2704, 2808
Offset: 0

Views

Author

William A. Tedeschi, Feb 29 2008

Keywords

Comments

The count of terms not on the principal diagonals is always even.
The last digit is the repeating pattern 0,0,0,4,8,6,4,6,8,4, which is palindromic if the leading 0's are removed, 4864684.
The sum of the last digits is 40, which is the count of the pattern times 4.
A 4 X 4 spiral is the only spiral, aside from a 0 X 0, whose count of terms that do not lie on its principal diagonals equal the count of terms that do [A137932(4) = A042948(4)] making the 4 X 4 the "perfect spiral".
Yet another property is mod(a(n), A042948(n)) = 0 iff n is even. This is a large family that includes the 4 X 4 spiral.
a(n) is the maximum number of queens of one color that can coexist without attacking one queen of the opponent's color on an [n+1] X [n+1] chessboard, when the lone queen is in the most vulnerable position on the board, i.e., on a center square. - Bob Selcoe, Feb 12 2015
Also the circumference of the (n-1) X (n-1) grid graph for n > 2. - Eric W. Weisstein, Mar 25 2018
Also the crossing number of the complete bipartite graph K_{5,n}. - Eric W. Weisstein, Sep 11 2018

Examples

			a(0) = 0^2 - (2(0) - mod(0,2)) = 0.
a(3) = 3^2 - (2(3) - mod(3,2)) = 4.
		

Crossrefs

Cf. A042948.
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) = n^2 - (2*n - mod(n,2)) = n^2 - A042948(n).
a(n) = 2*A007590(n-1). - Enrique Pérez Herrero, Jul 04 2012
G.f.: -4*x^3 / ( (1+x)*(x-1)^3 ). a(n) = 4*A002620(n-1). - R. J. Mathar, Jul 06 2012
From Bob Selcoe, Feb 12 2015: (Start)
a(n) = (n-1)^2 when n is odd; a(n) = (n-1)^2 - 1 when n is even.
a(n) = A002378(n) - A047238(n+1). (End)
From Amiram Eldar, Mar 20 2022: (Start)
Sum_{n>=3} 1/a(n) = Pi^2/24 + 1/4.
Sum_{n>=3} (-1)^(n+1)/a(n) = Pi^2/24 - 1/4. (End)
E.g.f.: x*(x - 1)*cosh(x) + (x^2 - x + 1)*sinh(x). - Stefano Spezia, Oct 17 2022

A156859 The main column of a version of the square spiral.

Original entry on oeis.org

0, 3, 7, 14, 22, 33, 45, 60, 76, 95, 115, 138, 162, 189, 217, 248, 280, 315, 351, 390, 430, 473, 517, 564, 612, 663, 715, 770, 826, 885, 945, 1008, 1072, 1139, 1207, 1278, 1350, 1425, 1501, 1580, 1660, 1743, 1827, 1914, 2002, 2093, 2185, 2280, 2376, 2475, 2575
Offset: 0

Views

Author

Emilio Apricena (emilioapricena(AT)yahoo.it), Feb 17 2009

Keywords

Comments

This spiral is sometimes called an Ulam spiral, but square spiral is a better name. - N. J. A. Sloane, Jul 27 2018
It is easy to see that the only two primes in the sequence are 3, 7. Therefore the primes of the version of Ulam spiral are divided into four parts (see also A035608): northeast (NE), northwest (NW), southwest (SW), and southeast (SE).
Number of pairs (x,y) having x and y of opposite parity with x in {0,...,n} and y in {0,...,2n}. - Clark Kimberling, Jul 02 2012
Partial Sums of A014601(n). - Wesley Ivan Hurt, Oct 11 2013

Crossrefs

Cf. A000290, A000384, A004526, A014601 (first differences), A115258.
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) = n^2 + n + floor((n+1)/2) = A002378(n) + A004526(n+1) = A002620(n+1) + 3*A002620(n).
From R. J. Mathar, Feb 20 2009: (Start)
G.f.: x*(3+x)/((1+x)*(1-x)^3).
a(n) = 2*a(n-1) - 2*a(n-3) + a(n-4). (End)
a(n-1) = floor(n/(e^(1/n)-1)). - Richard R. Forberg, Jun 19 2013
a(n) = A000290(n+1) + A004526(-n-1). - Wesley Ivan Hurt, Jul 15 2013
a(n) + a(n+1) = A014105(n+1). - R. J. Mathar, Jul 15 2013
a(n) = floor(A000384(n+1)/2). - Bruno Berselli, Nov 11 2013
E.g.f.: (x*(5 + 2*x)*cosh(x) + (1 + 5*x + 2*x^2)*sinh(x))/2. - Stefano Spezia, Apr 24 2024
Sum_{n>=1} 1/a(n) = 4/9 + 2*log(2) - Pi/3. - Amiram Eldar, Apr 26 2024

Extensions

More terms added by Wesley Ivan Hurt, Oct 11 2013

A317186 One of many square spiral sequences: a(n) = n^2 + n - floor((n-1)/2).

Original entry on oeis.org

1, 2, 6, 11, 19, 28, 40, 53, 69, 86, 106, 127, 151, 176, 204, 233, 265, 298, 334, 371, 411, 452, 496, 541, 589, 638, 690, 743, 799, 856, 916, 977, 1041, 1106, 1174, 1243, 1315, 1388, 1464, 1541, 1621, 1702, 1786, 1871, 1959, 2048, 2140, 2233, 2329, 2426
Offset: 0

Views

Author

N. J. A. Sloane, Jul 27 2018

Keywords

Comments

Draw a square spiral on a piece of graph paper, and label the cells starting at the center with the positive (resp. nonnegative) numbers. This produces two versions of the labeled square spiral, shown in the Example section below.
The spiral may proceed clockwise or counterclockwise, and the first arm of the spiral may be along any of the four axes, so there are eight versions of each spiral. However, this has no effect on the resulting sequences, and it is enough to consider just two versions of the square spiral (starting at 1 or starting at 0).
The present sequence is obtained by reading alternate entries on the X-axis (say) of the square spiral started at 1.
The cross-references section lists many sequences that can be read directly off the two spirals. Many other sequences can be obtained from them by using them to extract subsequences from other important sequences. For example, the subsequence of primes indexed by the present sequence gives A317187.
a(n) is also the number of free polyominoes with n + 4 cells whose difference between length and width is n. In this comment the length is the longer of the two dimensions and the width is the shorter of the two dimensions (see the examples of polyominoes). Hence this is also the diagonal 4 of A379625. - Omar E. Pol, Jan 24 2025
From John Mason, Feb 19 2025: (Start)
The sequence enumerates polyominoes of width 2 having precisely 2 horizontal bars. By classifying such polyominoes according to the following templates, it is possible to define a formula that reduces to the one below:
.
OO O O
O OO OO
O O O
O O OO
OO OO O
.
(End)

Examples

			The square spiral when started with 1 begins:
.
  100--99--98--97--96--95--94--93--92--91
                                        |
   65--64--63--62--61--60--59--58--57  90
    |                               |   |
   66  37--36--35--34--33--32--31  56  89
    |   |                       |   |   |
   67  38  17--16--15--14--13  30  55  88
    |   |   |               |   |   |   |
   68  39  18   5---4---3  12  29  54  87
    |   |   |   |       |   |   |   |   |
   69  40  19   6   1---2  11  28  53  86
    |   |   |   |           |   |   |   |
   70  41  20   7---8---9--10  27  52  85
    |   |   |                   |   |   |
   71  42  21--22--23--24--25--26  51  84
    |   |                           |   |
   72  43--44--45--46--47--48--49--50  83
    |                                   |
   73--74--75--76--77--78--79--80--81--82
.
For the square spiral when started with 0, subtract 1 from each entry. In the following diagram this spiral has been reflected and rotated, but of course that makes no difference to the sequences:
.
   99  64--65--66--67--68--69--70--71--72
    |   |                               |
   98  63  36--37--38--39--40--41--42  73
    |   |   |                       |   |
   97  62  35  16--17--18--19--20  43  74
    |   |   |   |               |   |   |
   96  61  34  15   4---5---6  21  44  75
    |   |   |   |   |       |   |   |   |
   95  60  33  14   3   0   7  22  45  76
    |   |   |   |   |   |   |   |   |   |
   94  59  32  13   2---1   8  23  46  77
    |   |   |   |           |   |   |   |
   93  58  31  12--11--10---9  24  47  78
    |   |   |                   |   |   |
   92  57  30--29--28--27--26--25  48  79
    |   |                           |   |
   91  56--55--54--53--52--51--50--49  80
    |                                   |
   90--89--88--87--86--85--84--83--82--81
.
From _Omar E. Pol_, Jan 24 2025: (Start)
For n = 0 there is only one free polyomino with 0 + 4 = 4 cells whose difference between length and width is 0 as shown below, so a(0) = 1.
   _ _
  |_|_|
  |_|_|
.
For n = 1 there are two free polyominoes with 1 + 4 = 5 cells whose difference between length and width is 1 as shown below, so a(1) = 2.
   _ _     _ _
  |_|_|   |_|_|
  |_|_|   |_|_
  |_|     |_|_|
.
(End)
		

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.
Filling in these two squares spirals with greedy algorithm: A274640, A274641.
Cf. also A317187.

Programs

  • Mathematica
    a[n_] := n^2 + n - Floor[(n - 1)/2]; Array[a, 50, 0] (* Robert G. Wilson v, Aug 01 2018 *)
    LinearRecurrence[{2, 0, -2 , 1},{1, 2, 6, 11},50] (* or *)
    CoefficientList[Series[(- x^3 - 2 * x^2 - 1) / ((x - 1)^3 * (x + 1)), {x, 0, 50}], x] (* Stefano Spezia, Sep 02 2018 *)

Formula

From Daniel Forgues, Aug 01 2018: (Start)
a(n) = (1/4) * (4 * n^2 + 2 * n + (-1)^n + 3), n >= 0.
a(0) = 1; a(n) = - a(n-1) + 2 * n^2 - n + 2, n >= 1.
a(0) = 1; a(1) = 2; a(2) = 6; a(3) = 11; a(n) = 2 * a(n-1) - 2 * a(n-3) + a(n-4), n >= 4.
G.f.: (- x^3 - 2 * x^2 - 1) / ((x - 1)^3 * (x + 1)). (End)
E.g.f.: ((2 + 3*x + 2*x^2)*cosh(x) + (1 + 3*x + 2*x^2)*sinh(x))/2. - Stefano Spezia, Apr 24 2024
a(n)+a(n+1)=A033816(n). - R. J. Mathar, Mar 21 2025
a(n)-a(n-1) = A042948(n), n>=1. - R. J. Mathar, Mar 21 2025

A267682 a(n) = 2*a(n-1) - 2*a(n-3) + a(n-4) for n > 3, with initial terms 1, 1, 4, 8.

Original entry on oeis.org

1, 1, 4, 8, 15, 23, 34, 46, 61, 77, 96, 116, 139, 163, 190, 218, 249, 281, 316, 352, 391, 431, 474, 518, 565, 613, 664, 716, 771, 827, 886, 946, 1009, 1073, 1140, 1208, 1279, 1351, 1426, 1502, 1581, 1661, 1744, 1828, 1915, 2003, 2094, 2186, 2281, 2377, 2476
Offset: 0

Views

Author

Robert Price, Jan 19 2016

Keywords

Comments

Also, total number of ON (black) cells after n iterations of the "Rule 201" elementary cellular automaton starting with a single ON (black) cell.

References

  • S. Wolfram, A New Kind of Science, Wolfram Media, 2002; p. 55.

Crossrefs

Cf. A267679.
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

  • Mathematica
    rule=201; rows=20; ca=CellularAutomaton[rule,{{1},0},rows-1,{All,All}]; (* Start with single black cell *) catri=Table[Take[ca[[k]],{rows-k+1,rows+k-1}],{k,1,rows}]; (* Truncated list of each row *) nbc=Table[Total[catri[[k]]],{k,1,rows}]; (* Number of Black cells in stage n *) Table[Total[Take[nbc,k]],{k,1,rows}] (* Number of Black cells through stage n *)
    LinearRecurrence[{2, 0, -2, 1}, {1, 1, 4, 8}, 60] (* Vincenzo Librandi, Jan 19 2016 *)
  • PARI
    Vec((1-x+2*x^2+2*x^3)/((1-x)^3*(1+x)) + O(x^100)) \\ Colin Barker, Jan 19 2016
    
  • Python
    print([n*(n-1)+n//2+1 for n in range(51)]) # Karl V. Keller, Jr., Jul 14 2021

Formula

G.f.: (1 - x + 2*x^2 + 2*x^3) / ((1-x)^3*(1+x)). - Colin Barker, Jan 19 2016
a(n) = n*(n-1) + floor(n/2) + 1. - Karl V. Keller, Jr., Jul 14 2021
E.g.f.: (exp(x)*(2 + x + 2*x^2) - sinh(x))/2. - Stefano Spezia, Jul 16 2021

Extensions

Edited by N. J. A. Sloane, Jul 25 2018, replacing definition with simpler formula provided by Colin Barker, Jan 19 2016.

A033952 Write 1,2,... in a clockwise spiral on a square lattice, writing each digit at a separate lattice point, starting with 1 at the origin and 2 at x=0, y=-1; sequence gives the numbers on the positive x-axis.

Original entry on oeis.org

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

Views

Author

Olivier Gorin (gorin(AT)roazhon.inra.fr)

Keywords

Comments

Same as the South spoke of the Champernowne spiral (A244677).

Examples

			The spiral begins
.
  3---1---4---1---5
  |               |
  1   5---6---7   1
  |   |       |   |
  2   4   1   8   6
  |   |   |   |   |
  1   3---2   9   1
  |           |   |
  1---1---0---1   7
.
		

Crossrefs

Programs

  • Mathematica
    almostNatural[n_, b_] := Block[{m = 0, d = n, i = 1, l, p}, While[m <= d, l = m; m = (b - 1) i*b^(i - 1) + l; i++]; i--; p = Mod[d - l, i]; q = Floor[(d - l)/i] + b^(i - 1); If[p != 0, IntegerDigits[q, b][[p]], Mod[q - 1, b]]];
    f[n_] := 4n^2 - 5n + 2; Array[ almostNatural[ f@#, 10] &, 105] (* Robert G. Wilson v, Aug 08 2014 *)

Extensions

More terms from Andrew J. Gacek (andrew(AT)dgi.net)
Edited by Charles R Greathouse IV, Nov 01 2009

A033988 Write 0,1,2,... in a clockwise spiral on a square lattice, writing each digit at a separate lattice point, starting with 0 at the origin and 1 at x=0, y=-1; sequence gives the numbers on the positive y-axis.

Original entry on oeis.org

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

Views

Author

Keywords

Comments

In other words, write 0 1 2 3 4 5 6 7 8 9 1 0 1 1 1 2 1 3 1 4 1 5 1 6 ... in a clockwise spiral, starting with the 0 and taking the first step south; the sequence is then picked out from the resulting spiral by starting at the origin and moving north.

Examples

			  1---3---1---4---1
  |               |
  2   4---5---6   5
  |   |       |   |
  1   3   0   7   1
  |   |   |   |   |
  1   2---1   8   6
  |           |   |
  1---0---1---9   1
.
We begin with the 0 and wrap the numbers 1 2 3 4 ... around it.
Then the sequence is obtained by reading vertically upwards, starting from the initial 0.
		

Crossrefs

Sequences based on the same spiral: A033953, A033989, A033990. Spiral without zero: A033952.
Other sequences from spirals: A001107, A002939, A007742, A033951, A033954, A033991, A002943, A033996.
Cf. A033307.

Programs

Formula

a(n) = A033307(4*n^2 + n - 1) for n > 0. - Andrew Woods, May 18 2012

Extensions

More terms from Andrew Gacek (andrew(AT)dgi.net)
Edited by Jon E. Schoenfield, Aug 12 2018

A033989 Write 0,1,2,... in a clockwise spiral on a square lattice, writing each digit at a separate lattice point, starting with 0 at the origin and 1 at x=0, y=-1; sequence gives the numbers on the negative x-axis.

Original entry on oeis.org

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

Views

Author

Keywords

Examples

			  2---3---2---4---2---5---2
  |                       |
  2   1---3---1---4---1   6
  |   |               |   |
  2   2   4---5---6   5   2
  |   |   |       |   |   |
  1   1   3   0   7   1   7
  |   |   |   |   |   |   |
  2   1   2---1   8   6   2
  |   |           |   |   |
  0   1---0---1---9   1   8
  |                   |   |
  2---9---1---8---1---7   2
We begin with the 0 and wrap the numbers 1 2 3 4 ... around it. Then the sequence is obtained by reading leftwards, starting from the initial 0. - _Andrew Woods_, May 20 2012
		

Crossrefs

Sequences based on the same spiral: A033953, A033988, A033990. Spiral without zero: A033952.
Other sequences from spirals: A001107, A002939, A007742, A033951, A033954, A033991, A002943, A033996, A033988.

Programs

Formula

a(n) = A033307(4*n^2-n-1) for n > 0. - Andrew Woods, May 20 2012

Extensions

More terms from Andrew J. Gacek (andrew(AT)dgi.net)
Edited by Charles R Greathouse IV, Nov 01 2009

A115258 Isolated primes in Ulam's lattice (1, 2, ... in spiral).

Original entry on oeis.org

83, 101, 127, 137, 163, 199, 233, 311, 373, 443, 463, 491, 541, 587, 613, 631, 641, 659, 673, 683, 691, 733, 757, 797, 859, 881, 911, 919, 953, 971, 991, 1013, 1051, 1061, 1103, 1109, 1117, 1193, 1201, 1213, 1249, 1307, 1319, 1409, 1433, 1459, 1483, 1487
Offset: 1

Views

Author

Keywords

Comments

Isolated prime numbers have no adjacent primes in a lattice generated by writing consecutive integers starting from 1 in a spiral distribution. If n0 is the number of isolated primes and p the number of primes less than N, the ratio n0/p approaches 1 as N increases. If n1, n2, n3, n4 denote the number of primes with respectively 1, 2, 3, 4 adjacent primes in the lattice, the ratios n1/n0, n2/n1, n3/n2, n4/n3 approach 0 as N increases. The limits stand for any 2D lattice of integers generated by a priori criteria (i.e., not knowing distributions of primes) as Ulam's lattice.

Examples

			83 is an isolated prime as the adjacent numbers in lattice 50, 51, 81, 82, 84, 123, 124, 125 are not primes.
From _Michael De Vlieger_, Dec 22 2015: (Start)
Spiral including n <= 17^2 showing only primes, with the isolated primes in parentheses (redrawn by _Jon E. Schoenfield_, Aug 06 2017):
  257 .  .  .  .  . 251 .  .  .  .  .  .  .  .  . 241
   . 197 .  .  . 193 . 191 .  .  .  .  .  .  .  .  .
   .  .  .  .  .  .  .  . 139 .(137).  .  .  .  . 239
   .(199).(101).  .  . 97  .  .  .  .  .  .  . 181 .
   .  .  .  .  .  .  .  . 61  . 59  .  .  . 131 .  .
   .  .  . 103 . 37  .  .  .  .  . 31  . 89  . 179 .
  263 . 149 . 67  . 17  .  .  . 13  .  .  .  .  .  .
   .  .  .  .  .  .  .  5  .  3  . 29  .  .  .  .  .
   .  . 151 .  .  . 19  .  .  2 11  . 53  .(127).(233)
   .  .  . 107 . 41  .  7  .  .  .  .  .  .  .  .  .
   .  .  .  . 71  .  .  . 23  .  .  .  .  .  .  .  .
   .  .  . 109 . 43  .  .  . 47  .  .  .(83) . 173 .
  269 .  .  . 73  .  .  .  .  . 79  .  .  .  .  . 229
   .  .  .  .  . 113 .  .  .  .  .  .  .  .  .  .  .
  271 . 157 .  .  .  .  .(163).  .  . 167 .  .  . 227
   . 211 .  .  .  .  .  .  .  .  .  .  . 223 .  .  .
   .  .  .  . 277 .  .  . 281 . 283 .  .  .  .  .  .
(End)
		

References

  • G. Balzarotti and P. P. Lava, Le sequenze di numeri interi, Hoepli, 2008, p. 22.

Crossrefs

Cf. A113688 (isolated semiprimes in the semiprime spiral), A156859.

Programs

  • Maple
    # A is Ulam's lattice
    if (isprime(A[x,y])and(not(isprime(A[x+1,y]) or isprime(A[x-1,y])or isprime(A[x,y+1])or isprime(A[x,y-1])or isprime(A[x-1,y-1])or isprime(A[x+1,y+1])or isprime(A[x+1,y-1])or isprime(A[x-1,y+1])))) then print (A[x,y]) ; fi;
  • Mathematica
    spiral[n_] := Block[{o = 2 n - 1, t, w}, t = Table[0, {o}, {o}]; t = ReplacePart[t, {n, n} -> 1]; Do[w = Partition[Range[(2 (# - 1) - 1)^2 + 1, (2 # - 1)^2], 2 (# - 1)] &@ k; Do[t = ReplacePart[t, {(n + k) - (j + 1), n + (k - 1)} -> #[[1, j]]]; t = ReplacePart[t, {n - (k - 1), (n + k) - (j + 1)} -> #[[2, j]]]; t = ReplacePart[t, {(n - k) + (j + 1), n - (k - 1)} -> #[[3, j]]]; t = ReplacePart[t, {n + (k - 1), (n - k) + (j + 1)} -> #[[4, j]]], {j, 2 (k - 1)}] &@ w, {k, 2, n}]; t]; f[w_] := Block[{d = Dimensions@ w, t, g}, t = Reap[Do[Sow@ Take[#[[k]], {2, First@ d - 1}], {k, 2, Last@ d - 1}]][[-1, 1]] &@ w; g[n_] := If[n != 0, Total@ Join[Take[w[[Last@ # - 1]], {First@ # - 1, First@ # + 1}], {First@ #, Last@ #} &@ Take[w[[Last@ #]], {First@ # - 1, First@ # + 1}], Take[w[[Last@ # + 1]], {First@ # - 1, First@# + 1}]] &@(Reverse@ First@ Position[t, n] + {1, 1}) == 0, False]; Select[Union@ Flatten@ t, g@ # &]]; f[spiral@ 21 /. n_ /; CompositeQ@ n -> 0] (* Michael De Vlieger, Dec 22 2015, Version 10 *)

A078510 Spiro-Fibonacci numbers, a(n) = sum of two previous terms that are nearest when terms arranged in a spiral.

Original entry on oeis.org

0, 1, 1, 1, 1, 1, 1, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 18, 21, 24, 27, 31, 36, 42, 48, 54, 61, 69, 78, 88, 98, 108, 119, 131, 144, 158, 172, 186, 201, 217, 235, 256, 280, 304, 328, 355, 386, 422, 464, 512, 560, 608, 662, 723, 792, 870, 958, 1056
Offset: 0

Views

Author

Neil Fernandez, Jan 05 2003

Keywords

Comments

Or "Spironacci numbers" for short. See also Spironacci polynomials, A265408. This sequence has an interesting growth rate, see A265370 and A265404. - Antti Karttunen, Dec 13 2015

Examples

			Terms are written in square boxes radiating spirally (cf. Ulam prime spiral). a(0)=0 and a(1)=1, so write 0 and then 1 to its right. a(2) goes in the box below a(1). The nearest two filled boxes contain a(0) and a(1), so a(2)=a(0)+a(1)=0+1=1. a(3) goes in the box to the left of a(2). The nearest two filled boxes contain a(0) and a(2), so a(3)=a(0)+a(2)=0+1=1.
From _Antti Karttunen_, Dec 17 2015: (Start)
The above description places cells in clockwise direction. However, for the computation of this sequence the actual orientation of the spiral is irrelevant. Following the convention used at A265409, we draw this spiral counterclockwise:
+--------+--------+--------+--------+
|a(15)   |a(14)   |a(13)   |a(12)   |
| = a(14)| = a(13)| = a(12)| = a(11)|
| + a(4) | + a(3) | + a(2) | + a(2) |
| = 9    | = 8    | = 7    | = 6    |
+--------+--------+--------+--------+
|a(4)    |a(3)    |a(2)    |a(11)   |
| = a(3) | = a(2) | = a(1) | = a(10)|
| + a(0) | + a(0) | + a(0) | + a(2) |
| = 1    | = 1    | = 1    | = 5    |
+--------+--------+--------+--------+
|a(5)    | START  |   ^    |a(10)   |
| = a(4) | a(0)=0 | a(1)=1 | = a(9) |
| + a(0) |   -->  |        | + a(1) |
| = 1    |        |        | = 4    |
+--------+--------+--------+--------+
|a(6)    |a(7)    |a(8)    |a(9)    |
| = a(5) | = a(6) | = a(7) | = a(8) |
| + a(0) | + a(0) | + a(1) | + a(1) |
| = 1    | = 1    | = 2    | = 3    |
+--------+--------+--------+--------+
(End)
		

Crossrefs

Formula

From Antti Karttunen, Dec 13 2015: (Start)
a(0) = 0, a(1) = 1; for n > 1, a(n) = a(n-1) + a(A265409(n)).
equally, for n > 1, a(n) = a(n-1) + a(n - A265359(n)).
a(n) = A001222(A265408(n)).
(End)
Previous Showing 21-30 of 56 results. Next