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

Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A157480 The differences between the primes and the next squares are prime. 0
2, 13, 11, 2, 5, 3, 19, 17, 2, 7, 5, 107, 23, 101, 2, 11, 5, 3, 257, 29, 71, 2, 17, 11, 3, 43, 41, 37, 467, 31, 17, 13, 7, 5, 47, 173, 167, 1601, 2, 23, 17, 719, 5, 3, 59, 701, 113, 2, 29, 347, 23, 17, 83, 5, 67, 61, 131, 53, 47, 43, 41, 31, 17, 13, 11, 7, 569, 239, 53, 227, 47, 2 (list; graph; refs; listen; history; internal format)
OFFSET

1,1

COMMENTS

It is appropriate to add a counter to the program to ensure a square is found

for all primes <= n. Here we set n^2 as the difference upper bound. This

appears to be high but with no loss in efficiecy since we break out of the

loop when the first square is found. This partial listing was generated for

primes < 1000. Notice that 1601 would have been missed had we set the

difference upper bound to 1000.

EXAMPLE

The difference between prime 3 and the square 16 is 13 which is prime and in

the sequence.

PROG

(PARI) g(n)= c=0; forprime(x=2, n, for(k=1, n^2, if(issquare(x+k)&&isprime(k),

print1(k", "); c++; break))); c

CROSSREFS

Sequence in context: A128155 A158088 A124869 * A065584 A153651 A075032

Adjacent sequences:  A157477 A157478 A157479 * A157481 A157482 A157483

KEYWORD

nonn

AUTHOR

Cino Hilliard (hillcino368(AT)hotmail.com), Mar 01 2009

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Transforms | Puzzles | Hot | Classics
Recent Additions | More pages | Superseeker | Maintained by The OEIS Foundation Inc.

Content is available under The OEIS End-User License Agreement .

Last modified February 13 19:52 EST 2012. Contains 205536 sequences.