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.
%I A226151 #8 Apr 06 2016 12:31:44 %S A226151 8,15,39,56,60,144,155,203,212,216,263,388,451,464,480,555,619,644, %T A226151 680,723,736,788,791,799,876,903,1012,1056,1143,1239,1284,1368,1479, %U A226151 1547,1611,1684,1695,1703,1827,1859,1908,1939,2100,2108,2135,2148,2152,2187,2199,2216 %N A226151 Numbers n such that triangular(n) is a sum of 4 consecutive primes. %H A226151 Harvey P. Dale, <a href="/A226151/b226151.txt">Table of n, a(n) for n = 1..500</a> %p A226151 istriangular:=proc(n) local t1; t1:=floor(sqrt(2*n)); if n = t1*(t1+1)/2 then return t1 ; else return -1; end if; end; %p A226151 A034963 := proc(n) %p A226151 add(ithprime(i),i=n..n+3) ; %p A226151 end proc: %p A226151 for n from 1 to 90000 do %p A226151 ist := istriangular(A034963(n)) ; %p A226151 if ist >= 0 then %p A226151 printf("%d,",ist) ; %p A226151 end if; %p A226151 end do: # _R. J. Mathar_, Jun 04 2013 %t A226151 (Sqrt[8#+1]-1)/2&/@Select[Total/@Partition[Prime[Range[ 60000]],4,1], OddQ[ Sqrt[8#+1]]&] (* _Harvey P. Dale_, Apr 06 2016 *) %o A226151 (C) %o A226151 #include <stdio.h> %o A226151 #include <stdlib.h> %o A226151 #include <math.h> %o A226151 #define TOP (1ULL<<30) %o A226151 int main() { %o A226151 unsigned long long i, j, p1, p2, p3, r, s; %o A226151 unsigned char *c = (unsigned char *)malloc(TOP/8); %o A226151 memset(c, 0, TOP/8); %o A226151 for (i=3; i < TOP; i+=2) %o A226151 if ((c[i>>4] & (1<<((i>>1) & 7)))==0 /*&& i<(1ULL<<32)*/) %o A226151 for (j=i*i>>1; j<TOP; j+=i) c[j>>3] |= 1 << (j&7); %o A226151 for (p3=2, p2=3, p1=5, i=7; i < TOP; i+=2) %o A226151 if ((c[i>>4] & (1<<((i>>1) & 7)))==0) { %o A226151 s = p3 + p2 + p1 + i; %o A226151 r = sqrt(s*2); %o A226151 if (r*(r+1)==s*2) printf("%llu, ", r); %o A226151 p3 = p2, p2 = p1, p1 = i; %o A226151 } %o A226151 return 0; %o A226151 } %Y A226151 Cf. A000217, A034963, A051395, A206280, A226154. %K A226151 nonn %O A226151 1,1 %A A226151 _Alex Ratushnyak_, May 28 2013