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 A127971 #15 Sep 20 2024 03:04:18 %S A127971 1,2,2,2,3,3,3,2,4,4,5,3,5,4,4,2,5,5,7,4,8,6,7,3,7,6,8,4,7,5,5,2,6,6, %T A127971 9,5,11,8,10,4,11,9,13,6,12,8,9,3,9,8,12,6,13,9,11,4,10,8,11,5,9,6,6, %U A127971 2,7,7,11,6,14,10,13,5,15,12,18,8,17,11,13,4 %N A127971 a(n) = fusc(n+1) + (1-(-1)^n)/2, fusc = A002487. %C A127971 Row sums of A127970. %H A127971 G. C. Greubel, <a href="/A127971/b127971.txt">Table of n, a(n) for n = 0..10000</a> %F A127971 a(n) = (1-(-1)^n)/2 + Sum_{k=0..floor(n/2)} mod(C(n-k,k),2). %t A127971 Table[Sum[Mod[Binomial[n-k,k],2], {k, 0, Floor[n/2]}] + (1-(-1)^n)/2, {n, 0, 50}] (* _G. C. Greubel_, May 04 2018 *) %o A127971 (PARI) for(n=0, 50, print1((1-(-1)^n)/2 + sum(k=0,floor(n/2), lift(Mod( binomial(n-k,k), 2))), ", ")) \\ _G. C. Greubel_, May 04 2018 %o A127971 (Magma) [(1-(-1)^n)/2 + (&+[Binomial(n-k,k) mod 2: k in [0..Floor(n/2)]]) : n in [0..50]]; // _G. C. Greubel_, May 04 2018 %o A127971 (Python) %o A127971 from functools import reduce %o A127971 def A127971(n): return sum(reduce(lambda x,y:(x[0],x[0]+x[1]) if int(y) else (x[0]+x[1],x[1]),bin(n+1)[-1:2:-1],(1,0)))+(n&1) # _Chai Wah Wu_, May 18 2023 %K A127971 easy,nonn %O A127971 0,2 %A A127971 _Paul Barry_, Feb 09 2007