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.

User: Hans G. Oberlack

Hans G. Oberlack's wiki page.

Hans G. Oberlack has authored 9 sequences.

A367914 Movement sequence in the counter-clockwise undulating spiral, whereby 1, 2, 3, 4 represent moves to the right, down, left and up.

Original entry on oeis.org

1, 4, 3, 4, 3, 2, 3, 2, 1, 2, 1, 2, 1, 4, 1, 4, 1, 4, 3, 4, 3, 4, 3, 4, 3, 2, 3, 2, 3, 2, 3, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4
Offset: 1

Author

Hans G. Oberlack, Dec 04 2023

Keywords

Comments

y ^
|
4 | 2---3
| | |
3 | 2---3 4---3
| | |
2 | 2---3 2---3 4---3
| | | | |
1 | 2---3 2---3 4---3 4---3
| | | | |
0 | 1---2 1---2 1---4 1---4
| | | | |
-1 | 1---2 1-- 2 1---4 1---4
| | | | |
-2 | 1---2 1---4 1---4
| | |
-3 | 1---2 1---4
| | |
-4 | 1---4
+------------------------------------>
-4 -3 -2 -1 0 1 2 3 4 x

Crossrefs

Formula

a(k1)=1 with k1=i^2*8+i*0+2*j+1 with i,j >= 0 and j<=4i.
a(k2)=2 with k2=i^2*8+i*12+2*j+6 with i,j >= 0 and j<=4*i+3.
a(k3)=3 with k3=i^2*8+i*8+2*j+3 with i,j >= 0 and j<=4*i+2.
a(k4)=4 with k4=i^2*8+i*4+2*j+2 with i,j >= 0 and j<=4*i+1.

A359217 Y-coordinates of a point moving along a counterclockwise undulating spiral on a square grid.

Original entry on oeis.org

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

Author

Hans G. Oberlack, Dec 21 2022

Keywords

Comments

X-coordinates are given in A359216.

Examples

			   y ^
     |
   4 |             25--24
     |              |   |
   3 |         27--26  23--22
     |          |           |
   2 |     29--28   5---4  21--20
     |      |       |   |       |
   1 | 31--30   7---6   3---2  19--18
     |  |       |           |       |
   0 | 32--33   8---9   0---1  16--17
     |      |       |           |       |
  -1 |     34--35  10--11  14--15  46--47
     |          |       |   |       |
  -2 |         36--37  12--13  44--45
     |              |           |
  -3 |             38--39  42--43
     |                  |   |
  -4 |                 40--41
     +------------------------------------>
       -4  -3  -2  -1   0   1   2   3   4 x
		

Crossrefs

Programs

  • PARI
    See Links section.

Formula

Conjecture: a(n) = T10 + T15 + T20 + T21 where
T1 = floor(n/16);
T2 = sqrt(2*T1 + 1/4);
T3 = floor(T2 - 1/2);
T4 = n - T3*(T3+1)*16/2;
T5 = (T3+1)*16;
T6 = T4 + (3/4)*T5 - 1;
T7 = T6/T5;
T8 = floor(T7);
T9 = 1 - T8;
T10 = T9 - floor(T4/2);
T11 = T4 + (2/4)*T5 - 1;
T12 = T11/T5;
T13 = floor(T12);
T14 = T8 - T13;
T15 = T14*floor((T5 - T11)/2);
T16 = T4 + (1/4)*T5 - 1;
T17 = T16/T5;
T18 = floor(T17);
T19 = T13 - T18;
T20 = -T19*floor((T4 - T5/2)/2);
T21 = -T18*floor((T5 - T4 + 1)/2).
a(2*n) = A180714(n). - Rémy Sigrist, Apr 01 2023

A359216 X-coordinates of a point moving in a counterclockwise undulating spiral in a square grid.

Original entry on oeis.org

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

Author

Hans G. Oberlack, Dec 21 2022

Keywords

Comments

Y-coordinates are given in A359217.
The undulating spiral is
y ^
|
4 | 25--24
| | |
3 | 27--26 23--22
| | |
2 | 29--28 5---4 21--20
| | | | |
1 | 31--30 7---6 3---2 19--18
| | | | |
0 | 32--33 8---9 0---1 16--17
| | | | |
-1 | 34--35 10--11 14--15 46--47
| | | | |
-2 | 36--37 12--13 44--45
| | |
-3 | 38--39 42--43
| | |
-4 | 40--41
+------------------------------------>
-4 -3 -2 -1 0 1 2 3 4 x

Crossrefs

Programs

  • PARI
    See Links section.

Formula

a(2*n) = A329116(n). - Rémy Sigrist, Apr 01 2023

A359058 a(n) = squared distance to the origin of the n-th vertex on a counterclockwise undulating spiral in a square grid.

Original entry on oeis.org

0, 1, 2, 1, 4, 5, 2, 5, 4, 1, 2, 1, 4, 5, 2, 5, 4, 9, 10, 5, 8, 5, 10, 9, 16, 17, 10, 13, 8, 13, 10, 17, 16, 9, 10, 5, 8, 5, 10, 9, 16, 17, 10, 13, 8, 13, 10, 17, 16, 25, 26, 17, 20, 13, 18, 13, 20, 17, 26, 25, 36, 37, 26, 29, 20, 25, 18, 25, 20, 29, 26, 37, 36, 25, 26, 17, 20, 13, 18, 13, 20
Offset: 0

Author

Hans G. Oberlack, Dec 14 2022

Keywords

Comments

The spiral coordinates are A359216 and A359217.

Examples

			The spiral begins as follows and for instance point n=7 is at x=-2,y=1 so that a(7) = (-2)^2 + 1^2 = 5.
   y ^
     |
   4 |             17--16
     |              |   |
   3 |         13--10   9--10
     |          |           |
   2 |     13---8   5---4   5---8
     |      |       |   |       |
   1 | 17--10   5---2   1---2   5--10
     |  |       |           |       |
   0 | 16---9   4---1   0---1   4---9
     |      |       |           |       |
  -1 |     10---5   2---1   2---5  10--17
     |          |       |   |       |
  -2 |          8---5   4---5   8--13
     |              |           |
  -3 |             10---9  10--13
     |                  |   |
  -4 |                 16--17
     +------------------------------------>
       -4  -3  -2  -1   0   1   2   3   4 x
		

Crossrefs

Programs

  • PARI
    See Links section.

Formula

a(n) = A359216(n)^2 + A359217(n)^2.

A343203 Sum of x- and y-coordinate of a point moving in a triangular spiral.

Original entry on oeis.org

0, 1, 1, -1, -3, -2, -1, 0, 1, 2, 2, 2, 2, 0, -2, -4, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 3, 3, 3, 3, 3, 1, -1, -3, -5, -7, -9, -8, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 4, 4, 4, 4, 4, 4, 4, 2, 0, -2, -4, -6, -8, -10, -12, -11, -10, -9, -8, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 3, 1, -1, -3, -5, -7, -9, -11, -13, -15
Offset: 0

Author

Hans G. Oberlack, Apr 07 2021

Keywords

Examples

			   y
     |
   4 |                         56
     |                           \
     |                            \
     |                             \
   3 |                         30  55
     |                         / \   \
     |                        /   \   \
     |                       /     \   \
   2 |                     31  12  29  54
     |                     /   / \   \   \
     |                    /   /   \   \   \
     |                   /   /     \   \   \
   1 |                 32  13   2  11  28  53
     |                 /   /   / \   \   \   \
     |                /   /   /   \   \   \   \
     |               /   /   /     \   \   \   \
   0 |             33  14   3   0---1  10  27  52
     |             /   /   /             \   \   \
     |            /   /   /               \   \   \
     |           /   /   /                 \   \   \
  -1 |         34  15   4---5---6---7---8---9  26  51
     |         /   /                             \   \
     |        /   /                               \   \
     |       /   /                                 \   \
  -2 |     35  16--17--18--19--20--21--22--23--24--25  50
     |     /                                             \
     |    /                                               \
     |   /                                                 \
  -3 | 36--37--38--39--40--41--42--43--44--45--46--47--48--49
     |
     +--------------------------------------------------------
   x:  -6  -5  -4  -3  -2  -1   0   1   2   3   4   5   6   7
Count as follows. Start at n=0 with coordinates (0,0). So first term is 0.
Next step is to move to n=1 with coordinates (1,0) resulting in sum=1. So the sequence begins 0,1,...
Next step is to move to n=2 with coordinates (0,1) resulting in sum=1. So the sequence begins 0,1,1,...
Next step is to move to n=3 with coordinates (-1,0) resulting in sum=-1. So the sequence begins 0,1,1,1,...
Next step is to move to n=4 with coordinates (-2,-1) resulting in sum=-3. So the sequence begins 0,1,1,-1,-3,...
and so on.
		

Crossrefs

A322465 Numbers on the 0-9-10-line in a spiral on an equilateral triangular lattice.

Original entry on oeis.org

0, 9, 10, 31, 32, 65, 66, 111, 112, 169, 170, 239, 240, 321, 322, 415, 416, 521, 522, 639, 640, 769, 770, 911, 912, 1065, 1066, 1231, 1232, 1409, 1410, 1599, 1600, 1801, 1802, 2015, 2016, 2241, 2242, 2479, 2480, 2729, 2730, 2991, 2992, 3265, 3266, 3551, 3552
Offset: 0

Author

Hans G. Oberlack, Dec 09 2018

Keywords

Comments

Sequence found by reading the line from 0, in the direction 0, 9, 10, ... in the triangle spiral.

Crossrefs

Bisection (even part) gives A202804.

Programs

  • Maple
    a:= n-> `if`(n::even, n*((3/2)*n+2), (n+1)*((3/2)*(n+1)+2)-1): seq(a(n), n=0..50); # Muniru A Asiru, Dec 20 2018
  • PARI
    concat(0, Vec(x*(9 + x + 3*x^2 - x^3) / ((1 - x)^3*(1 + x)^2) + O(x^40))) \\ Colin Barker, Dec 18 2018

Formula

For even n: a(n) = n*((3/2)*n+2).
For odd n: a(n) = a(n+1)-1 = (n+1)*((3/2)*(n+1)+2)-1.
From Colin Barker, Dec 18 2018: (Start)
G.f.: x*(9 + x + 3*x^2 - x^3) / ((1 - x)^3*(1 + x)^2).
a(n) = a(n-1) + 2*a(n-2) - 2*a(n-3) - a(n-4) + a(n-5) for n>4.
(End)

A322462 Numbers on the 0-1-12 line in a spiral on a grid of equilateral triangles.

Original entry on oeis.org

0, 1, 12, 13, 36, 37, 72, 73, 120, 121, 180, 181, 252, 253, 336, 337, 432, 433, 540, 541, 660, 661, 792, 793, 936, 937, 1092, 1093, 1260, 1261, 1440, 1441, 1632, 1633, 1836, 1837, 2052, 2053, 2280, 2281, 2520, 2521, 2772, 2773, 3036, 3037, 3312, 3313, 3600
Offset: 0

Author

Hans G. Oberlack, Dec 09 2018

Keywords

Comments

Sequence found by reading the line from 0, in the direction 0, 1, 12, ... in the triangle spiral.

Examples

			a(0) = 0
a(1) = a(1 - 1) + 1 = 0 + 1
a(2) = (3/2) * 2 * (2 + 2) = 3 * 4 = 12
a(3) = a(3 - 1) + 1 = 12 + 1 = 13
a(4) = (3/2) * 4*(4 + 2) = 3 * 2 * 6 = 6 * 6 = 36
a(5) = a(4) + 1 = 36 + 1 = 37.
		

Crossrefs

Cf. A049598.

Programs

  • Maple
    seq(coeff(series(-x*(x^3-x^2+11*x+1)/((x+1)^2*(x-1)^3),x,n+1), x, n), n = 0 .. 50); # Muniru A Asiru, Dec 19 2018
  • Mathematica
    a[0] = 0; a[n_] := a[n] = If[OddQ[n], a[n - 1] + 1, 3/2*n*(n + 2)]; Array[a, 50, 0] (* Amiram Eldar, Dec 09 2018 *)
  • PARI
    concat(0, Vec(x*(1 + 11*x - x^2 + x^3) / ((1 - x)^3*(1 + x)^2) + O(x^40))) \\ Colin Barker, Dec 09 2018

Formula

a(n) = (3/2)*n*(n+2) = A049598(n/2) if n even, a(n) = a(n-1)+1 if n odd.
G.f.: -x*(x^3-x^2+11*x+1)/((x+1)^2*(x-1)^3). - Alois P. Heinz, Dec 09 2018
a(n) = a(n-1) + 2*a(n-2) - 2*a(n-3) - a(n-4) + a(n-5) for n>4. - Colin Barker, Dec 09 2018

Extensions

Examples added by Hans G. Oberlack, Dec 20 2018

A274575 For m=1,2,3,... write all the 2^m binary vectors of length m in increasing order, and replace each vector with (number of 1's) - (number of 0's). Start with an initial 0 for the empty vector.

Original entry on oeis.org

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

Author

Hans G. Oberlack, Jun 28 2016

Keywords

Comments

This is the sequence of To-And-Fro positions: Positions of all backward-forward combinations in lexicographical order when assigning -1 to a backward move and +1 to a forward move and starting at 0.
-a(n) are the slopes of the different segments, from left to right, of the successive steps in the construction of the Takagi (a.k.a. Blancmange) function. - Javier Múgica, Dec 31 2017

Examples

			Terms a(3) to a(6) correspond to the binary vectors 00, 01, 10, 11, which get replaced by -2, 0, 0, 2, respectively. Terms a(7) to a(14) correspond to the binary vectors 000, 001, ..., 111 which get replaced by -3, -1, ..., 3. a(0) = 0
a(1) = a('backward') = -1
a(2) = a('forward') = +1
a(3) = a('backward and backward') = -2
a(4) = a('backward and forward') = 0
a(5) = a('forward and backward') = 0
a(6) = a('forward and forward') = +2
a(7) = a('backward, backward and backward') = -3
a(8) = a('backward, backward and forward') = -1
Arranged as a tree read by rows:
               ______0______
              /             \
          __-1__           __1__
         /      \         /     \
       -2        0       0       2
       / \      / \     / \     / \
     -3  -1   -1   1  -1   1   1   3
. - _John Tyler Rascoe_, Sep 23 2023
		

Crossrefs

Cf. A037861.

Programs

  • BASIC
    Dim a(2*k+2)
    a(0) = 0
    For n = 0 To k
      a(2 * n + 1) = a(n) - 1
      a(2 * n + 2) = a(n) + 1
    Next n
    
  • Python
    def A274575_list(nmax):
        A = [0]
        for n in range(0,nmax):
            A.append(A[n//2]-(-1)**n)
        return(A)
    print(A274575_list(119)) # John Tyler Rascoe, Sep 23 2023

Formula

a(2*n + 1) = a(n) - 1; a(2*n + 2) = a(n) + 1.

Extensions

Edited by N. J. A. Sloane, Jul 27 2016

A263997 Sequence of block lengths in a block spiral of width 1.

Original entry on oeis.org

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

Author

Hans G. Oberlack, Oct 31 2015

Keywords

Comments

A left-handed block spiral is created by the following pattern: Start with a 1 X 1 square [ a(1)=1 ]. Attach a block of length 2 and width 1 (a horizontal 1 X 2 rectangle) to the upper side of the square [ a(2)=2 ] pointing to the right. Attach to the corner a vertical 2 X 1 block (rectangle). This block has length 2, so a(3)=2. Continue with a horizontal 1 X 2 block, so a(4) = 2. And so on. See the sketch shown in the link.

Crossrefs

Essentially the same as A008619.

Formula

a(n) = a(n-2) + 1 for n > 4.
O.g.f.: x*(1+x-x^2-x^3+x^4)/((1-x)*(1-x^2)). From A008619. - Wolfdieter Lang, Jan 05 2016

Extensions

Edited by Wolfdieter Lang, Jan 05 2016