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.
%I A020946 #19 May 05 2023 12:28:06 %S A020946 0,1,3,5,9,11,33,19,21,35,39,37,45,43,69,73,93,77,75,83,189,85,141, %T A020946 139,153,151,147,155,267,149,165,173,279,275,171,283,315,277,537,325, %U A020946 297,293,579,301,309,365,333,299,567,331,339,553,549,563,1275,341,585,565,615,629 %N A020946 a(n) is the smallest number k such that A002487(k) = n. %H A020946 Charles R Greathouse IV, <a href="/A020946/b020946.txt">Table of n, a(n) for n = 0..10000</a> %e A020946 A002487(33) = 6 and this is the first time 6 appears, so a(6) = 33. %t A020946 aa = {}; a[0] = 0; a[1] = 1; a[n_] := a[n] = If[EvenQ[n], a[n/2], a[(n - 1)/2] + a[(n + 1)/2]]; Do[k = 0; While[a[k] != p, k++]; AppendTo[aa, k], {p, 0, 100}]; aa (* _Artur Jasinski_, Dec 06 2010 *) %o A020946 (PARI) fusc(n)={my(a=1, b=0);while(n,if(bitand(n, 1), b+=a, a+=b);n>>=1); b}; %o A020946 list(N)={ %o A020946 my(v=vector(N),k); %o A020946 forstep(n=1,9e99,2, %o A020946 k=fusc(n); %o A020946 if(k<=N && !v[k], %o A020946 v[k]=n; %o A020946 if(vecmin(v),return(v)) %o A020946 ) %o A020946 ) %o A020946 }; \\ _Charles R Greathouse IV_, Dec 20 2011 %o A020946 (Python) %o A020946 from itertools import count %o A020946 from functools import reduce %o A020946 def A020946(n): return next(filter(lambda k:sum(reduce(lambda x,y:(x[0],x[0]+x[1]) if int(y) else (x[0]+x[1],x[1]),bin(k)[-1:2:-1],(1,0)))==n,count(1))) if n else 0 # _Chai Wah Wu_, May 05 2023 %Y A020946 Equals A020950 + 1. %Y A020946 Cf. A020943-A020945, A002487, A020947-A020950. %K A020946 nonn %O A020946 0,3 %A A020946 _N. J. A. Sloane_ and _David W. Wilson_, Jun 27 2002