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.

User: Richard Aime Blavy

Richard Aime Blavy's wiki page.

Richard Aime Blavy has authored 2 sequences.

A335599 Sequence is limit_{k->oo} s_k, where s_k = s_{k-1}, s_{k-1}[k-1] + 2^(k-1), ..., s_{k-1}[end] + 2^(k-1) starting with s_0 = s_0[0..1] = 0,0.

Original entry on oeis.org

0, 0, 1, 1, 2, 3, 3, 5, 5, 6, 7, 7, 9, 10, 11, 11, 13, 13, 14, 15, 15, 18, 19, 19, 21, 21, 22, 23, 23, 25, 26, 27, 27, 29, 29, 30, 31, 31, 35, 35, 37, 37, 38, 39, 39, 41, 42, 43, 43, 45, 45, 46, 47, 47, 50, 51, 51, 53, 53, 54, 55, 55, 57, 58, 59, 59, 61, 61
Offset: 0

Author

Richard Aime Blavy, Jun 15 2020

Keywords

Comments

In binary 0, 0, 1, 1, 10, 11, 11, 101, 101, 110, 111, 111, 1001, 1010, 1011, 1101, 1110, 1111, 1111, 10010, 10011, 10011, 10101, ...
a(n) = m is the smallest solution to m + bitcount(m) = n or n-1. So a(n) = smaller nonzero of A228086(n) and A228086(n-1) (for n>=2). - Kevin Ryde, Jul 05 2020

Crossrefs

Programs

  • Maple
    s:= proc(n) option remember; `if`(n=0, [0, 0][], (l->
         [l[], map(x-> x+2^(n-1), l[n..-1])[]][])([s(n-1)]))
        end:
    s(7);  # gives 136 = A005126(7) terms;  # Alois P. Heinz, Jul 04 2020
  • Mathematica
    a[n_] := If[n == 0, 0,
    Module[{m = n, k = Floor@Log2[n]}, m -= k + 1; While[k >= 0,
         If[BitGet[m, k] == 0, m++;
         If[BitGet[m, k] == 1, Return[m-1]]]; k--]; m]];
    Table[a[n], {n, 0, 67}] (* Jean-François Alcover, May 30 2022, after Kevin Ryde *)
  • PARI
    a(n) = { if(n, my(k=logint(n,2)); n-=k+1;
      while(k>=0, if(!bittest(n,k), n++; if(bittest(n,k), return(n-1))); k--));
      n; }  \\ Kevin Ryde, Jul 05 2020

Formula

a(n) + bitcount(a(n)) + A334820(n) = n for n>=0.

A334820 Sequence is limit_{t->oo} s_t, where s_k = s_{k-1},s_{k-1}[k-1..end] starting with s_0 = s_0[0..1] = 0,1.

Original entry on oeis.org

0, 1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1
Offset: 0

Author

Richard Aime Blavy, May 12 2020

Keywords

Comments

A nonperiodic sequence of 0 and 1.

Crossrefs

Cf. A005126 (s lengths), A057215.

Programs

  • Maple
    s:= proc(n) option remember; `if`(n=0, [0, 1][],
          (l-> [l[], l[n..-1][]][])([s(n-1)]))
        end:
    s(10);  # gives 1035 = A005126(10) terms;  # Alois P. Heinz, May 12 2020
  • Mathematica
    a[n_] := If[n<2, n, Module[{k = Floor@Log[2, n], m = n}, m-=k+1; While[k >= 0, If[BitGet[m, k]==0, m++; If[BitGet[m, k]==1, Return[1]]]; k--]]; 0];
    a /@ Range[0, 104] (* Jean-François Alcover, Nov 16 2020, after Kevin Ryde *)
  • PARI
    a(n) = { if(n, my(k=logint(n,2)); n-=k+1; while(k>=0, if(!bittest(n,k), n++; if(bittest(n,k), return(1))); k--)); 0; }  \\ Kevin Ryde, Jun 26 2020