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 A234016 #22 Jul 16 2022 00:54:34 %S A234016 0,0,1,1,1,2,3,3,3,4,4,4,5,6,7,7,7,8,8,8,9,10,10,10,11,11,11,12,13,14, %T A234016 15,15,15,16,16,16,17,18,18,18,19,19,19,20,21,22,22,22,23,23,23,24,25, %U A234016 25,25,26,26,26,27,28,29,30,31,31,31,32,32,32,33,34 %N A234016 Partial sums of the characteristic function of A055938. %C A234016 Also: a(0) = a(1) = 0, and thereafter, a(n) = the largest k such that A055938(k) <= n. %C A234016 Conjecture: partial sums of A308187 (i.e, A308187 is the characteristic function of A055938). - _Sean A. Irvine_, Jul 16 2022 %H A234016 Antti Karttunen, <a href="/A234016/b234016.txt">Table of n, a(n) for n = 0..8191</a> %F A234016 If n < 2, a(n)=0, otherwise a(n) = a(n-1) + (1-A079559(n)). %F A234016 a(n) = n - (A046699(n+2)-1) [With A046699's October 2012 starting offset]. %o A234016 (Scheme, with memoizing definec-macro from _Antti Karttunen_'s IntSeq-library) %o A234016 (definec (A234016 n) (if (< n 2) 0 (+ (A234016 (- n 1)) (- 1 (A079559 n))))) %o A234016 ;; Alternatively, based on A046699, with its October 2012 starting offset: %o A234016 (define (A234016 n) (- n (- (A046699 (+ n 2)) 1))) %o A234016 (Python) %o A234016 from sympy import factorial %o A234016 def a046699(n): %o A234016 if n<3: return 1 %o A234016 s=1 %o A234016 while factorial(2*s)%(2**(n - 1)): s+=1 %o A234016 return s %o A234016 def a(n): return n - (a046699(n + 2) - 1) %o A234016 print([a(n) for n in range(101)]) # _Indranil Ghosh_, Jun 11 2017 %Y A234016 Cf. A046699, A055938, A079559, A234017, A233275, A308187. %K A234016 nonn %O A234016 0,6 %A A234016 _Antti Karttunen_, Dec 18 2013