// C++ program computing OEIS A334499 by Bert Dobbelaere // Output till n=40: see bottom // We need 64 bit unsigned. Type below works with GCC. #if __cplusplus < 201103L typedef unsigned long long u64; #else #include typedef uint64_t u64; #endif #include #include // State contains the N+2 cells (last two are a copy of the first two) // This will allow bit-parallel computation of the cells of the next state. #define NMAX 62 typedef u64 State; u64 rule_bit[8]; // For each bit in the rule, contains N copies int N; // Number of cells in the world // Results storage u64 lambda_results[256][NMAX+1]; u64 max_lambda[NMAX+1]; // Append the edges of the world void makeTorus(State &s) { s = s | ((s>>N)&1ull) | ((s&2ull)<>1; // left u64 m = s; // mid u64 r = s<<1; // right // Compute new cells s= (~l & ~m & ~r & rule_bit[0]) | (~l & ~m & r & rule_bit[1]) | (~l & m & ~r & rule_bit[2]) | (~l & m & r & rule_bit[3]) | ( l & ~m & ~r & rule_bit[4]) | ( l & ~m & r & rule_bit[5]) | ( l & m & ~r & rule_bit[6]) | ( l & m & r & rule_bit[7]); // Extend the edges s = s | ((s>>N)&1ull) | ((s&2ull)<max_lambda[k]) max_lambda[k]=lam; } std::cout << std::endl; } std::cout << std::endl; for(int k=1;k<=N;k++) std::cout << "A334499(" << k << ") = " << max_lambda[k] << std::endl; std::cout << std::endl; } int main() { for(N=1;N<=NMAX;N++) { for(int r=0;r<=255;r++) { u64 midmask = (2ull<