The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
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!)
A226147 Numbers n such that triangular(n) is an average of three successive primes. 2

%I #5 May 29 2013 12:16:50

%S 193,233,265,301,526,709,753,922,961,962,986,1126,1178,1285,1373,1485,

%T 1525,1537,1558,1601,1710,1737,1962,1965,2202,2437,2466,2578,2685,

%U 2693,2862,3206,3346,3462,3622,3682,3937,3938,3965,4005,4017,4018,4058,4393,4489,4498,4717

%N Numbers n such that triangular(n) is an average of three successive primes.

%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, 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 (p2=2, p1=3, i=5; i < TOP; i+=2)

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

%o s = p2 + p1 + i;

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

%o s/=3;

%o r = sqrt(s*2);

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

%o }

%o p2 = p1, p1 = i;

%o }

%o return 0;

%o }

%Y Cf. A076304, A206279, A226145-A226150.

%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 May 31 19:57 EDT 2024. Contains 373003 sequences. (Running on oeis4.)