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.

A074239 Related to cumulative number of non-twin primes.

This page as a plain text file.
%I A074239 #17 May 14 2016 13:46:04
%S A074239 0,0,0,1,1,2,2,3,4,4,5,6,6,7,8,9,9,10,11,11,12,13,14,15,16,16,17,17,
%T A074239 18,19,20,21,21,22,22,23,24,25,26,27,27,28,28,29,29,30,31,32,32,33,34,
%U A074239 34,35,36,37,38,38,39,40,40,41,42,43,43,44,45,46,47,47,48,49,50
%N A074239 Related to cumulative number of non-twin primes.
%H A074239 Robert Israel and Paul Nanninga, <a href="/A074239/b074239.txt">Table of n, a(n) for n = 0..10000</a> (terms up to a(100) from Paul Nanninga)
%F A074239 Take the sequence of odd primes op(n); set a(0) = 0; if op(n+1)-op(n)=2 a(n+1) = a(n), if op(n+1)-op(n) > 2 a(n+1) = a(n) + 1.
%p A074239 N:= 100: # to get a(0) to a(N)
%p A074239 P:= [seq(ithprime(i),i=2..N+2)]:
%p A074239 ListTools:-PartialSums([0,seq(`if`(P[i]-P[i-1]=2,0,1),i=2..N+1)]); # _Robert Israel_, May 13 2016
%t A074239 Accumulate@ Table[If[Prime@ n - Prime[n - 1] == 2, 0, 1], {n, 2, 120}] - 1 (* _Michael De Vlieger_, May 13 2016, after _Robert Israel_ *)
%o A074239 (PARI) op(n) = prime(n+1);
%o A074239 lista(nn) = {my(x=0); for (n=1, nn, print1(x, ", "); if ((op(n+1) - op(n)) > 2, x++););} \\ _Michel Marcus_, May 13 2016
%Y A074239 Cf. A065091 (odd primes), A007510 (non-twin primes).
%K A074239 easy,nonn
%O A074239 0,6
%A A074239 Rudi Huysmans (rudi.huysmans(AT)pandora.be), Sep 18 2002