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.

A298273 The first of three consecutive primes the sum of which is equal to the sum of three consecutive hexagonal numbers.

This page as a plain text file.
%I A298273 #11 Jan 17 2018 11:45:54
%S A298273 13,6427,7873,9439,17203,20287,22783,30133,77417,90523,93949,115903,
%T A298273 117841,119797,324403,367649,399163,424573,439441,473839,501493,
%U A298273 576193,597859,628861,693223,746023,987697,1044733,1151399,1212889,1263247,1360417,1454351
%N A298273 The first of three consecutive primes the sum of which is equal to the sum of three consecutive hexagonal numbers.
%H A298273 Robert Israel, <a href="/A298273/b298273.txt">Table of n, a(n) for n = 1..10000</a> (first 100 terms from Colin Barker)
%e A298273 13 is in the sequence because 13+17+19 (consecutive primes) = 49 = 6+15+28 (consecutive hexagonal numbers).
%p A298273 N:= 100: # to get a(1)..a(100)
%p A298273 count:= 0:
%p A298273 mmax:= floor((sqrt(24*N-87)-9)/12):
%p A298273 for i from 1 while count < N do
%p A298273   mi:= 2*i;
%p A298273   m:= 6*mi^2+9*mi+7;
%p A298273   r:= ceil((m-8)/3);
%p A298273   p1:= prevprime(r+1);
%p A298273   p2:= nextprime(p1);
%p A298273   p3:= nextprime(p2);
%p A298273   while p1+p2+p3 > m do
%p A298273     p3:= p2; p2:= p1; p1:= prevprime(p1);
%p A298273   od:
%p A298273   if p1+p2+p3 = m then
%p A298273     count:= count+1;
%p A298273   A[count]:= p1;
%p A298273   fi
%p A298273 od:
%p A298273 seq(A[i],i=1..count); # _Robert Israel_, Jan 16 2018
%o A298273 (PARI) L=List(); forprime(p=2, 2000000, q=nextprime(p+1); r=nextprime(q+1); t=p+q+r; if(issquare(24*t-87, &sq) && (sq-9)%12==0, u=(sq-9)\12; listput(L, p))); Vec(L)
%Y A298273 Cf. A000040, A000384, A054643, A298073, A298168, A298169, A298222, A298223, A298250, A298251, A298272.
%K A298273 nonn
%O A298273 1,1
%A A298273 _Colin Barker_, Jan 16 2018