OFFSET
1,1
MAPLE
A000217inv:=proc(n) local t1; t1:=floor(sqrt(2*n)); if n = t1*(t1+1)/2 then return t1 ; else return -1; end if; end;
isA226155 := proc(n)
local p1, p2, p3, a102655 ;
if isprime(n) then
p1 := nextprime(n) ;
p2 := nextprime(p1) ;
p3 := nextprime(p2) ;
a102655 := (n+p1+p2+p3)/4 ;
if type(a102655, 'integer') then
if A000217inv(a102655) >= 0 then
return true;
else
return false;
end if;
else
return false;
end if;
else
false;
end if;
end proc:
for n from 1 do
p := ithprime(n) ;
if isA226155(p) then
printf("%d, \n", p) ;
end if;
end do: # R. J. Mathar, Jun 06 2013
PROG
(C)
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#define TOP (1ULL<<30)
int main() {
unsigned long long i, j, p1, p2, p3, r, s;
unsigned char *c = (unsigned char *)malloc(TOP/8);
memset(c, 0, TOP/8);
for (i=3; i < TOP; i+=2)
if ((c[i>>4] & (1<<((i>>1) & 7)))==0 /*&& i<(1ULL<<32)*/)
for (j=i*i>>1; j<TOP; j+=i) c[j>>3] |= 1 << (j&7);
for (p3=2, p2=3, p1=5, i=7; i < TOP; i+=2)
if ((c[i>>4] & (1<<((i>>1) & 7)))==0) {
s = p3 + p2 + p1 + i;
if (s%4==0) {
s/=4;
r = sqrt(s*2);
if (r*(r+1)==s*2) printf("%llu, ", p3);
}
p3 = p2, p2 = p1, p1 = i;
}
return 0;
}
CROSSREFS
KEYWORD
nonn
AUTHOR
Alex Ratushnyak, May 28 2013
STATUS
approved