login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A360142 Bitwise encoding of the left half, initially fully occupied, state of the 1D cellular automaton from A359303 after n steps. 3

%I #27 Mar 07 2023 07:40:11

%S 0,1,2,2,4,5,8,9,10,17,18,18,20,35,36,37,40,69,73,74,81,138,145,146,

%T 146,148,163,276,291,292,293,296,325,553,582,585,586,593,650,1105,

%U 1162,1169,1170,1172,1187,1300,2211,2324,2339,2340,2341,2344,2373,2601

%N Bitwise encoding of the left half, initially fully occupied, state of the 1D cellular automaton from A359303 after n steps.

%C See A359303 for how the automaton steps.

%C The automaton state is a bi-infinite string of 1's and 0's of the form ...1111 middle 0000... and the left half here is the part which began as 1's.

%C The left half state is encoded in an integer by inverting the bits (0<->1) and interpreting the them from right to left as binary from least to most significant bit.

%H Kevin Ryde, <a href="/A360142/b360142.txt">Table of n, a(n) for n = 0..3000</a>

%H Kevin Ryde, <a href="/A360141/a360141.gp.txt">PARI/GP Code</a>

%e Following the state progression from A359303 (state(n)) is converted to the sequence (a(n)) by:

%e state(0) = ..1111|0000..

%e ..1111|

%e ..0000|

%e a(0) = 0 = bits 0

%e state(1) = ..1110|1000..

%e ..1110|

%e ..0001|

%e a(1) = 1 = bits 1

%e state(2) = ..111101|10000..

%e ..111101|

%e ..000010|

%e a(2) = 2 = bits 10

%e state(3) = ..111101|10000..

%e ..111101|

%e ..000010|

%e a(3) = 2 = bits 10

%e state(4) = ..111011|01000..

%e ..111011|

%e ..000100|

%e a(4) = 4 = bits 100

%e state(5) = ..111010|11000..

%e ..111010|

%e ..000101|

%e a(5) = 5 = bits 101

%t ClearAll[{s, prop, checkprop, doprop, run, p, a, j,runneg}];

%t prop[s_]:=(p=Array[0#&, Length[s]];

%t Do[If[i==1 ||i==Length[s], p[[i]]=0,

%t {p[[i-1]], p[[i]], p[[i+1]]}+=

%t Piecewise[{{{1, -1, 0}, {s[[i-1]], s[[i]], s[[i+1]]}=={0, 1, 1}},

%t {{0, -1, 1}, {s[[i-1]], s[[i]], s[[i+1]]}=={1, 1, 0}}}, {0, 0, 0}]], {i, 1, Length[s]-1} ];

%t Return[p])

%t checkprop[s_]:=(p=s;

%t Do[If[p[[i]]==2, {p[[i-1]], p[[i]], p[[i+1]]}={0, 0, 0}], {i, 2, Length[s]-1}];

%t Return[p])

%t doprop[s_]:= Return[s +checkprop[prop[s]]]

%t runneg[n_]:=( s=Join[Array[#/#&, n+5], Array[0#&, n+5]] ; Table[Drop[Nest[doprop[#]&, s, k],-(n+5)], {k, 0, n}])

%t a[j_]:=FromDigits[(runneg[j+1]/.{0->1,1->0})[[j+1, All]],2]

%t (* Table[a[n],{n,0,10,1}] *)

%t (* returns the first 11 elements *)

%t (* {0,1,2,2,4,5,8,9,10,17,18} *)

%o (PARI) See links.

%Y Cf. A359303, A360141.

%K nonn,base

%O 0,3

%A _Raphael J. F. Berger_, Jan 27 2023

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified May 11 23:16 EDT 2024. Contains 372431 sequences. (Running on oeis4.)