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.

A298312 The first of three consecutive octagonal numbers the sum of which is equal to the sum of three consecutive primes.

This page as a plain text file.
%I A298312 #13 Jan 22 2018 15:32:51
%S A298312 12160,74576,158240,181056,269400,371008,601216,606600,848008,980408,
%T A298312 1242920,2075008,3292816,3680776,4477408,4685000,5627960,7505008,
%U A298312 8263480,9289280,10397408,10419760,10735208,10757920,12726680,13000008,14200576,15426936,15700256
%N A298312 The first of three consecutive octagonal numbers the sum of which is equal to the sum of three consecutive primes.
%H A298312 Chai Wah Wu, <a href="/A298312/b298312.txt">Table of n, a(n) for n = 1..10000</a> (n = 1..70 from Colin Barker)
%e A298312 12160 is in the sequence because 12160+12545+12936 (consecutive octagonal numbers) = 37641 = 12541+12547+12553 (consecutive primes).
%o A298312 (PARI) L=List(); forprime(p=2, 20000000, q=nextprime(p+1); r=nextprime(q+1); t=p+q+r; if(issquare(36*t-180, &sq) && (sq-12)%18==0, u=(sq-12)\18; listput(L, 3*u^2-2*u))); Vec(L)
%o A298312 (Python)
%o A298312 from __future__ import division
%o A298312 from sympy import prevprime, nextprime
%o A298312 A298312_list, n, m = [], 1, 30
%o A298312 while len(A298312_list) < 10000:
%o A298312     k = prevprime(m//3)
%o A298312     k2 = nextprime(k)
%o A298312     if prevprime(k) + k + k2 == m or k + k2 + nextprime(k2) == m:
%o A298312         A298312_list.append(n*(3*n-2))
%o A298312     n += 1
%o A298312     m += 18*n + 3 # _Chai Wah Wu_, Jan 22 2018
%Y A298312 Cf. A000040, A000567, A054643, A298073, A298168, A298169, A298222, A298223, A298250, A298251, A298272, A298273, A298301, A298302, A298313.
%K A298312 nonn
%O A298312 1,1
%A A298312 _Colin Barker_, Jan 17 2018