A320100 Automata sum similar to A102376 but using mod 5.
4, 16, 44, 61, 4, 16, 64, 176, 244, 16, 64, 201, 324, 556, 44, 176, 324, 736, 1004, 61, 244, 556, 1004, 1561, 4, 16, 64, 176, 244, 16, 64, 256, 704, 976, 64, 256, 804, 1296, 2224, 176, 704, 1296, 2944, 4016, 244, 976, 2224, 4016, 6244, 16, 64, 201, 324, 556
Offset: 1
Keywords
Links
- Georg Fischer, Table of n, a(n) for n = 1..100
Programs
-
Python
# requires scipy library (try pip install scipy) # more info: https://scipy.org/install/ import numpy as np from scipy import signal frameSize = 301 filter = [[0, 1, 0], [1, 0, 1], [0, 1, 0]] # this defines the CA neighborhood frame = np.zeros((frameSize, frameSize)) frame[int(frameSize/2), int(frameSize/2)] = 1 mod = 5 sequence = [] for j in range(140): frame = signal.convolve2d(frame, filter, mode='same') frame = np.mod(frame, mod) # If you want to visualize the automaton you can use a tool # like opencv (pip install opencv-python) to save the frame # as an image each iteration. # i:e:(with other imports) import cv2 # (inside loop) cv2.imwrite('automatonFrame%s.png' % j, frame) sequence.append(int(np.sum(frame.reshape(1, -1)))) print(sequence)
Comments