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.

A061931 Numbers n such that n divides the (right) concatenation of all numbers <= n written in base 2 (most significant digit on right).

Original entry on oeis.org

1, 3, 7, 39, 63, 523, 4983, 25007, 892217, 1142775, 1381311, 1751751
Offset: 1

Views

Author

Larry Reeves (larryr(AT)acm.org), May 24 2001

Keywords

Comments

This sequence differs from A029495 in that all least significant zeros are removed before concatenation.
No more terms < 10^7. [Lars Blomberg, Oct 17 2011]

Examples

			1234567 -> (1)(01)(11)(001)(101)(011)(111) base 2 -> 1111110111111 base 2 = 8127 and 7 divides 8127.
		

Crossrefs

Programs

  • Mathematica
    b = 2; c = {}; Select[Range[10^4], Divisible[FromDigits[
    c = Join[c, IntegerDigits[IntegerReverse[#, b], b]], b], #] &] (* Robert Price, Mar 07 2020 *)
  • Python
    def agen():
      k, concat = 1, 1
      while True:
        if concat%k == 0: yield k
        revbink_even = (bin(k+1)[2:])[::-1]
        revbink_odd = '1' + revbink_even[1:]
        add_str = revbink_even[revbink_even.index('1'):] + revbink_odd
        concat = (concat << len(add_str)) + int(add_str, 2)
        k += 2
    g = agen()
    print([next(g) for i in range(8)]) # Michael S. Branicky, Jan 03 2021

Extensions

Edited and updated by Larry Reeves (larryr(AT)acm.org), Apr 12 2002
a(9)-a(12) from Lars Blomberg, Oct 17 2011