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.

A300570 a(n) is the concatenation n in base 2, n-1 in base 2, ..., 1 in base 2.

This page as a plain text file.
%I A300570 #35 Feb 26 2023 10:31:04
%S A300570 1,101,11101,10011101,10110011101,11010110011101,11111010110011101,
%T A300570 100011111010110011101,1001100011111010110011101,
%U A300570 10101001100011111010110011101,101110101001100011111010110011101,1100101110101001100011111010110011101
%N A300570 a(n) is the concatenation n in base 2, n-1 in base 2, ..., 1 in base 2.
%H A300570 Seiichi Manyama, <a href="/A300570/b300570.txt">Table of n, a(n) for n = 1..155</a>
%H A300570 <a href="/index/Mo#MWP">Index entries for sequences related to Most Wanted Primes video</a>
%p A300570 a:= proc(n) option remember; `if`(n=1, 1,
%p A300570       parse(cat(convert(n, binary), a(n-1))))
%p A300570     end:
%p A300570 seq(a(n), n=1..12);  # _Alois P. Heinz_, Feb 19 2023
%t A300570 Table[FromDigits[Flatten[IntegerDigits[#,2]&/@Range[n,1,-1]]],{n,20}] (* _Harvey P. Dale_, Sep 07 2020 *)
%o A300570 (Python)
%o A300570 from itertools import count, islice
%o A300570 def agen(): # generator of terms
%o A300570     s = ""
%o A300570     for k in count(1):
%o A300570         s = bin(k)[2:] + s
%o A300570         yield int(s)
%o A300570 print(list(islice(agen(), 15))) # _Michael S. Branicky_, Feb 19 2023
%o A300570 (Python)
%o A300570 from functools import reduce
%o A300570 def A300570(n): return int(bin(reduce(lambda i,j:(i<<j.bit_length())+j,range(n,0,-1)))[2:]) # _Chai Wah Wu_, Feb 26 2023
%Y A300570 Cf. A007088, A058935, A300571.
%Y A300570 Cf. A098780 (decimal expansion of terms).
%K A300570 nonn,base
%O A300570 1,2
%A A300570 _Seiichi Manyama_, Mar 08 2018