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 A281922 #11 Apr 20 2017 11:47:42 %S A281922 2,5,4,17,-1,109,8,65,89,1115,-1,7297,2531,4369,16,257,155174,195814, %T A281922 495146,5201,1334551,1725452,1485482,-1,-1,-1,17256565,277691849, %U A281922 6145997,2029501,32,1025,67672804,1157011598,12054050100,22287270331,15597512810,-1 %N A281922 Consider a string of n 1. From left to right for any couple of consecutive numbers apply the transform 11 -> 10, 10 -> 11, 00 -> 00, 01 -> 01. At any further step restart the process considering the value of the rightmost digit as input to the leftmost one to apply the transform again. Sequence gives the number of steps necessary to reach again a string of n 1 or -1 if such a number does not exist. %C A281922 a(n) <= 2^n if it exists. %C A281922 a(2^k) = 2^k. %C A281922 a(2^k + 1) = 2^(2*k) + 1. %C A281922 Up to a(34), it appears that if the number does not exist the configuration of the first step is repeated further on: for a(6) it happens after 22 steps (see example), 1086 for a(12), 2192338 for a(25), 22996 for a(26), 41943036 for a(27). %H A281922 Lars Blomberg, <a href="/A281922/b281922.txt">Table of n, a(n) for n = 2..42</a> %e A281922 a(5) = 17. We start with 1 1 1 1 1, then the first two digit at left are 1 1 and applying the transform we get 1 0 1 1 1; again, the second and third digit from left are 0 1 and applying the transform we get 1 0 1 1 1; the third and fourth digit from left are 1 1 and we get 1 0 1 0 1; the fourth and fifth digit from left are 0 1 and we get 1 0 1 0 1. This is the result of the first step. To start the second one we consider the rightmost digit of the first step, that is 1, as input of the leftmost digit, that is another 1. So, applying the transform 1 1 -> 1 0, we get 0 0 1 0 1; now the first and second digit at left are 0 0 that results in 0 0 1 0 1; the second and third digit at left are 0 1 that results in 0 0 1 0 1; the third and fourth digit at left are 1 0 that results in 0 0 1 1 1; the fourth and fifth digit from left are 1 1 that results in 0 0 1 1 0. This is the result of the second step. Here below the list of all the steps leading back to 1 1 1 1 1: %e A281922 0 1 1 1 1 1 %e A281922 1 1 0 1 0 1 %e A281922 2 0 0 1 1 0 %e A281922 3 0 0 1 0 0 %e A281922 4 0 0 1 1 1 %e A281922 5 1 1 0 1 0 %e A281922 6 1 0 0 1 1 %e A281922 7 0 0 0 1 0 %e A281922 8 0 0 0 1 1 %e A281922 9 1 1 1 0 1 %e A281922 10 0 1 0 0 1 %e A281922 11 1 0 0 0 1 %e A281922 12 0 0 0 0 1 %e A281922 13 1 1 1 1 0 %e A281922 14 1 0 1 0 0 %e A281922 15 1 1 0 0 0 %e A281922 16 1 0 0 0 0 %e A281922 17 1 1 1 1 1 %e A281922 a(6) = -1 because after 22 steps we get again 1 0 1 0 1 0 (first step): %e A281922 0 1 1 1 1 1 1 %e A281922 1 1 0 1 0 1 0 %e A281922 2 1 1 0 0 1 1 %e A281922 3 0 1 1 1 0 1 %e A281922 4 1 0 1 0 0 1 %e A281922 5 0 0 1 1 1 0 %e A281922 6 0 0 1 0 1 1 %e A281922 7 1 1 0 0 1 0 %e A281922 8 1 0 0 0 1 1 %e A281922 9 0 0 0 0 1 0 %e A281922 10 0 0 0 0 1 1 %e A281922 11 1 1 1 1 0 1 %e A281922 12 0 1 0 1 1 0 %e A281922 13 0 1 1 0 1 1 %e A281922 14 1 0 1 1 0 1 %e A281922 15 0 0 1 0 0 1 %e A281922 16 1 1 0 0 0 1 %e A281922 17 0 1 1 1 1 0 %e A281922 18 0 1 0 1 0 0 %e A281922 19 0 1 1 0 0 0 %e A281922 20 0 1 0 0 0 0 %e A281922 21 0 1 1 1 1 1 %e A281922 22 1 0 1 0 1 0 %p A281922 with(numtheory): P:=proc(q) local a,b,j,k,n,ok,ok2,s,t; %p A281922 for n from 2 to q do a:=array(1..n); b:=array(1..n); %p A281922 for k from 1 to n do a[k]:=1; if k mod 2=0 then b[k]:=0; else b[k]:=1; fi; od; %p A281922 for k from 1 to n-1 do if a[k]=1 then a[k+1]:=(a[k+1]+1) mod 2; fi; od; %p A281922 t:=1; ok:=1; s:=0; while n>s do t:=t+1; if a[n]=1 then a[1]:=(a[1]+1) mod 2; fi; %p A281922 for k from 1 to n-1 do if a[k]=1 then a[k+1]:=(a[k+1]+1) mod 2; fi; od; %p A281922 ok2:=1; for j from 1 to n do if a[j]<>b[j] then ok2:=0; break; fi; s:=add(a[k],k=1..n); od; %p A281922 if ok2=1 then ok:=0; print(-1); break; fi; od; if ok=1 then print(t); fi; od; end: P(100); %Y A281922 Cf. A046932. %K A281922 sign,hard %O A281922 2,1 %A A281922 _Paolo P. Lava_, Feb 15 2017 %E A281922 a(35)-a(39) from _Lars Blomberg_, Apr 20 2017