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.

A249114 Take the counting numbers and continue adding 1, 2, ..., a(n) until one reaches a fourth prime.

This page as a plain text file.
%I A249114 #25 Oct 03 2020 09:28:21
%S A249114 7,6,19,10,12,25,11,9,40,13,15,25,11,17,67,6,15,22,15,18,43,9,12,34,
%T A249114 12,9,31,9,32,58,8,21,28,14,12,37,11,9,55,13,23,46,11,14,43,10,15,34,
%U A249114 24,26,28,9,15,37,23,18,40,6,24,61,8,18,43,22,27,37,20,9
%N A249114 Take the counting numbers and continue adding 1, 2, ..., a(n) until one reaches a fourth prime.
%C A249114 Conjecturally (Hardy & Littlewood conjecture F), a(n) exists for all n. - _Charles R Greathouse IV_, Oct 21 2014
%C A249114 It appears that the minimum value reached by a(n) is 6. This occurs for n=2, 16, 58, 136, 178, 418, 598, 808, ... . - _Michel Marcus_, Oct 26 2014
%C A249114 The conjecture in the previous line is true - if n is odd, then n+1 is even, n+3 is even, n+6 and n+10 are odd, etc., so a(n)>6. If n is even, then +1 and +3 are odd, +6, +10 are even, so the fourth prime can be first for a(n)=6. - _Jon Perry_, Oct 29 2014
%C A249114 Conjecture: a(n) is odd approximately 50% of the time. - _Jon Perry_, Oct 29 2014
%H A249114 Charles R Greathouse IV, <a href="/A249114/b249114.txt">Table of n, a(n) for n = 1..10000</a>
%F A249114 a(n) = Min_{k>0 | { n+A000217(j), j=1...k} contains four primes}. - _M. F. Hasler_, Oct 29 2014
%e A249114 a(1) = 7 because 1+1+2+3+4+5+6+7 = 29 and exactly three partial sums are prime (2,7,11).
%e A249114 a(2) = 6 because 2+1+2+3+4+5+6 = 23 and exactly three partial sums are prime (3,5,17).
%p A249114 f:= proc(n) local j,count;
%p A249114       count:= 0;
%p A249114       for j from 1 do
%p A249114         if isprime(n + j*(j+1)/2) then
%p A249114            count:= count+1;
%p A249114            if count = 4 then return j fi
%p A249114         fi
%p A249114       od
%p A249114 end proc:
%p A249114 seq(f(n),n=1..100); # _Robert Israel_, Oct 29 2014
%t A249114 a[n_] := Module[{j, cnt = 0}, For[j = 1, True, j++, If[PrimeQ[n+j(j+1)/2], cnt++; If[cnt == 4, Return[j]]]]];
%t A249114 Array[a, 100] (* _Jean-François Alcover_, Oct 03 2020, after Maple *)
%o A249114 (PARI) a(n)=my(k, s=4); while(s, if(isprime(n+=k++), s--)); k \\ _Charles R Greathouse IV_, Oct 21 2014
%Y A249114 Cf. A085415, A249112, A249113.
%K A249114 easy,nonn
%O A249114 1,1
%A A249114 _Gil Broussard_, Oct 21 2014