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

A173530 Number of ON cells after n generations of three-dimensional cellular automaton related to Sierpinski's triangle and the toothpick sequences (See Comments for definition).

Original entry on oeis.org

0, 1, 3, 7, 11, 15, 23, 39, 47, 51, 59, 75, 91, 107, 139, 203, 219, 223, 231, 247, 263, 279, 311, 375, 407, 423, 455, 519, 583, 647, 775, 1031, 1063, 1067, 1075, 1091, 1107, 1123, 1155, 1219, 1251, 1267, 1299, 1363, 1427, 1491, 1619
Offset: 0

Views

Author

Omar E. Pol, Oct 10 2010

Keywords

Comments

The structure is similar to Sierpinski's triangle but in this case we are in 3-D.
The triangles of the new generation are arranged on planes that are orthogonal with respect to the planes of the previous generation.
Rules:
If n is odd then the triangles are arranged on planes that are parallel to the plane XZ.
If n is even then the triangles are arranged on planes that are parallel to the plane YZ.
The sequence A173531 (The first differences) gives the number of triangles added at the n-th stage.
Example:
We start with no triangles.
At round 1 we place a triangle anywhere in the space on the plane XZ.
At round 2 we place two other triangles on planes that are parallel to the plane YZ.
At round 3 we place four other triangles on planes that are parallel to the plane XZ.
And so on...
It appears that the three-dimensional pattern has a recursive, fractal (or fractal-like) structure. An animation can show the fractal (or fractal-like) behavior.
Note that the triangles can be replaced by V-toothpicks or L-toothpicks. More generally, the triangles can be replaced by any polytoothpick formed by two toothpicks connected by one of its vertices, with an angle greater than zero degrees and less than 180 degrees.
In this structure every polytoothpick has two components, so after n stages the structure has 2 * a (n) components.
Note that for n <= 11, in all cases (using triangles or polytoothpicks), one of the views of the 3-D structure is equal to the toothpick structure of A139250 (See illustrations).
See the entries A139250, A161206 and A172310 for more information about the growth of toothpicks, V-toothpicks and L-toothpicks.

Crossrefs

Formula

Partial sums of A173531.

A333311 a(n) is the total number of leaves of a binary tree of depth n on a square grid where each parent-node branches out in the two directions closest to the direction of the edge from which it sprang, either along the grid for even generations or across for odd generations ('L-toothpick'), yet only if the child-nodes' coordinates are not occupied already.

Original entry on oeis.org

2, 4, 7, 12, 19, 29, 41, 56, 71, 90, 109, 133, 155, 183, 209, 242, 271, 309, 340, 384, 418, 466, 505, 555, 600, 651, 703, 758, 813, 874, 931, 999, 1058, 1133, 1195, 1277, 1343, 1432, 1502, 1597, 1671, 1771, 1849, 1954, 2036, 2142
Offset: 1

Views

Author

Jan Koornstra, Mar 14 2020

Keywords

Comments

The branching order is pre-order depth-first search.

Examples

			a(1) = 2, since two branches can be formed from the root-node at (0, 0) across the diagonals of the grid to (-1, 1) and (1, 1) respectively, hence:
Generation 1:      \/
a(2) = 4, yielding new leaves at respectively (-2, 1), (-1, 2), (1, 2) and (2, 1):
Generation 2:    _|  |_
                   \/
a(3) = 7, since the node at (1, 2) cannot branch out, as one of its child-nodes would get coordinates (0, 3), which is already in use by a node branched from (-1, 2).
Generation 3:     \/
                \_|  |_/
                /  \/  \
		

Crossrefs

Cf. A172310.

Programs

  • Python
    used = [[0, 0]] # nodes used in the tree
    nodes = [[0, 0, 0]] # x, y, direction
    gen = 0
    terminations = [0]
    leaves = [1]
    directions = [[[-1, 0, 0, 1], [0, 1, 1, 0], [1, 0, 0, -1], [0, -1, -1, 0]], [[-1, 1, 1, 1], [1, 1, 1, -1], [1, -1, -1, -1], [-1, -1, -1, 1]]] # LU/RU/RD/DL, U/R/D/L
    while gen < 100:
      terminations.append(0)
      length = len(nodes)
      for n in range(length):
        x1 = nodes[n][0] + directions[(gen+1)%2][nodes[n][2]][0]
        y1 = nodes[n][1] + directions[(gen+1)%2][nodes[n][2]][1]
        x2 = nodes[n][0] + directions[(gen+1)%2][nodes[n][2]][2]
        y2 = nodes[n][1] + directions[(gen+1)%2][nodes[n][2]][3]
        if [x1, y1] not in used and [x2, y2] not in used:
          nodes += [[x1, y1, (nodes[n][2] - gen%2)%4]]
          nodes += [[x2, y2, (nodes[n][2] + (gen+1)%2)%4]]
          used += [[x1, y1], [x2, y2]]
          leaves[gen] += 1
        else:
          terminations[gen] += 1
      nodes = nodes[length:]
      gen += 1
      leaves.append(leaves[-1])
    print(leaves[:-1]) # This sequence.
    print(terminations[:-1])
Previous Showing 21-22 of 22 results.