login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A226152 Numbers n such that n^2 is an average of 4 consecutive primes. 0

%I #9 Jun 06 2013 08:09:53

%S 3,9,12,21,24,35,72,126,129,179,189,194,198,214,243,253,255,279,304,

%T 322,432,443,480,487,511,523,663,681,696,699,711,717,721,734,738,796,

%U 802,838,910,975,1008,1034,1070,1144,1215,1230,1237,1265,1276,1370,1375,1386,1469

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

%C Integers of the form sqrt(A102655(k)) for any k. - _R. J. Mathar_, Jun 06 2013

%F a(n) = A051395(n)/2.

%p A034963 := proc(n)

%p add(ithprime(i), i=n..n+3) ;

%p end proc:

%p for n from 1 to 90000 do

%p s := A034963(n)/4 ;

%p if type(s,'integer') then

%p if issqr(s) then

%p printf("%d, ", sqrt(s)) ;

%p end if;

%p end if;

%p end do: # _R. J. Mathar_, Jun 06 2013

%o (C)

%o #include <stdio.h>

%o #include <stdlib.h>

%o #include <math.h>

%o #define TOP (1ULL<<30)

%o int main() {

%o unsigned long long i, j, p1, p2, p3, r, s;

%o unsigned char *c = (unsigned char *)malloc(TOP/8);

%o memset(c, 0, TOP/8);

%o for (i=3; i < TOP; i+=2)

%o if ((c[i>>4] & (1<<((i>>1) & 7)))==0 /*&& i<(1ULL<<32)*/)

%o for (j=i*i>>1; j<TOP; j+=i) c[j>>3] |= 1 << (j&7);

%o for (p3=2, p2=3, p1=5, i=7; i < TOP; i+=2)

%o if ((c[i>>4] & (1<<((i>>1) & 7)))==0) {

%o s = p3 + p2 + p1 + i;

%o if (s%4==0) {

%o s/=4;

%o r = sqrt(s);

%o if (r*r==s) printf("%llu, ", r);

%o }

%o p3 = p2, p2 = p1, p1 = i;

%o }

%o return 0;

%o }

%Y Cf. A102655, A051395, A206280.

%K nonn

%O 1,1

%A _Alex Ratushnyak_, May 28 2013

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 24 20:08 EDT 2024. Contains 371963 sequences. (Running on oeis4.)