Logo

Greetings from The On-Line Encyclopedia of Integer Sequences!

Hints

Search: id:A157480
Displaying 1-1 of 1 results found. page 1
     Format: long | short | internal | text      Sort: relevance | references | number      Highlight: on | off
A157480 The differences between the primes and the next squares are prime. +0
1
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; listen)
OFFSET

1,1

COMMENT

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.

PROGRAM

(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 this_sequence A065584 A153651 A075032

Adjacent sequences: A157477 A157478 A157479 this_sequence A157481 A157482 A157483

KEYWORD

nonn

AUTHOR

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

page 1

Search completed in 0.005 seconds

Lookup | Welcome | Find friends | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Transforms | Puzzles | Hot | Classics
More pages | Superseeker | Maintained by N. J. A. Sloane (njas@research.att.com)

Last modified December 2 11:54 EST 2009. Contains 167921 sequences.


AT&T Labs Research