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.

A257077 a(n) = prime(n)-prime(1)-prime(2)-...-prime(k), while the result > 0.

This page as a plain text file.
%I A257077 #30 Apr 23 2015 14:47:18
%S A257077 2,1,3,2,1,3,7,2,6,1,3,9,13,2,6,12,1,3,9,13,15,2,6,12,20,1,3,7,9,13,
%T A257077 27,2,8,10,20,22,28,3,7,13,19,21,31,33,37,2,14,26,30,32,36,1,3,13,19,
%U A257077 25,31,33,39,43,2,12,26,30,32,36,3,9,19,21,25,31,39
%N A257077 a(n) = prime(n)-prime(1)-prime(2)-...-prime(k), while the result > 0.
%C A257077 It appears that a(n) = n occurs only for n=3, 7, 13. It also appears that a(n+1) is never equal to a(n).
%C A257077 The list of indices such that a(n)=1 correspond to the primes in A053845. - _Michel Marcus_, Apr 16 2015
%C A257077 In other words, a(n) = prime(n) - A007504(k) for largest k such that prime(n) > A007504(k). - _Danny Rorabaugh_, Apr 20 2015
%H A257077 Charles R Greathouse IV, <a href="/A257077/b257077.txt">Table of n, a(n) for n = 1..10000</a>
%F A257077 a(n) << sqrt(n)*log(n). - _Charles R Greathouse IV_, Apr 23 2015
%e A257077 a(1) = 2, since there is no previous prime.
%e A257077 a(2) = 1, since 3 - 2 = 1.
%e A257077 a(3) = 3, since 5 - 2 = 3.
%e A257077 a(4) = 2, since 7 - 2 - 3 = 2.
%e A257077 a(5) = 1, since 11 - 2 - 3 - 5 = 1.
%e A257077 a(6) = 3, since 13 - 2 - 3 - 5 = 3.
%e A257077 a(13) = 13, since 41 - 2 - 3 - 5 - 7 - 11 = 13.
%t A257077 lst = {}; i = 1; While[i <= 1000, x = Prime[i]; k = 1; While[x > 0, x -= Prime[k]; k++]; x += Prime[k - 1]; AppendTo[lst, x]; i++]; lst
%o A257077 (PARI) a(n) = {s = prime(n); k = 1; while ((ns = (s - prime(k))) > 0, s = ns; k++); s;} \\ _Michel Marcus_, Apr 16 2015
%o A257077 (PARI) s=0; q=2; forprime(p=2,10, if(s+q>p, s+=q; q=nextprime(q+1)); print1(p-s", ")) \\ _Charles R Greathouse IV_, Apr 22 2015
%Y A257077 Cf. A007504, A013918.
%K A257077 nonn,easy
%O A257077 1,1
%A A257077 _Carlos Eduardo Olivieri_, Apr 15 2015