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.
%I A320030 #66 Jun 20 2025 01:28:09 %S A320030 1,4,13,4,16,52,13,52,121,4,16,52,16,64,208,52,208,484,13,52,121,52, %T A320030 208,484,121,484,1093,4,16,52,16,64,208,52,208,484,16,64,208,64,256, %U A320030 832,208,832,1936,52,208,484,208,832,1936,484,1936,4372,13,52,121,52 %N A320030 Automaton sum similar to A102376 but using mod 3 instead of mod 2. %C A320030 The automaton that generates this sequence operates on a grid of cells c(i,j). The cells have three possible values, 0, 1, and 2. The next generation in the CA is calculated by applying the following rule to each cell: c(i,j) = ( c(i+1,j-1) + c(i+1,j+1) + c(i-1,j-1) + c(i-1,j+1) ) mod 3. %C A320030 Start with a single cell with a value of 1, with all other cells set to 0. For each generation, the term in this sequence c(n) is the aggregate values of all cells in the grid for each discrete generation of the automaton (i.e., not cumulative over multiple generations). %C A320030 The cellular automaton that generates this sequence has been empirically observed to repeat the number of active cells (4 in this case) if the iteration number N is a power of the modulus + 1. The modulus in this case is 3. %C A320030 This has been observed to occur with any prime modulus and any starting pattern of cells. I'm picking this particular implementation because it's the same as the one used in A102376. %C A320030 Counting the active (nonzero) cells instead of taking the sum also creates a different but related sequence. This sequence is the sum of each iteration, and cells in this automaton have values 0, 1, or 2. Only for mod 2 are both the sum and active cell counts the same. %H A320030 Nathan M Epstein, <a href="https://giant.gfycat.com/GrandArtisticChickadee.webm">Animation of CA</a> %F A320030 a(3^n) = A096053(n). %o A320030 (Python) %o A320030 import numpy as np %o A320030 from scipy import signal %o A320030 frameSize = 301 %o A320030 filter = [[0,1,0],[1,0,1],[0,1,0]] # this defines the CA neighborhood %o A320030 frame = np.zeros((frameSize,frameSize)) %o A320030 frame[frameSize//2,frameSize//2] = 1 %o A320030 mod = 3 %o A320030 sequence = [1] %o A320030 for j in range(140): %o A320030 frame = signal.convolve2d(frame, filter, mode='same') %o A320030 frame = np.mod(frame, mod) %o A320030 sequence.append(int(np.sum(frame.reshape(1,-1)))) %Y A320030 Cf. A096053. %Y A320030 Cf. A102376 (mod 2), A320100 (mod 5). %K A320030 nonn %O A320030 1,2 %A A320030 _Nathan M Epstein_, Dec 10 2018