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.

A098780 First n numbers in binary representation concatenated in reverse order.

Original entry on oeis.org

1, 5, 29, 157, 1437, 13725, 128413, 1176989, 20051357, 355595677, 6261175709, 109340390813, 1896046785949, 32682372363677, 560447953696157, 9567647208437149, 315812421869630877, 10692105963331253661
Offset: 1

Views

Author

Reinhard Zumkeller, Oct 04 2004

Keywords

Examples

			a(4) = (4 3 2 1) -> (100 11 10 1) -> 10011101 -> 157.
		

Crossrefs

Programs

  • Mathematica
    Table[FromDigits[Flatten[IntegerDigits[#,2]&/@Reverse[Range[n]]],2],{n,20}] (* Harvey P. Dale, Sep 10 2019 *)
  • Python
    def A098780(n):
        s=""
        for i in range(n,0,-1):
            s+=bin(i)[2:]
        return int(s,2) # Indranil Ghosh, Jan 28 2017
    
  • Python
    from functools import reduce
    def A098780(n): return reduce(lambda i,j:(i<Chai Wah Wu, Feb 26 2023

Formula

a(n) = n*A000079(A070939(a(n-1))) + a(n-1); a(1) = 1.
a(n) = n*2^(1 + floor(log_2(a(n-1)))) + a(n-1); a(1) = 1.

Extensions

Typo in data corrected by D. S. McNeil, Aug 20 2010