cp's OEIS Frontend

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.

A318928 Runs-resistance of binary representation of n.

This page as a plain text file.
%I A318928 #27 Jul 01 2020 23:44:55
%S A318928 1,2,1,3,2,3,1,3,3,2,4,2,4,3,1,3,3,5,4,4,2,5,4,3,4,4,3,3,4,3,1,3,3,5,
%T A318928 3,3,5,4,3,4,5,2,4,3,4,5,4,3,3,3,2,4,4,3,3,2,3,4,3,3,4,3,1,3,3,5,3,3,
%U A318928 5,3,4,3,3,5,6,4,5,3,3,4,5,4,4,4,2,5,4,5,5,4,5,5,4,5,4
%N A318928 Runs-resistance of binary representation of n.
%C A318928 Following Lenormand (2003), we define the "runs-resistance" of a finite list L to be the number of times the RUNS transformation must be applied to L in order to reduce L to a list with a single element.
%C A318928 Here it is immaterial whether we read the binary representation of n from left to right or right to left.
%C A318928 The RUNS transformation must be applied at least once, in order to obtain a list, so a(n) >= 1.
%H A318928 N. J. A. Sloane, <a href="/A318928/b318928.txt">Table of n, a(n) for n = 1..10000</a>
%H A318928 Claude Lenormand, <a href="/A318921/a318921.pdf">Deux transformations sur les mots</a>, Preprint, 5 pages, Nov 17 2003. Apparently unpublished. This is a scanned copy of the version that the author sent to me in 2003.
%H A318928 N. J. A. Sloane, <a href="/transforms.txt">Transforms</a>
%e A318928 11 in binary is [1, 0, 1, 1],
%e A318928 which has runs of lengths [1, 1, 2],
%e A318928 which has runs of lengths [2, 1],
%e A318928 which has runs of lengths [1, 1],
%e A318928 which has a single run of length [2].
%e A318928 This took four steps, so a(11) = 4.
%p A318928 with(transforms);
%p A318928 # compute Lenormand's "resistance" of a list
%p A318928 resist:=proc(a) local ct,i,b;
%p A318928 if whattype(a) <> list then ERROR("input must be a list"); fi:
%p A318928 ct:=0; b:=a; for i from 1 to 100 do
%p A318928 if nops(b)=1 then return(ct); fi;
%p A318928 b:=RUNS(b); ct:=ct+1; od; end;
%p A318928 a:=[1];
%p A318928 for n from 2 to 100 do
%p A318928 b:=convert(n,base,2);
%p A318928 r:=resist(b);
%p A318928 a:=[op(a),r];
%p A318928 od:
%t A318928 Table[If[n == 1, 1, Length[NestWhileList[Length/@Split[#] &, IntegerDigits[n, 2], Length[#] > 1 &]] - 1], {n, 50}] (* _Gus Wiseman_, Nov 25 2019 *)
%Y A318928 See A319103 for an inverse, and A319417 and A319418 for records.
%Y A318928 Ignoring the first digit gives A329870.
%Y A318928 Cuts-resistance is A319416.
%Y A318928 Compositions counted by runs-resistance are A329744.
%Y A318928 Binary words counted by runs-resistance are A319411 and A329767.
%Y A318928 Cf. A107907, A319420, A329860, A329861, A329865, A329867.
%K A318928 nonn,base,nice
%O A318928 1,2
%A A318928 _N. J. A. Sloane_, Sep 09 2018
%E A318928 a(1) corrected by _N. J. A. Sloane_, Sep 20 2018