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.

A226152 Numbers n such that n^2 is an average of 4 consecutive primes.

This page as a plain text file.
%I A226152 #9 Jun 06 2013 08:09:53
%S A226152 3,9,12,21,24,35,72,126,129,179,189,194,198,214,243,253,255,279,304,
%T A226152 322,432,443,480,487,511,523,663,681,696,699,711,717,721,734,738,796,
%U A226152 802,838,910,975,1008,1034,1070,1144,1215,1230,1237,1265,1276,1370,1375,1386,1469
%N A226152 Numbers n such that n^2 is an average of 4 consecutive primes.
%C A226152 Integers of the form sqrt(A102655(k)) for any k. - _R. J. Mathar_, Jun 06 2013
%F A226152 a(n) = A051395(n)/2.
%p A226152 A034963 := proc(n)
%p A226152     add(ithprime(i), i=n..n+3) ;
%p A226152 end proc:
%p A226152 for n from 1 to 90000 do
%p A226152     s := A034963(n)/4 ;
%p A226152     if type(s,'integer') then
%p A226152     if issqr(s) then
%p A226152         printf("%d, ", sqrt(s)) ;
%p A226152     end if;
%p A226152     end if;
%p A226152 end do: # _R. J. Mathar_, Jun 06 2013
%o A226152 (C)
%o A226152 #include <stdio.h>
%o A226152 #include <stdlib.h>
%o A226152 #include <math.h>
%o A226152 #define TOP (1ULL<<30)
%o A226152 int main() {
%o A226152   unsigned long long i, j, p1, p2, p3, r, s;
%o A226152   unsigned char *c = (unsigned char *)malloc(TOP/8);
%o A226152   memset(c, 0, TOP/8);
%o A226152   for (i=3; i < TOP; i+=2)
%o A226152     if ((c[i>>4] & (1<<((i>>1) & 7)))==0 /*&& i<(1ULL<<32)*/)
%o A226152         for (j=i*i>>1; j<TOP; j+=i)  c[j>>3] |= 1 << (j&7);
%o A226152   for (p3=2, p2=3, p1=5, i=7; i < TOP; i+=2)
%o A226152     if ((c[i>>4] & (1<<((i>>1) & 7)))==0) {
%o A226152       s = p3 + p2 + p1 + i;
%o A226152       if (s%4==0) {
%o A226152         s/=4;
%o A226152         r = sqrt(s);
%o A226152         if (r*r==s) printf("%llu, ", r);
%o A226152       }
%o A226152       p3 = p2, p2 = p1, p1 = i;
%o A226152     }
%o A226152   return 0;
%o A226152 }
%Y A226152 Cf. A102655, A051395, A206280.
%K A226152 nonn
%O A226152 1,1
%A A226152 _Alex Ratushnyak_, May 28 2013