OFFSET
1,2
COMMENTS
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.
EXAMPLE
a(4)=11 since we have the 2 X 2 squares:
11 21 21 32 32 41 43 43 43 43 41
11 11 12 21 23 14 14 34 12 32 12
PROG
(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)", "))
CROSSREFS
KEYWORD
nonn
AUTHOR
Jon Perry, Aug 28 2003
STATUS
approved