login
Number of prime squares with maximum integer n (see comment for definition).
0

%I #4 Mar 31 2012 13:21:56

%S 1,3,5,11,14,21,29,37,56,88,110,145,171,197,241,302,347,392,438,484,

%T 555,650,717,806,916,1026,1180,1334,1451,1600,1765,1930,2101,2315,

%U 2539,2816,3108,3400,3702,4063

%N Number of prime squares with maximum integer n (see comment for definition).

%C A prime square is constructed by drawing a square and placing a positive integer at each corner. All adjacent corners must sum to a prime. The maximum integer is the largest integer that may be used.

%e a(4)=11 since we have the 2 X 2 squares:

%e 11 21 21 32 32 41 43 43 43 43 41

%e 11 11 12 21 23 14 14 34 12 32 12

%o (PARI) { ps(n)=local(s); s=2; forstep (i1=1,n,2, forstep (i2=2,n,2, forstep (i3=i1,n,2, forstep (i4=i2,n,2, if (isprime(i1+i2) && isprime(i2+i3) && isprime(i3+i4) && isprime(i4+i1),s++))))); if (n==1,s=1); if (n==2,s=3); s } for (i=1,40,print1(ps(i)","))

%K nonn

%O 1,2

%A _Jon Perry_, Aug 28 2003