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.

A059880 Positions of negative terms in A059876.

This page as a plain text file.
%I A059880 #5 Mar 07 2016 03:07:04
%S A059880 8,32,33,34,35,36,64,65,128,129,130,131,132,133,134,135,136,137,138,
%T A059880 139,140,141,142,143,144,145,146,147,148,149,150,152,160,161,256,257,
%U A059880 258,259,260,261,262,263,264,265,266,267,268,269,270,272,273,274,275
%N A059880 Positions of negative terms in A059876.
%p A059880 negative_terms(A059876); negative_terms := proc(b) local a,i; a := []; for i from 1 to nops(b) do if(b[i] < 0) then a := [op(a),i]; fi; od; RETURN(a); end;
%t A059880 a[n_] := With[{s = Floor[Log[2, n]]}, (-1)^(n+1) + Sum[(-1)^(Floor[n/2^i] + 1)*Prime[i], {i, 1, s}] + If[1 == n, 1, Mod[s + 1, 2]*Prime[s]]];
%t A059880 A059880 = Position[Array[a, 500], _?Negative] // Flatten (* _Jean-François Alcover_, Mar 07 2016 *)
%K A059880 nonn
%O A059880 1,1
%A A059880 _Antti Karttunen_, Feb 05 2001