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.

A020950 a(n) = k-1, where k is smallest number such that A002487(k) = n.

This page as a plain text file.
%I A020950 #10 May 05 2023 12:29:47
%S A020950 0,2,4,8,10,32,18,20,34,38,36,44,42,68,72,92,76,74,82,188,84,140,138,
%T A020950 152,150,146,154,266,148,164,172,278,274,170,282,314,276,536,324,296,
%U A020950 292,578,300,308,364,332,298,566,330,338,552,548,562,1274,340,584,564,614,628
%N A020950 a(n) = k-1, where k is smallest number such that A002487(k) = n.
%e A020950 A002487(33) = 6 and this is the first time 6 appears, so a(6) = 33-1 = 32.
%o A020950 (Python)
%o A020950 from itertools import count
%o A020950 from functools import reduce
%o A020950 def A020950(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)))-1 # _Chai Wah Wu_, May 05 2023
%Y A020950 Equals A020946 - 1.
%Y A020950 Cf. A020943-A020946, A002487, A020947-A020949.
%K A020950 nonn
%O A020950 1,2
%A A020950 _Clark Kimberling_
%E A020950 Corrected and extended by _David W. Wilson_