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.

A366274 a(n) is the least k such that prime(n+1+k) >= prime(n)+prime(n+1).

This page as a plain text file.
%I A366274 #48 Dec 09 2023 07:07:45
%S A366274 1,2,2,3,4,4,4,5,6,7,8,9,10,10,10,13,13,13,14,14,15,15,16,18,20,20,19,
%T A366274 19,18,22,24,24,25,27,27,27,29,28,29,30,31,31,33,33,32,34,37,39,38,39,
%U A366274 40,40,41,42,42,43,42,43,43,43
%N A366274 a(n) is the least k such that prime(n+1+k) >= prime(n)+prime(n+1).
%C A366274 a(n) is the number of primes between prime(n) and prime(n) + prime(n+1).
%C A366274 Conjecture: for n >= 3, a(n) < n.
%H A366274 Patrick Butler, <a href="/A366274/b366274.txt">Table of n, a(n) for n = 1..10000</a>
%F A366274 a(n) = A000720(A001043(n)-1)-n = A000720(A076273(n+1))-n. - _Paolo Xausa_, Dec 09 2023
%e A366274 For n = 5 prime(n) = 11. prime(5) + prime(6) = 11+13=24.  The 4th prime after 13 is 29 which is the next prime after 13 greater than or equal to 24. So a(5) = 4.
%p A366274 R:= 1: pn:= 2: pn1:= 3: p:=5: m:= 4: pp:= 7:
%p A366274 for n from 2 to 100 do
%p A366274   pn:= pn1; pn1:= nextprime(pn1);
%p A366274   while pp <= pn + pn1 do m:= m+1; pp:= nextprime(pp); od;
%p A366274   R:= R, m-n-1;
%p A366274 od:
%p A366274 R; # _Robert Israel_, Oct 31 2023
%t A366274 A366274[n_]:=PrimePi[Prime[n]+Prime[n+1]-1]-n;Array[A366274,100] (* _Paolo Xausa_, Dec 09 2023 *)
%o A366274 (Python)
%o A366274 m=0
%o A366274 #list here is a list of prime numbers A000040.
%o A366274 def a(n):
%o A366274     global list
%o A366274     sum= list[n]+list[n+1]
%o A366274     i=n+2
%o A366274     while True:
%o A366274         if(list[i]>=sum):
%o A366274             m=i
%o A366274             break
%o A366274         i=i+1
%o A366274     k = m-(n+1)
%o A366274     return k
%o A366274 #
%o A366274 #calculate the terms of the sequence a(n).
%o A366274 seq = []
%o A366274 for n in range(0,firstN):
%o A366274    seq.append(a(n))
%o A366274 (PARI) a(n) = my(k=1, q=prime(n)+prime(n+1)); while(prime(n+k) < q, k++); k; \\ _Michel Marcus_, Oct 06 2023
%Y A366274 Cf. A000720, A001043, A076273, A098084, A098085.
%K A366274 nonn
%O A366274 1,2
%A A366274 _Patrick Butler_, Oct 05 2023