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.

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.

This page as a plain text file.
%I A335599 #32 May 30 2022 08:11:00
%S A335599 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,
%T A335599 23,23,25,26,27,27,29,29,30,31,31,35,35,37,37,38,39,39,41,42,43,43,45,
%U A335599 45,46,47,47,50,51,51,53,53,54,55,55,57,58,59,59,61,61
%N 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.
%C A335599 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, ...
%C A335599 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
%H A335599 Kevin Ryde, <a href="http://user42.tuxfamily.org/seq-A334820/index.html">PARI/GP code and explanation</a>, quantity "b(n)".
%F A335599 a(n) + bitcount(a(n)) + A334820(n) = n for n>=0.
%p A335599 s:= proc(n) option remember; `if`(n=0, [0, 0][], (l->
%p A335599      [l[], map(x-> x+2^(n-1), l[n..-1])[]][])([s(n-1)]))
%p A335599     end:
%p A335599 s(7);  # gives 136 = A005126(7) terms;  # _Alois P. Heinz_, Jul 04 2020
%t A335599 a[n_] := If[n == 0, 0,
%t A335599 Module[{m = n, k = Floor@Log2[n]}, m -= k + 1; While[k >= 0,
%t A335599      If[BitGet[m, k] == 0, m++;
%t A335599      If[BitGet[m, k] == 1, Return[m-1]]]; k--]; m]];
%t A335599 Table[a[n], {n, 0, 67}] (* _Jean-François Alcover_, May 30 2022, after _Kevin Ryde_ *)
%o A335599 (PARI) a(n) = { if(n, my(k=logint(n,2)); n-=k+1;
%o A335599   while(k>=0, if(!bittest(n,k), n++; if(bittest(n,k), return(n-1))); k--));
%o A335599   n; }  \\ _Kevin Ryde_, Jul 05 2020
%Y A335599 Cf. A005126, A334820.
%K A335599 nonn
%O A335599 0,5
%A A335599 _Richard Aime Blavy_, Jun 15 2020