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.

A333124 a(n) is the number of square-subwords in the binary representation of n.

This page as a plain text file.
%I A333124 #11 Feb 16 2025 08:33:59
%S A333124 0,0,0,1,1,0,1,2,2,1,1,1,2,1,2,4,4,2,1,2,2,2,1,2,3,2,2,2,3,2,4,6,6,4,
%T A333124 2,3,3,2,2,3,3,2,3,3,2,2,2,4,5,3,2,3,3,3,3,3,4,3,3,3,5,4,6,9,9,6,4,5,
%U A333124 3,3,3,4,4,4,3,3,3,2,3,5,5,3,3,3,4,4,3
%N A333124 a(n) is the number of square-subwords in the binary representation of n.
%C A333124 A square-(sub)word consists of two nonempty identical adjacent subwords.
%C A333124 This sequence is a binary variant of A088950.
%C A333124 Square-subwords are counted with multiplicity.
%C A333124 A binary word of length 4 contains necessarily a square-subword, hence a(n) tends to infinity as n tends to infinity (a number whose binary representation has >= 4*k digits has >= k square-subwords).
%H A333124 Rémy Sigrist, <a href="/A333124/b333124.txt">Table of n, a(n) for n = 0..16384</a>
%H A333124 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/SquarefreeWord.html">Squarefree Word</a>
%H A333124 <a href="/index/Bi#binary">Index entries for sequences related to binary expansion of n</a>
%F A333124 a(2^k) = a(2^k-1) = A002620(k) for any k >= 0.
%e A333124 For n = 43:
%e A333124 - the binary representation of 43 is "101011",
%e A333124 - we have the following square-subwords: "1010", "0101", "11",
%e A333124 - hence a(43) = 3.
%o A333124 (PARI) a(n, base=2) = { my (b=digits(n, base), v); for (w=1, #b\2, for (i=1, #b-2*w+1, if (b[i..i+w-1]==b[i+w..i+2*w-1], v++))); return (v) }
%Y A333124 Cf. A002620, A088950.
%K A333124 nonn,base
%O A333124 0,8
%A A333124 _Rémy Sigrist_, Mar 08 2020