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.

Showing 1-2 of 2 results.

A333920 a(n) is the least k such that the binary representation of n appears as a substring in the concatenation of the binary representations of 0, 1, ..., k.

Original entry on oeis.org

0, 1, 2, 2, 4, 3, 2, 4, 8, 5, 10, 3, 4, 3, 4, 8, 16, 9, 5, 10, 19, 11, 22, 4, 8, 5, 10, 3, 4, 7, 8, 16, 32, 17, 9, 18, 36, 5, 10, 20, 35, 19, 11, 11, 38, 22, 4, 8, 16, 9, 5, 13, 20, 11, 22, 4, 8, 5, 20, 7, 8, 15, 16, 32, 64, 33, 17, 34, 9, 35, 18, 36, 69, 37
Offset: 0

Views

Author

Rémy Sigrist, Apr 10 2020

Keywords

Comments

Every nonnegative integer appears finitely many times in this sequence.

Crossrefs

Cf. A047778, A161373, A161374, A333921 (decimal variant).

Programs

  • PARI
    a(n, base=2) = { my (w=base^#digits(n, base), m=0); for (k=0, oo, my (d=if (k, digits(k, base), [0])); for (i=1, #d, m=(base*m+d[i])%w; if (m==n, return (k)))) }

Formula

a(n) <= n with equality iff n belongs to A161374.
a(A047778(n)) = n for any n > 0.

A341537 a(n) is the number of digits from the end of the concatenation of all previous terms where n last appears. If n has not previously appeared then a(n) = n.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 2, 14, 15, 16, 17, 18, 19, 20, 15, 22, 33, 24, 25, 26, 27, 28, 29, 30, 31, 17, 20, 54, 35, 36, 37, 38, 39, 40, 53, 35, 17, 44, 75, 46, 5, 48, 49, 50, 16, 52, 23, 13, 55, 95, 57, 58, 7, 60, 87, 69, 51, 64, 26, 66, 115, 68, 15, 70, 106, 79, 71, 61, 36
Offset: 0

Views

Author

Scott R. Shannon, Feb 14 2021

Keywords

Examples

			a(9) = 9 as the concatenation of all previous terms is "012345678" which does not include 9, so a(9) = 9.
a(12) = 13 as the concatenation of all previous terms is "01234567891011" which includes "12" as a substring, starting 13 digits from the end of the concatenation.
a(13) = 2 as the concatenation of all previous terms is "0123456789101113" which includes "13" as a substring, starting 2 digits from the end of the concatenation.
		

Crossrefs

Showing 1-2 of 2 results.