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.

A066753 a(n) = least natural number k such that n + Sum_{i=1..k} prime(i) is prime if such k exists; = 0 otherwise.

This page as a plain text file.
%I A066753 #10 Jan 03 2016 17:52:35
%S A066753 1,2,1,20,1,2,3,2,1,10,1,2,3,2,1,16,1,2,3,4,1,10,17,2,5,2,1,10,1,4,3,
%T A066753 2,3,10,1,2,3,2,1,16,1,2,3,4,1,18,17,2,3,4,1,10,41,2,5,2,1,16,1,6,3,2,
%U A066753 3,10,1,2,9,2,1,10,1,4,3,2,5,16,1,2,3,4,1,10,17,2,5,4,1,20,43,4,3,2,3,10
%N A066753 a(n) = least natural number k such that n + Sum_{i=1..k} prime(i) is prime if such k exists; = 0 otherwise.
%C A066753 Does a(n) ever take 0 as a value?
%H A066753 Harry J. Smith, <a href="/A066753/b066753.txt">Table of n, a(n) for n = 1..1000</a>
%e A066753 20 + (2 + 3 + 5 + 7) = 37, a prime and 4 consecutive primes starting with 2 are required to achieve this. So a(20) = 4.
%t A066753 nt = 200; a = Table[0, {i, 1, nt}]; For[n = 1, n <= nt, n++, {i = 1; s = n + Prime[i]; While[Not[PrimeQ[s]] && (i < 1000), {i++; s = s + Prime[i]}]; a[[n]] = i}]; a
%o A066753 (PARI) { for (n=1, 1000, k=0; b=0; s=n; while(b==0, k++; s+=prime(k); if (isprime(s), b=1)); write("b066753.txt", n, " ", k) ) } \\ _Harry J. Smith_, Mar 22 2010
%K A066753 nonn
%O A066753 1,2
%A A066753 _Joseph L. Pe_, Jan 16 2002
%E A066753 Edited by _John W. Layman_, Jan 23 2002