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 31-40 of 56 results. Next

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.

A244677 The spiral of Champernowne, read along the East ray.

Original entry on oeis.org

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

Views

Author

Robert G. Wilson v, Jul 04 2014

Keywords

Comments

Inspired by Stanislaw Ulam's spiral, circa 1963.

Examples

			The beginning of the infinite spiral of David Gawen Champernowne:
.
  7--1--9--6--1--8--6--1--7--6--1--6--6--1--5--6--1--4--6--1--3  .
  |                                                           |  |
  0  1--4--4--1--3--4--1--2--4--1--1--4--1--0--4--1--9--3--1  6  .
  |  |                                                     |  |  |
  1  4  2--1--1--2--1--0--2--1--9--1--1--8--1--1--7--1--1  8  1  .
  |  |  |                                               |  |  |  |
  7  5  2  0--1--1--0--1--0--0--1--9--9--8--9--7--9--6  6  3  2  9
  |  |  |  |                                         |  |  |  |  |
  1  1  1  2  7--7--6--7--5--7--4--7--3--7--2--7--1  9  1  1  6  8
  |  |  |  |  |                                   |  |  |  |  |  |
  1  4  2  1  7  5--5--4--5--3--5--2--5--1--5--0  7  5  1  7  1  1
  |  |  |  |  |  |                             |  |  |  |  |  |  |
  7  6  3  0  8  5  7--3--6--3--5--3--4--3--3  5  0  9  5  3  1  8
  |  |  |  |  |  |  |                       |  |  |  |  |  |  |  |
  2  1  1  3  7  6  3  3--2--2--2--1--2--0  3  9  7  4  1  1  6  8
  |  |  |  |  |  |  |  |                 |  |  |  |  |  |  |  |  |
  1  4  2  1  9  5  8  2  3--1--2--1--1  2  2  4  9  9  1  6  1  1
  |  |  |  |  |  |  |  |  |           |  |  |  |  |  |  |  |  |  |
  7  7  4  0  8  7  3  4  1  5--4--3  1  9  3  8  6  3  4  3  0  7
  |  |  |  |  |  |  |  |  |  |     |  |  |  |  |  |  |  |  |  |  |
  3  1  1  4  0  5  9  2  4  6  1--2  0  1  1  4  8  9  1  1  6  8
  |  |  |  |  |  |  |  |  |  |        |  |  |  |  |  |  |  |  |  |
  1  4  2  1  8  8  4  5  1  7--8--9--1  8  3  7  6  2  1  5  1  1
  |  |  |  |  |  |  |  |  |              |  |  |  |  |  |  |  |  |
  7  8  5  0  1  5  0  2  5--1--6--1--7--1  0  4  7  9  3  3  9  6
  |  |  |  |  |  |  |  |                    |  |  |  |  |  |  |  |
  4  1  1  5  8  9  4  6--2--7--2--8--2--9--3  6  6  1  1  1  5  8
  |  |  |  |  |  |  |                          |  |  |  |  |  |  |
  1  4  2  1  2  6  1--4--2--4--3--4--4--4--5--4  6  9  1  4  1  1
  |  |  |  |  |  |                                |  |  |  |  |  |
  7  9  6  0  8  0--6--1--6--2--6--3--6--4--6--5--6  0  2  3  8  5
  |  |  |  |  |                                      |  |  |  |  |
  5  1  1  6  3--8--4--8--5--8--6--8--7--8--8--8--9--9  1  1  5  8
  |  |  |  |                                            |  |  |  |
  1  5  2  1--0--7--1--0--8--1--0--9--1--1--0--1--1--1--1  3  1  1
  |  |  |                                                  |  |  |
  7  0  7--1--2--8--1--2--9--1--3--0--1--3--1--1--3--2--1--3  7  4
  |  |                                                        |  |
  6  1--5--1--1--5--2--1--5--3--1--5--4--1--5--5--1--5--6--1--5  8
  |                                                              |
  1--7--7--1--7--8--1--7--9--1--8--0--1--8--1--1--8--2--1--8--3--1
		

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 - 11n + 8 (* see formula section *); Array[ almostNatural[ f@#, 10] &, 105]

Formula

Formulas for rays in directions of 32 compass points:
SE 4n^2 -4n +1
SExS 64n^2 -113n +50
SSE 16n^2 -25n +10
SxE 64n^2 -115n +52
S 4n^2 -5n +2
SxW 64n^2 -117n +54
SSW 16n^2 -27n +12
SWxS 64n^2 -119n +56
SW 4n^2 -6n +3
SWxW 64n^2 -121n +58
WSW 16n^2 -29n +14
WxS 64n^2 -123n +60
W 4n^2 -7n +4
WxN 64n^2 -125n +62
WNW 16n^2 -31n +16
NWxW 64n^2 -127n +64
NW 4n^2 -8n +5
NWxN 64n^2 -129n +66
NNW 16n^2 -33n +18
NxW 64n^2 -131n +68
N 4n^2 -9n +6
NxE 64n^2 -133n +70
NNE 16n^2 -35n +20
NExN 64n^2 -135n +72
NE 4n^2 -10n +7
NExE 64n^2 -137n +74
ENE 16n^2 -37n +22
ExN 64n^2 -139n +76
E 4n^2 -11n +8
ExS 64n^2 -141n +78
ESE 16n^2 -39n +24
SExE 64n^2 -143n +80

A068225 Neighbor in 1-2 direction of numbers arranged as clockwise spiral.

Original entry on oeis.org

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

Views

Author

Frank Ellermann, Feb 22 2002

Keywords

Examples

			For example, if the spiral is oriented such that 1 is immediately to the right of 2, as shown below, then a(2) = 11 because 11 is immediately to the right of 2.
  21--22--23--24--25--26
  |                    |
  20  7---8---9---10  27
  |   |            |   |
  19  6   1---2   11  28
  |   |       |    |   |
  18  5---4---3   12  29
  |                |   |
  17--16--15--14--13  30
                       |
  36--35--34--33--32--31
		

Crossrefs

Cf. A068226 (inverse, left), A334751 (above), A334752 (below).
Cf. A054552 (middle row right), A054567 (middle row left).

A054925 a(n) = ceiling(n*(n-1)/4).

Original entry on oeis.org

0, 0, 1, 2, 3, 5, 8, 11, 14, 18, 23, 28, 33, 39, 46, 53, 60, 68, 77, 86, 95, 105, 116, 127, 138, 150, 163, 176, 189, 203, 218, 233, 248, 264, 281, 298, 315, 333, 352, 371, 390, 410, 431, 452, 473, 495, 518, 541, 564, 588, 613, 638, 663, 689, 716, 743, 770, 798
Offset: 0

Views

Author

N. J. A. Sloane, May 24 2000

Keywords

Comments

Number of edges in "median" graph - gives positions of largest entries in rows of table in A054924.
Form the clockwise spiral starting 0,1,2,....; then A054925(n+1) interleaves 2 horizontal (A033951, A033991) and 2 vertical (A007742, A054552) branches. A bisection is A014848. - Paul Barry, Oct 08 2007
Consider the standard 4-dimensional Euclidean lattice. We take 1 step along the positive x-axis, 2 along the positive y-axis, 3 along the positive z-axis, 4 along the positive t-axis, and then back round to the x-axis. This sequence gives the floor of the Euclidean distance to the origin after n steps. - Jon Perry, Apr 16 2013
Jon Perry's JavaScript code is explained by A238604. - Michael Somos, Mar 01 2014
Ceiling of the area under the polygon connecting the lattice points (n, floor(n/2)) from 0..n. - Wesley Ivan Hurt, Jun 09 2014
Ceiling of one-half of each triangular number. - Harvey P. Dale, Oct 03 2016
For n > 2, also the edge cover number of the (n-1)-triangular honeycomb queen graph. - Eric W. Weisstein, Jul 14 2017
Conjecture: For n>11, there always exists a prime number p such that a(n)Raul Prisacariu, Sep 01 2024
For n = 1 up to at least n = 13, also the lower matching number of the triangular honeycomb bishop graph. - Eric W. Weisstein, Dec 13 2024
Conjecturally, apart from the first term, the sequence terms are the exponents in the expansion of Sum_{n >= 0} q^(3*n) * (Product_{k >= 2*n+1} 1 - q^k) = 1 - q - q^2 + q^3 + q^5 - q^8 - q^11 + + - - .... Cf. A039825. - Peter Bala, Apr 13 2025

Examples

			a(6) = 8; ceiling(6*(6-1)/4) = ceiling(30/4) = 8.
G.f. = x^2 + 2*x^3 + 3*x^4 + 5*x^5 + 8*x^6 + 11*x^7 + 14*x^8 + 18*x^9 + 23*x^10 + ...
		

Crossrefs

Programs

  • JavaScript
    p=new Array(0,0,0,0);
    for (a=0;a<100;a++) {
    p[a%4]+=a;
    document.write(Math.floor(Math.sqrt(p[0]*p[0]+p[1]*p[1]+p[2]*p[2]+p[3]*p[3]))+", ");
    } /* Jon Perry, Apr 16 2013 */
    
  • Magma
    [ Ceiling(n*(n-1)/4) : n in [0..50] ]; // Wesley Ivan Hurt, Jun 09 2014
    
  • Magma
    I:=[0,0,1,2,3]; [n le 5 select I[n] else 3*Self(n-1)-4*Self(n-2)+4*Self(n-3)-3*Self(n-4)+Self(n-5): n in [1..60]]; // Vincenzo Librandi, Jul 14 2015
  • Maple
    seq(ceil(binomial(n,2)/2), n=0..57); # Zerinvary Lajos, Jan 12 2009
  • Mathematica
    Table[Ceiling[(n^2 - n)/4], {n, 0, 20}] (* Wesley Ivan Hurt, Nov 01 2013 *)
    LinearRecurrence[{3, -4, 4, -3, 1}, {0, 0, 1, 2, 3}, 60] (* Vincenzo Librandi, Jul 14 2015 *)
    Join[{0}, Ceiling[#/2] &/ @ Accumulate[Range[0, 60]]] (* Harvey P. Dale, Oct 03 2016 *)
    Ceiling[Binomial[Range[0, 20], 2]/2] (* Eric W. Weisstein, Dec 13 2024 *)
    Table[Ceiling[Binomial[n, 2]/2], {n, 0, 20}] (* Eric W. Weisstein, Dec 13 2024 *)
    Table[(1 + (n - 1) n - Cos[n Pi/2] - Sin[n Pi/2])/4, {n, 0, 20}] (* Eric W. Weisstein, Dec 13 2024 *)
    CoefficientList[Series[x^2 (-1 + x - x^2)/((-1 + x)^3 (1 + x^2)), {x, 0, 20}], x] (* Eric W. Weisstein, Dec 13 2024 *)
  • PARI
    {a(n) = ceil( n * (n-1)/4)}; /* Michael Somos, Feb 11 2004 */
    
  • Sage
    [ceil(binomial(n,2)/2) for n in range(0,58)] # Zerinvary Lajos, Dec 01 2009
    

Formula

Euler transform of length 6 sequence [ 2, 0, 1, 1, 0, -1]. - Michael Somos, Sep 02 2006
From Michael Somos, Feb 11 2004: (Start)
G.f.: x^2 * (x^2 - x + 1) / ((1 - x)^3 * (1 + x^2)) = x^2 * (1 - x^6) / ((1 - x)^2 * (1 - x^3) * (1 - x^4)).
a(1-n) = a(n).
A011848(n) = a(-n). (End)
From Michael Somos, Mar 01 2014: (Start)
a(n + 4) = a(n) + 2*n + 3.
a(n+1) = floor( sqrt( A238604(n))). (End)
a(n) = A011848(n) + A133872(n+2). - Wesley Ivan Hurt, Jun 09 2014
Sum_{n>=2} 1/a(n) = 4 - Pi + 2*Pi*sinh(sqrt(7)*Pi/4)/(sqrt(7)*(1/sqrt(2)+cosh(sqrt(7)*Pi/4))). - Amiram Eldar, Dec 23 2024

A244807 The hexagonal spiral of Champernowne, read along the East (or 90-degree) ray.

Original entry on oeis.org

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

Views

Author

Robert G. Wilson v, Jul 06 2014

Keywords

Comments

Inspired by Stanislaw M. Ulam's hexagonal spiral, circa 1963. See example section of A056105.
When A056105, A056106, A056107, A056108, A056109 & A003215 were submitted, the offsets were 0. Here the offset is 1.

Examples

			.
..................7...5...1...6...5...1...5...5...1...4
.
................1...6...3...1...5...3...1...4...3...1...3
.
..............3...1...7...1...1...6...1...1...5...1...1...3
.
............7...1...1...0...0...1...9...9...8...9...7...4...1
.
..........1...8...0...7...8...7...7...7...6...7...5...9...1...2
.
........3...1...1...9...9...5...8...5...7...5...6...7...6...1...3
.
......8...1...1...8...6...4...2...4...1...4...0...5...4...9...3...1
.
....1...9...0...0...0...3...9...2...8...2...7...4...5...7...5...1...1
.
..3...1...2...8...6...4...3...1...8...1...7...2...9...5...3...9...1...3
.
9...2...1...1...1...4...0...9...1...1...0...1...6...3...4...7...4...2...1
.
..0...0...8...6...4...3...2...1...4...3...1...6...2...8...5...2...9...1...0
.
1...3...2...2...5...1...0...2...5...1...2...9...1...5...3...3...7...3...1...3
.
..2...1...8...6...4...3...2...1...6...7...8...5...2...7...5...1...9...1...1
.
....1...0...3...3...6...2...1...3...1...4...1...4...3...2...7...2...1...9
.
......1...4...8...6...4...3...2...2...2...3...2...6...5...0...9...1...2
.
........2...1...4...4...7...3...3...4...3...5...3...1...7...1...0...1
.
..........2...0...8...6...4...8...4...9...5...0...5...9...9...1...8
.
............1...5...5...5...6...6...6...7...6...8...6...0...1...2
.
..............2...1...8...6...8...7...8...8...8...9...9...9...1
.
................3...0...6...1...0...7...1...0...8...1...0...7
.
..................1...2...4...1...2...5...1...2...6...1...2
.
....................1...4...4...1...4...5...1...4...6...1
.
		

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_] := 3n^2- 8n +6 (* see formula section of A244807 *); Array[ almostNatural[ f@#, 10] &, 105]

Formula

For each 30 degrees of the compass, the corresponding spoke (or ray) has a generating formula as follows:
090: 3n^2- 8n +6
060: 12n^2-27n+16
030: 3n^2- 7n+ 5
000: 12n^2-25n+14
330: 3n^2 -6n +4
300: 12n^2-23n+12
270: 3n^2 -5n +3
240: 12n^2-21n+10
210: 3n^2 -4n +2
180: 12n^2-19n +8
150: 3n^2 -3n +1
120: 12n^2-17n+ 6
Also see formula section of A056105.

A054551 Prime number spiral (clockwise, North spoke).

Original entry on oeis.org

2, 3, 31, 107, 241, 443, 709, 1049, 1471, 1973, 2539, 3191, 3911, 4729, 5651, 6637, 7699, 8867, 10133, 11503, 12941, 14537, 16073, 17863, 19727, 21601, 23609, 25759, 27967, 30319, 32719, 35201, 37831, 40627, 43391, 46399, 49411, 52553, 55813
Offset: 0

Views

Author

Enoch Haga and G. L. Honaker, Jr. Apr 09 2000

Keywords

Comments

Smallest prime in n-th shell of prime spiral.
8-spoke wheel overlays prime number spiral; hub is 2 in shell 0; 8 spokes radiate from this hub; this is North, clockwise.
Shell 1 comprises the primes 3 5 7 11 13 17 19 23; 3 is lowest, 23 is highest.
The wheel may be rotated, but the sequences though pointing in different directions, will remain the same.

Examples

			Begin a prime number spiral at zero, proceed clockwise, North.
From _Omar E. Pol_, Feb 19 2022: (Start)
The spiral with four terms in every spoke looks like this:
.
  227  101--103--107--109--113--127
   |     |                       |
  223   97   29---31---37---41  131
   |     |    |              |   |
  211   89   23    3----5   43  137
   |     |    |    |    |    |   |
  199   83   19    2    7   47  139
   |     |    |         |    |   |
  197   79   17---13---11   53  149
   |     |                   |   |
  193   73---71---67---61---59  151
   |                             |
  191--181--179--173--167--163--157
.
(End)
		

Crossrefs

Programs

  • Mathematica
    Table[ Prime[4n^2 - 3n + 1], {n, 0, 40} ]

Formula

a(n) = A000040(A054552(n)). - R. J. Mathar, Aug 29 2018

Extensions

Edited by Robert G. Wilson v, Feb 25 2002

A168022 Noncomposite numbers in the eastern ray of the Ulam spiral as oriented on the March 1964 cover of Scientific American.

Original entry on oeis.org

1, 2, 11, 53, 127, 233, 541, 743, 977, 1871, 3511, 4001, 4523, 5077, 9851, 11503, 12377, 14221, 16193, 19391, 20521, 21683, 22877, 24103, 29327, 30713, 33581, 42953, 55343, 57241, 63127, 67211, 80231, 84827, 91961, 101921, 104491, 123377
Offset: 0

Views

Author

Alonso del Arte, Nov 16 2009

Keywords

Comments

Although 1 was not considered a prime number in Ulam's time, the March 1964 cover of Scientific American shows 1 highlighted in the same way as the primes.

Crossrefs

Cf. A054552, all numbers of the form 4n^2 - 3n + 1. Primes of northeastern ray are in A073337. Noncomposites of the northern ray are in A168023. Noncomposites of the northwestern ray are in A168024. Noncomposites of the western ray are in A168025. Noncomposites of the southwestern ray are in A168026. Noncomposites of the southern ray are in A168027.

Programs

  • Mathematica
    Select[Table[4 n^2 - 3 n + 1, {n, 0, 199}], Length[Divisors[ # ]] < 3 &]

Formula

Positive numbers of the form 4n^2 - 3n + 1 with no more than two divisors.

A033293 A Connell-like sequence: take 1 number = 1 (mod Q), 2 numbers = 2 (mod Q), 3 numbers = 3 (mod Q), etc., where Q = 8.

Original entry on oeis.org

1, 2, 10, 11, 19, 27, 28, 36, 44, 52, 53, 61, 69, 77, 85, 86, 94, 102, 110, 118, 126, 127, 135, 143, 151, 159, 167, 175, 176, 184, 192, 200, 208, 216, 224, 232, 233, 241, 249, 257, 265, 273, 281, 289, 297, 298, 306, 314, 322, 330, 338, 346, 354, 362, 370, 371, 379, 387, 395, 403, 411
Offset: 1

Views

Author

Keywords

Crossrefs

Cf. A054552 (left edge), A001107 (right edge), A204674 (row sums), A204675 (central terms).

Programs

  • Haskell
    a033293 n k = a033293_tabl !! (n-1) !! (k-1)
    a033293_row n = a033293_tabl !! (n-1)
    a033293_tabl = f 1 [1..] where
       f k xs = ys : f (k+1) (dropWhile (<= last ys) xs) where
         ys  = take k $ filter ((== 0) . (`mod` 8) . (subtract k)) xs
    -- Reinhard Zumkeller, Jan 18 2012 2011
  • Mathematica
    row[1] = {1}; row[n_] := row[n] = Table[row[n-1][[-1]] + 8k + 1, {k, 0, n-1}]; Table[row[n], {n, 1, 11}] // Flatten (* Jean-François Alcover, Jan 25 2013 *)

Extensions

More terms from jeroen.lahousse(AT)icl.com
Offset changed by Reinhard Zumkeller, Jan 18 2012

A214226 Sum of the eight nearest neighbors of n in a triangular horizontal-last spiral with positive integers.

Original entry on oeis.org

72, 80, 60, 76, 132, 100, 164, 112, 136, 200, 144, 128, 128, 136, 156, 196, 284, 220, 204, 208, 324, 224, 232, 248, 288, 384, 296, 264, 256, 264, 272, 280, 288, 296, 324, 380, 500, 404, 372, 368, 376, 384, 548, 400, 408, 416, 424, 448, 504, 632, 512, 464, 448
Offset: 1

Views

Author

Alex Ratushnyak, Jul 07 2012

Keywords

Examples

			Triangular spiral begins:
__ __ __ __ __ __ __ 43
__ __ __ __ __ __ 42 21 44
__ __ __ __ __ 41 20  7 22 45
__ __ __ __ 40 19  6  1  8 23 46
__ __ __ 39 18  5  4  3  2  9 24 47
__ __ 38 17 16 15 14 13 12 11 10 25 48
__ 37 36 35 34 33 32 31 30 29 28 27 26 49
64 63 62 61 60 69 58 57 56 55 54 53 52 51 50
The eight nearest neighbors of 3 are 6, 1, 8, 4, 2, 14, 13, 12; their sum is a(3)=60.
		

Crossrefs

Cf. A002061 - numbers on the central vertical axis.
Cf. A054552 - numbers on the axis starting with 1 and 2.
Cf. A214227 - sum of the four nearest neighbors.
Cf. A214250 - same sum in a triangular "horizontal-first" spiral.

Programs

  • Python
    SIZE=27 # must be odd
    grid = [0] * (SIZE*SIZE)
    saveX = [0]* (SIZE*SIZE)
    saveY = [0]* (SIZE*SIZE)
    saveX[1] = saveY[1] = posX = posY = SIZE//2
    grid[posY*SIZE+posX]=1
    n = 2
    def walk(stepX,stepY,chkX,chkY,chkX2,chkY2):
      global posX, posY, n
      while 1:
        posX+=stepX
        posY+=stepY
        grid[posY*SIZE+posX]=n
        saveX[n]=posX
        saveY[n]=posY
        n+=1
        if posX==0 or grid[(posY+chkY)*SIZE+posX+chkX]+grid[(posY+chkY2)*SIZE+posX+chkX2]==0:
            return
    while 1:
        walk( 1, 1, -1,  0, -1, 0)    # right+down
        walk(-1, 0,  1, -1, 0, -1)    # left
        if posX==0:
            break
        walk( 1,-1,  1, 1, 1, 1)    # right+up
    for n in range(1,101):
        posX = saveX[n]
        posY = saveY[n]
        k = grid[(posY-1)*SIZE+posX] + grid[(posY+1)*SIZE+posX]
        k+= grid[(posY-1)*SIZE+posX-1] + grid[(posY-1)*SIZE+posX+1]
        k+= grid[(posY+1)*SIZE+posX-1] + grid[(posY+1)*SIZE+posX+1]
        k+= grid[posY*SIZE+posX-1] + grid[posY*SIZE+posX+1]
        print(k, end=', ')

A185438 a(n) = 8*n^2 - 2*n + 1.

Original entry on oeis.org

1, 7, 29, 67, 121, 191, 277, 379, 497, 631, 781, 947, 1129, 1327, 1541, 1771, 2017, 2279, 2557, 2851, 3161, 3487, 3829, 4187, 4561, 4951, 5357, 5779, 6217, 6671, 7141, 7627, 8129, 8647, 9181, 9731, 10297, 10879, 11477, 12091, 12721, 13367, 14029, 14707, 15401, 16111, 16837, 17579
Offset: 0

Views

Author

Paul Curtz, Feb 03 2011

Keywords

Comments

Odd numbers (A005408) written clockwise as a square spiral:
.
41--43--45--47--49--51
| |
39 13--15--17--19 53
| | | |
37 11 1---3 21 55
| | | | |
35 9---7---5 23 57
| | |
33--31--29--27--25 59
|
71--69--67--65--63--61
.
Walking in straight lines away from the center:
1, 17, 49, ... = A069129(n+1) = 1 - 8*n + 8*n^2,
1, 3, 21, ... = A033567(n) = 1 - 6*n + 8*n^2,
1, 15, 45, ... = A014634(n) = 1 + 6*n + 8*n^2,
1, 5, 25, ... = A080856(n) = 1 - 4*n + 8*n^2,
1, 13, 41, ... = A102083(n) = 1 + 4*n + 8*n^2,
1, 7, 29, ... = a(n) = 1 - 2*n + 8*n^2,
1, 11, 37, ... = A188135(n) = 1 + 2*n + 8*n^2,
1, 9, 33, ... = A081585(n) = 1 + 8*n^2,
5, 29, 69, ... = A108928(n+1) = -3 + 8*n^2,
7, 31, 71, ... = A157914(n+1) = -1 + 8*n^2,
9, 35, 77, ... = A033566(n+1) = -1 + 2*n + 8*n^2.
All are quadrisections of sequences in A181407(n) (example: A014634(n) and A033567(n) in A064038(n+1)) or of this family (?): a(n) is a quadrisection of f(n) = 1,1,1,1,2,7,11,8,11,29,37,23,28,67,79,46,... f(n) is just before A064038(n+1) (fifth vertical) in A181407(n). The companion to a(n) is A188135(n), another quadrisection of f(n). Two last quadrisections of f(n) are A054552(n) and A033951(n).
For n >= 1, bisection of A193867. - Omar E. Pol, Aug 16 2011
Also the sequence may be obtained by starting with the segment (1, 7) followed by the line from 7 in the direction 7, 29, ... in the square spiral whose vertices are the generalized hexagonal numbers (A000217). - Omar E. Pol, Aug 01 2016

Crossrefs

Programs

Formula

a(n) = a(n-1) + 16*n - 10 (n > 0).
a(n) = 2*a(n-1) - a(n-2) + 16 (n > 1).
a(n) = 3*(n-1) - 3*a(n-2) + a(n-3) (n > 2).
G.f.: (-1 - 4*x - 11*x^2)/(x-1)^3. - R. J. Mathar, Feb 03 2011
a(n) = A014635(n) + 1. - Bruno Berselli, Apr 09 2011
E.g.f.: exp(x)*(1 + 6*x + 8*x^2). - Elmo R. Oliveira, Nov 17 2024
Previous Showing 31-40 of 56 results. Next