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

A141481 Square spiral of sums of selected preceding terms, starting at 1.

Original entry on oeis.org

1, 1, 2, 4, 5, 10, 11, 23, 25, 26, 54, 57, 59, 122, 133, 142, 147, 304, 330, 351, 362, 747, 806, 880, 931, 957, 1968, 2105, 2275, 2391, 2450, 5022, 5336, 5733, 6155, 6444, 6591, 13486, 14267, 15252, 16295, 17008, 17370, 35487, 37402, 39835, 42452, 45220
Offset: 1

Views

Author

Niclas Rantala (nrantala(AT)hotmail.com), Aug 09 2008

Keywords

Comments

Enter 1 into center position of the spiral. Repeat: Go to next position of the spiral and enter into that position the sum of the numbers in those already filled positions that are horizontally, vertically or diagonally adjacent to it.
Clockwise and counterclockwise construction of the spiral result in the same sequence.

Examples

			Clockwise constructed spiral begins
.
  362--747--806--880--931
    |
  351   11---23---25---26
    |    |              |
  330   10    1----1   54
    |    |         |    |
  304    5----4----2   57
    |                   |
  147--142--133--122---59
		

Crossrefs

Programs

  • PARI
    {m=5; h=2*m-1; A=matrix(h, h); print1(A[m, m]=1, ","); T=[[1, 0], [1, -1], [0, -1], [ -1, -1], [ -1, 0], [ -1, 1], [0, 1], [1, 1]]; for(n=1, (h-2)^2-1, g=sqrtint(n); r=(g+g%2)\2; q=4*r^2; d=n-q; if(n<=q-2*r, j=d+3*r; k=r, if(n<=q, j=r; k=-d-r, if(n<=q+2*r, j=r-d; k=-r, j=-r; k=d-3*r))); j=j+m; k=k+m; s=0; for(c=1, 8, v=[j, k]; v+=T[c]; s=s+A[v[1], v[2]]); A[j, k]=s; print1(s, ","))} \\ Klaus Brockhaus, Aug 27 2008

Extensions

Edited and extended beyond a(9) by Klaus Brockhaus, Aug 27 2008

A094769 Square spiral of sums of selected preceding terms, starting at 0 followed by 1 (a spiral Fibonacci-like sequence).

Original entry on oeis.org

0, 1, 1, 2, 4, 6, 12, 18, 37, 56, 94, 189, 285, 475, 952, 1434, 2392, 3830, 7666, 11518, 19202, 30732, 61482, 92281, 153874, 246248, 400178, 800450, 1200967, 2001985, 3203426, 5205696, 10411867, 15619275, 26034003, 41658056, 67695885, 109356333
Offset: 1

Views

Author

Yasutoshi Kohmoto, Jun 10 2004

Keywords

Comments

Enter 0 into center position and 1 into next position of the spiral. Repeat: Add to the number in the present position the numbers in all those already filled positions that are horizontally, vertically or diagonally adjacent to it, go to next position of the spiral and enter the sum into it.
a(1) = 0, a(2) = 1, a(n) = a(n-1) + Sum_{i < n-1 and a(i) is adjacent to a(n-1)} a(i).
As in A094767 eight positions are considered adjacent here.
Clockwise and counterclockwise construction of the spiral result in the same sequence.

Examples

			Clockwise constructed spiral begins
.
  19202--30732--61482--92281-153874
      |
      |
  11518     12-----18-----37-----56
      |      |                    |
      |      |                    |
   7666      6      0------1     94
      |      |             |      |
      |      |             |      |
   3830      4------2------1    189
      |                           |
      |                           |
   2392---1434----952----475----285
.
where
  a(1) = 0,
  a(2) = 1,
  a(3) = a(2) + a(1) = 1,
  a(4) = a(3) + a(2) + a(1) = 2,
  a(5) = a(4) + a(3) + a(2) + a(1) = 4,
  a(6) = a(5) + a(4) + a(1) = 6,
  a(7) = a(6) + a(5) + a(4) + a(1) = 12.
		

Crossrefs

Programs

  • PARI
    {m=5; h=2*m-1; A=matrix(h, h); print1(A[m, m]=0, ","); print1(A[m, m+1]=1, ","); pj=m; pk=m+1; T=[[1, 0], [1, -1], [0, -1], [ -1, -1], [ -1, 0], [ -1, 1], [0, 1], [1, 1]]; for(n=2, (h-2)^2-1, g=sqrtint(n); r=(g+g%2)\2; q=4*r^2; d=n-q; if(n<=q-2*r, j=d+3*r; k=r, if(n<=q, j=r; k=-d-r, if(n<=q+2*r, j=r-d; k=-r, j=-r; k=d-3*r))); j=j+m; k=k+m; s=A[pj, pk]; for(c=1, 8, v=[pj, pk]; v+=T[c]; s=s+A[v[1], v[2]]); A[j, k]=s; print1(s, ","); pj=j; pk=k)} \\ Klaus Brockhaus, Aug 27 2008

Extensions

Edited and extended beyond a(12) by Klaus Brockhaus, Aug 27 2008

A094768 Square spiral of sums of selected preceding terms, starting at 1 (a spiral Fibonacci-like sequence).

Original entry on oeis.org

1, 1, 2, 3, 6, 9, 16, 25, 42, 68, 110, 179, 291, 470, 763, 1236, 2005, 3241, 5252, 8502, 13770, 22272, 36058, 58355, 94455, 152878, 247333, 400279, 647722, 1048180, 1696193, 2744373, 4440857, 7185700, 11627320, 18814256, 30443581, 49257837
Offset: 1

Views

Author

Yasutoshi Kohmoto, Jun 10 2004

Keywords

Comments

Enter 1 into center position of the spiral. Repeat: Add to the number in the present position the numbers in all those already filled positions that are horizontally or vertically adjacent to it, go to next position of the spiral and enter the sum into it.
a(1) = 1, a(n) = a(n-1) + Sum_{i < n-1 and a(i) is adjacent to a(n-1)} a(i).
Here only four positions are considered adjacent, eight however in A094767.
Clockwise and counterclockwise construction of the spiral result in the same sequence.

Examples

			Clockwise constructed spiral begins
.
  13770--22272--36058--58355--94455
      |
      |
   8502     16-----25-----42-----68
      |      |                    |
      |      |                    |
   5252      9      1------1    110
      |      |             |      |
      |      |             |      |
   3241      6------3------2    179
      |                           |
      |                           |
   2005---1236----763----470----291
.
where
  a(2) = a(1) = 1,
  a(3) = a(2) + a(1) = 2,
  a(4) = a(3) + a(2) = 3,
  a(5) = a(4) + a(3) + a(1) = 6,
  a(6) = a(5) + a(4) = 9,
  a(7) = a(6) + a(5) + a(1) = 16.
		

Crossrefs

Programs

  • PARI
    {m=5; h=2*m-1; A=matrix(h, h); print1(A[m, m]=1, ","); pj=m; pk=m; T=[[1, 0], [0, -1], [ -1, 0], [0, 1]]; for(n=1, (h-2)^2-1, g=sqrtint(n); r=(g+g%2)\2; q=4*r^2; d=n-q; if(n<=q-2*r, j=d+3*r; k=r, if(n<=q, j=r; k=-d-r, if(n<=q+2*r, j=r-d; k=-r, j=-r; k=d-3*r))); j=j+m; k=k+m; s=A[pj, pk]; for(c=1, 4, v=[pj, pk]; v+=T[c]; s=s+A[v[1], v[2]]); A[j, k]=s; print1(s, ","); pj=j; pk=k)} \\ Klaus Brockhaus, Aug 27 2008

Extensions

Edited and extended beyond a(14) by Klaus Brockhaus, Aug 27 2008

A358429 Construct a square spiral: a(n) is the sum of all adjacent terms a(k) in the spiral for k < n; a(1) = 0, a(2) = 1.

Original entry on oeis.org

0, 1, 1, 2, 2, 4, 4, 9, 10, 11, 23, 25, 26, 54, 59, 63, 65, 134, 144, 152, 156, 321, 344, 374, 395, 406, 835, 894, 968, 1019, 1045, 2144, 2283, 2459, 2646, 2774, 2839, 5812, 6155, 6585, 7037, 7345, 7501, 15323, 16144, 17183, 18296, 19471, 20272
Offset: 1

Views

Author

Abraham C Leventhal, Nov 15 2022

Keywords

Comments

The terms "adjacent" to a(n) are terms in any of the 8 cells of the matrix which surround the cell containing a(n). See Github link for code (Python 3) which produces the matrix and sequence, and a picture of the matrix containing the first 49 terms.

Examples

			The spiral begins:
.
   65--63--59--54--26
    |               |
  134   2---2---1  25
    |   |       |   |
  ...   4   0---1  23
        |           |
        4---9--10--11
.
The last term shown is a(18) = 134 = 65 + 63 + 2 + 4, which is the sum of its adjacent earlier terms.
		

Crossrefs

Showing 1-4 of 4 results.