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.

A242002 Sum_{k=1..n} (-1)^isprime(k)*2^k.

This page as a plain text file.
%I A242002 #23 Aug 20 2014 22:11:33
%S A242002 2,-2,-10,6,-26,38,-90,166,678,1702,-346,3750,-4442,11942,44710,
%T A242002 110246,-20826,241318,-282970,765606,2862758,7057062,-1331546,
%U A242002 15445670,49000102,116108966,250326694,518762150,-18108762,1055633062
%N A242002 Sum_{k=1..n} (-1)^isprime(k)*2^k.
%C A242002 Inspired by A243106. In contrast to that sequence, the absolute values are not increasing here.
%C A242002 This can be explained as follows: By comparison of the absolute values among both sequences, after replacing for each term at the other sequence: 8,9 with 0,1 it is obtained the a(n) corresponding here expressed in binary with one or more "leading zeros". This induces the described effect, cf. example. - _R. J. Cano_, Aug 20 2014
%H A242002 Jens Kruse Andersen, <a href="/A242002/b242002.txt">Table of n, a(n) for n = 1..1000</a>
%e A242002 From _R. J. Cano_, Aug 20 2014: (Start)
%e A242002 By looking at A243106's b-file for n=28..30:
%e A242002 28 11110911090911090911090908910
%e A242002 29 -88889088909088909088909091090
%e A242002 30 911110911090911090911090908910
%e A242002 After taking the absolute values, making the replacements, and deleting the leading zeros, we obtain:
%e A242002 28 11110111010111010111010100110
%e A242002 29 1000101000101000101011010 (4 leading zeros deleted)
%e A242002 30 111110111010111010111010100110
%e A242002 From where it is noticeable that abs(a(28))>abs(a(29))<abs(a(30)); Now by reading from binary:
%e A242002 abs(a(28))=518762150
%e A242002 abs(a(29))=18108762 (it was negative)
%e A242002 abs(a(30))=1055633062 (End)
%o A242002 (PARI) a(n,b=2)=sum(k=1,n,(-1)^isprime(k)*b^k)
%K A242002 sign
%O A242002 1,1
%A A242002 _M. F. Hasler_, Aug 20 2014