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.

A373399 For any number m, let m* be the bi-infinite string obtained by repetition of the binary expansion of m; a(n) is the least k such that the binary expansion of n appears in k*.

This page as a plain text file.
%I A373399 #16 Jun 28 2024 09:30:19
%S A373399 1,2,1,4,2,5,1,8,4,2,5,9,5,11,1,16,8,4,9,18,2,5,11,17,9,21,5,19,11,23,
%T A373399 1,32,16,8,17,4,18,9,19,34,18,2,21,37,5,11,23,33,17,37,9,38,21,5,11,
%U A373399 35,19,43,11,39,23,47,1,64,32,16,33,8,34,17,35,68,4
%N A373399 For any number m, let m* be the bi-infinite string obtained by repetition of the binary expansion of m; a(n) is the least k such that the binary expansion of n appears in k*.
%H A373399 Rémy Sigrist, <a href="/A373399/b373399.txt">Table of n, a(n) for n = 1..8191</a>
%H A373399 Rémy Sigrist, <a href="/A373399/a373399.gp.txt">PARI program</a>
%H A373399 <a href="/index/Bi#binary">Index entries for sequences related to binary expansion of n</a>
%F A373399 a(n) <= n with equality iff n is a power of 2.
%F A373399 a(2^k - 1) = 1 for any k > 0.
%e A373399 The first terms, in decimal and in binary, are:
%e A373399   n   a(n)  bin(n)  bin(a(n))
%e A373399   --  ----  ------  ---------
%e A373399    1     1       1          1
%e A373399    2     2      10         10
%e A373399    3     1      11          1
%e A373399    4     4     100        100
%e A373399    5     2     101         10
%e A373399    6     5     110        101
%e A373399    7     1     111          1
%e A373399    8     8    1000       1000
%e A373399    9     4    1001        100
%e A373399   10     2    1010         10
%e A373399   11     5    1011        101
%e A373399   12     9    1100       1001
%e A373399   13     5    1101        101
%e A373399   14    11    1110       1011
%e A373399   15     1    1111          1
%e A373399   16    16   10000      10000
%o A373399 (PARI) \\ See Links section.
%o A373399 (Python)
%o A373399 def a(n):
%o A373399     target = bin(n)[2:]
%o A373399     for m in range(1, n):
%o A373399         b = bin(m)[2:]
%o A373399         mstar = b*(2*len(target)//len(b))
%o A373399         if target in mstar:
%o A373399             return m
%o A373399     return n
%o A373399 print([a(n) for n in range(1, 74)]) # _Michael S. Branicky_, Jun 14 2024
%Y A373399 Cf. A326774, A361942, A373553.
%K A373399 nonn,base
%O A373399 1,2
%A A373399 _Rémy Sigrist_, Jun 04 2024