a(n) is the smallest prime k such that (prime(n), k, u, v) are the vertices of a square in Ulam's spiral, where k < u < v are all primes; or -1 if there is no such k.

A383595

a(n) is the smallest prime k such that (prime(n), k, u, v) are the vertices of a square in Ulam's spiral, where k < u < v are all primes; or -1 if there is no such k.

Terms

    a(0) =-1a(1) =-1a(2) =-1a(3) =56527a(4) =59a(5) =67a(6) =251a(7) =-1a(8) =-1a(9) =2473a(10) =3001a(11) =43a(12) =43a(13) =41a(14) =173a(15) =1621a(16) =61a(17) =59a(18) =13a(19) =141937a(20) =13a(21) =13a(22) =10459a(23) =331a(24) =33211a(25) =643a(26) =179a(27) =41a(28) =41a(29) =1429

External references