login
Number of square-subwords in ternary representation of n.
3

%I #15 Nov 08 2016 03:52:21

%S 0,0,0,0,1,0,0,0,1,1,0,0,1,2,1,0,0,1,1,0,0,0,1,0,1,1,2,2,1,1,1,1,0,0,

%T 0,1,2,1,1,2,4,2,1,1,2,1,0,0,0,1,1,1,1,2,2,1,1,0,1,0,1,0,1,1,0,0,1,2,

%U 1,0,1,1,2,1,1,1,2,1,2,2,4,4,2,2,1,2,1,1,1,2,2,2,1,1,2,1,0,0,1,1,0,1

%N Number of square-subwords in ternary representation of n.

%C A square-(sub)word consists of two nonempty identical adjacent subwords.

%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/SquarefreeWord.html">Squarefree Word</a>

%e n=90: a(90)=2 because 90 -> '10100' has 2 square-subwords: 00 and 1010.

%t Table[SequenceCount[IntegerDigits[n, 3], {x__, x__}, Overlaps -> All], {n, 0, 100}] (* _Vladimir Reshetnikov_, May 17 2016 *)

%Y Cf. A007089, A088951, A088952.

%K nonn,base

%O 0,14

%A _Reinhard Zumkeller_, Oct 25 2003