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.

A225854 Frequency of prime numbers between consecutive partial sums of primes.

This page as a plain text file.
%I A225854 #18 May 04 2017 00:12:40
%S A225854 1,2,1,3,2,4,3,5,4,6,6,8,6,9,6,9,10,10,8,12,12,11,12,12,15,14,14,14,
%T A225854 14,17,17,16,17,19,19,22,16,24,21,20,20,20,28,22,26,21,24,28,23,31,23,
%U A225854 30,28,28,32,28,31,30,27,36,29,32,31,39,33,38,36,36,37
%N A225854 Frequency of prime numbers between consecutive partial sums of primes.
%C A225854 Gives the numbers of primes between adjacent numbers in the sequence A014284, that is, primes in the half-open interval [A014284(k), A014284(k+1)).
%C A225854 The plot of this sequence follows a linear curve.
%H A225854 Giovanni Resta, <a href="/A225854/b225854.txt">Table of n, a(n) for n = 1..10000</a>
%e A225854 List the numbers with an increment of 1 beginning at n=1, and stop when the number of numbers reaches a prime, in this case the list would be {1,2} since its size is 2. Find the number of primes in that interval and add it to the sequence. In this case, there is 1 prime in the list. Continue counting from the last number in the previous list and apply the same rules, the next list will be {3,4,5} of size 3 and contains 2 prime numbers. The list after that will be {6,7,8,9,10} of size 5 and contains 1 prime number.
%t A225854 numberOfLines = 100; (*How many elements desired in the sequence*) a = {0}; distribution = {}; last = 0; For[j = 1, j <= numberOfLines, j++, frequency = 0; b = {}; For[i = 1, i <= Prime[j], i++, b = Append[b, last + i]; If[PrimeQ[b[[i]]], frequency += 1];];last += Prime[j]; distribution = Append[distribution, frequency];]; Print["Distribution = ", distribution]; ListPlot[distribution]; (*original program*)
%t A225854 seq[n_] := Block[{a=0, b=2, p=2, v}, Table[v = PrimePi@b-PrimePi@a; p = NextPrime@p; a = b; b += p; v, {n}]]; seq[100] (* faster version, _Giovanni Resta_, May 18 2013 *)
%Y A225854 Cf. A014284.
%K A225854 nonn
%O A225854 1,2
%A A225854 _Victor Phan_, May 17 2013