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 A087810 #25 Oct 31 2023 04:44:56 %S A087810 1,1,1,0,1,1,1,-2,1,1,1,0,1,1,1,-5,1,1,1,0,1,1,1,-2,1,1,1,0,1,1,1,-9, %T A087810 1,1,1,0,1,1,1,-2,1,1,1,0,1,1,1,-5,1,1,1,0,1,1,1,-2,1,1,1,0,1,1,1,-14, %U A087810 1,1,1,0,1,1,1,-2,1,1,1,0,1,1,1,-5,1,1,1,0,1,1,1,-2,1,1,1,0 %N A087810 First differences of A029931. %H A087810 Antti Karttunen, <a href="/A087810/b087810.txt">Table of n, a(n) for n = 1..16385</a> %F A087810 a(4n) = 1 - T(v_2(n)), else a(n) = 1, where T = A000217 (triangular numbers) and v_2 = A007814 (exponent of 2 in factorization of n). %F A087810 G.f.: Sum_{k>=0} (k+1)t/(1+t), where t = x^2^k. %F A087810 Multiplicative with a(2^e) = 1 - A000217(e-1), a(p^e) = 1 otherwise. - _Mitch Harris_, May 17 2005 %F A087810 Dirichlet g.f.: zeta(s) * (1 - 1/(2^s-1)^2). - _Amiram Eldar_, Oct 31 2023 %t A087810 Differences[ Table[ (bits = IntegerDigits[n, 2]) . Reverse[ Range[ Length[bits]]], {n, 0, 92}]] (* _Jean-François Alcover_, Sep 03 2012 *) %o A087810 (PARI) a(n)=if(n<1,0,if(n%2==0,if(n%4,1,1-valuation(n,2)*(valuation(n,2)-1)/2),1)) %o A087810 (PARI) a(n)=polcoeff(sum(k=0, floor(log(n)/log(2)), (k+1)*x^2^k/(1+x^2^k)) + O(x^(n+1)), n) %o A087810 (Scheme) %o A087810 (define (A087810 n) (- (A029931 n) (A029931 (- n 1)))) %o A087810 (define (A029931 n) (let loop ((n n) (i 1) (s 0)) (cond ((zero? n) s) ((odd? n) (loop (/ (- n 1) 2) (+ 1 i) (+ s i))) (else (loop (/ n 2) (+ 1 i) s))))) %o A087810 ;; _Antti Karttunen_, Nov 18 2017 %Y A087810 Cf. A000217, A007814, A029931. %K A087810 sign,easy,mult %O A087810 1,8 %A A087810 _Ralf Stephan_, Oct 16 2003