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.

A075113 a(n) = A000217(n) - A048702(n).

This page as a plain text file.
%I A075113 #17 Dec 26 2022 13:10:03
%S A075113 0,0,0,1,-1,0,4,7,-7,-6,0,3,13,18,28,35,-35,-34,-24,-21,-5,0,14,21,43,
%T A075113 52,70,81,105,118,140,155,-155,-154,-136,-133,-105,-100,-78,-71,-35,
%U A075113 -26,0,11,47,60,90,105,151,168,202,221,265,286,324,347,399,424,466,493,545,574,620,651,-651,-650,-616,-613,-561
%N A075113 a(n) = A000217(n) - A048702(n).
%C A075113 The positions of the zeros seem to be given by A000975.
%H A075113 G. C. Greubel, <a href="/A075113/b075113.txt">Table of n, a(n) for n = 0..1000</a>
%F A075113 a(A000225(n)) = ((2^n)-1)*(2^(n-1)) - (2^(2n) - 1)/3 = A006095(n).
%t A075113 A048702 := Join[{0}, Reap[For[k = 1, k < 1500, k += 2, bb = IntegerDigits[k, 2]; If[bb == Reverse[bb], If[EvenQ[Length[bb]], Sow[k/3]]]]][[2, 1]]]; Table[n*(n + 1)/2 - A048702[[n + 1]], {n, 0, 50}] (* _G. C. Greubel_, Sep 26 2017 *)
%o A075113 (PARI) a01(n) = my(f); f = length(binary(n)) - 1; 2^(f+1)*n + sum(i=0, f, bittest(n, i) * 2^(f-i)); \\ A048701
%o A075113 a(n) = n*(n+1)/2 - a01(n)/3; \\ A006095
%o A075113 (Python)
%o A075113 def A075113(n: int) -> int:
%o A075113     s = bin(n)[2:]
%o A075113     return n * (n + 1) // 2 - int(s + s[::-1], 2) // 3
%o A075113 print([A075113(n) for n in range(69)]) # _Peter Luschny_, Dec 14 2022
%Y A075113 Cf. A000217, A048701, A048702.
%Y A075113 Cf. A000975, A000225, A006095.
%K A075113 sign
%O A075113 0,7
%A A075113 _Antti Karttunen_, Sep 02 2002
%E A075113 Definition corrected by _Georg Fischer_, Dec 13 2022