login
This site is supported by donations to The OEIS Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A062067 a(1) = 1; a(n) is smallest square > a(n-1) such that a(n) + a(n-1) is a prime. 3
1, 4, 9, 64, 169, 400, 529, 900, 961, 1936, 2401, 5476, 6241, 6400, 7921, 9216, 10201, 10816, 11025, 13456, 14161, 15376, 17161, 17956, 19321, 19600, 22201, 22500, 24649, 24964, 27225, 29584, 29929, 31684, 33489, 40804, 41209, 52900 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,2

LINKS

Harry J. Smith, Table of n, a(n) for n = 1..1000

EXAMPLE

9 is the next term after 4 as 4+9 = 13 is a prime.

MATHEMATICA

sqrs=Range[400]^2;

nxt[n_]:=First[Select[sqrs, #>n&&PrimeQ[n+#]&]]

NestList[nxt, 1, 45]  (* Harvey P. Dale, Dec 26 2010 *)

PROG

(PARI) p=1:n=2:for(k=1, 50, while(!isprime(p^2+n^2), n=n+1):print1(n^2", "):p=n:n=n+1)

(PARI) { a=b=1; for (n=1, 1000, if (n>1, until (isprime(a + b^2), b++)); write("b062067.txt", n, " ", a=b^2) ) } \\ Harry J. Smith, Jul 31 2009

(Python)

from sympy import isprime

A062067, a = [1], 1

for _ in range(1, 10000):

....a += 1

....b = 2*a*(a-1) + 1

....while not isprime(b):

........b += 4*(a+1)

........a += 2

....A062067.append(a**2) # Chai Wah Wu, Sep 01 2014

CROSSREFS

Sequence in context: A077163 A231812 A069711 * A110256 A095175 A092396

Adjacent sequences:  A062064 A062065 A062066 * A062068 A062069 A062070

KEYWORD

nonn

AUTHOR

Amarnath Murthy, Jun 12 2001

EXTENSIONS

Corrected and extended by Ralf Stephan, Mar 22 2003

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified June 20 19:36 EDT 2019. Contains 324234 sequences. (Running on oeis4.)