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-3 of 3 results.

A324608 Number of 1's in binary expansion of A308092(n).

Original entry on oeis.org

1, 1, 2, 3, 3, 3, 3, 3, 3, 3, 3, 10, 11, 11, 11, 13, 13, 14, 14, 14, 16, 16, 16, 17, 17, 17, 19, 19, 19, 19, 20, 20, 20, 22, 22, 22, 22, 22, 23, 23, 23, 25, 25, 25, 25, 25, 25, 26, 26, 26, 28, 28, 28, 28, 28, 28, 28, 29, 29, 30, 31, 31, 31, 31, 31, 31, 31, 31
Offset: 1

Views

Author

Peter Kagey, Jun 10 2019

Keywords

Comments

Conjecture: sequence is weakly increasing.

Crossrefs

Programs

  • Maple
    S:= "110":
    b("0"):= 0: b("1"):= 1:
    A308092[1]:= 1: A308092[2]:= 2: t:= 3:
    for n from 3 to 300 do
      tp:= add(b(S[i])*2^(n-i),i=1..n);
      A308092[n]:= tp - t;
      t:= tp;
      S:= cat(S,convert(A308092[n],binary));
    od:
    seq(convert(convert(A308092[n],base,2),`+`), n=1..300); # Robert Israel, Jun 12 2019
  • Mathematica
    a[1]=1;a[2]=2;a[n_]:=a[n]=FromDigits[Flatten[IntegerDigits[#,2]&/@Table[a[k],{k,n-1}]][[;;n]],2]-Total@Table[a[m],{m,n-1}]
    Count[#,1]&/@Table[IntegerDigits[a[l],2],{l,70}] (* Giorgos Kalogeropoulos, Mar 30 2021 *)
  • Python
    def aupton(terms):
      alst, bstr = [1, 1], "110"
      for n in range(3, terms+1):
        an = int(bstr[:n], 2) - int(bstr[:n-1], 2)
        binan = bin(an)[2:]
        alst, bstr = alst + [binan.count('1')], bstr + binan
      return alst
    print(aupton(68)) # Michael S. Branicky, Mar 30 2021

Formula

a(n) = A000120(A308092(n)).

A341406 Run lengths of the bits in A308092, read in binary.

Original entry on oeis.org

2, 1, 8, 1, 3, 2, 3, 3, 3, 4, 3, 5, 3, 6, 3, 7, 2, 1, 10, 1, 11, 1, 9, 1, 2, 1, 9, 2, 2, 1, 8, 1, 5, 1, 8, 1, 3, 1, 2, 1, 8, 1, 3, 1, 3, 1, 8, 1, 3, 1, 1, 1, 2, 1, 8, 1, 3, 1, 1, 2, 2, 1, 8, 1, 3, 2, 5, 1, 8, 1, 3, 2, 3, 1, 2, 1, 8, 1, 3, 2, 3, 2, 2, 1, 8, 1
Offset: 1

Views

Author

Peter Kagey, Mar 31 2021

Keywords

Examples

			In binary, A308092 is 1, 10, 11, 111, 1110, 11100, 111000, 1110000, .... The sequence begins with a(1) = 2 ones followed by a(2) = 1 zeros, a(3) = 8 ones, a(4) = 1 zeros, a(5) = 3 ones, a(6) = 2 zeros, and so on.
This sequence first disagrees with A342937 at n = 51, where a(51) = 1 and
A342937(51) = 2.
		

Crossrefs

Programs

  • Python
    from itertools import groupby
    def aupton(terms):
      A308092, bstr, rl_lst, rl_idx, n = [1, 2], "110", [2], 2, 3
      while len(rl_lst) < terms:
        an = int(bstr[:n], 2) - int(bstr[:n-1], 2)
        A308092, bstr, n = A308092 + [an], bstr + bin(an)[2:], n+1
        new_runs = [len(list(g)) for k, g in groupby(bstr[rl_idx:])]
        if len(new_runs) > 1:
          rl_idx += sum(new_runs[:-1])
          rl_lst.extend(new_runs[:-1]) # don't take last one in case mid-run
      return rl_lst[:terms]
    print(aupton(86)) # Michael S. Branicky, Apr 03 2021

A342937 Run lengths of A324608.

Original entry on oeis.org

2, 1, 8, 1, 3, 2, 3, 3, 3, 4, 3, 5, 3, 6, 3, 7, 2, 1, 10, 1, 11, 1, 9, 1, 2, 1, 9, 2, 2, 1, 8, 1, 5, 1, 8, 1, 3, 1, 2, 1, 8, 1, 3, 1, 3, 1, 8, 1, 3, 1, 2, 2, 1, 8, 1, 3, 1, 3, 2, 1, 8, 1, 3, 2, 5, 1, 8, 1, 3, 2, 3, 1, 2, 1, 8, 1, 3, 2, 3, 2, 2, 1, 8, 1, 3, 2
Offset: 1

Views

Author

Peter Kagey, Mar 29 2021

Keywords

Examples

			A324608 begins 1, 1, 2, 3, 3, 3, 3, 3, 3, 3, 3, 10, 11, 11, 11, 13, ..., with a(1) = 2 ones, a(2) = 1 two, a(3) = 8 threes, a(4) = 1 ten, a(5) = 3 elevens, and so on.
This sequence first disagrees with A341406 at n = 51, where a(51) = 2 and
A341406(51) = 1.
		

Crossrefs

Programs

  • Mathematica
    a[1]=1;a[2]=2;a[n_]:=a[n]=FromDigits[Flatten[IntegerDigits[#,2]&/@Table[a[k],{k,n-1}]][[;;n]],2]-Total@Table[a[m],{m,n-1}]
    Length/@Split@Table[Count[IntegerDigits[a[l],2],1],{l,300}] (* Giorgos Kalogeropoulos, Mar 30 2021 *)
  • Python
    from itertools import groupby
    def aupton(terms):
      A324608, bstr, rl_lst, rl_idx, n = [1, 1], "110", [], 0, 3
      while len(rl_lst) < terms:
        an = int(bstr[:n], 2) - int(bstr[:n-1], 2)
        binan = bin(an)[2:]
        A324608, bstr, n = A324608 + [binan.count('1')], bstr + binan, n+1
        new_runs = [len(list(g)) for k, g in groupby(A324608[rl_idx:])]
        if len(new_runs) > 0:
          rl_lst.extend(new_runs[:-1]) # don't take last one in case mid-run
          rl_idx += sum(new_runs[:-1])
      return rl_lst[:terms]
    print(aupton(86)) # Michael S. Branicky, Mar 30 2021
Showing 1-3 of 3 results.