Logo

Greetings from The On-Line Encyclopedia of Integer Sequences!

Hints

Search: id:A104202
Displaying 1-1 of 1 results found. page 1
     Format: long | short | internal | text      Sort: relevance | references | number      Highlight: on | off
A104202 Differences of straddle primes. +0
1
2, 2, 4, 4, 4, 2, 4, 4, 4, 2, 4, 4, 4, 6, 6, 6, 6, 6, 2, 6, 6, 6, 6, 6, 4, 4, 4, 2, 4, 4, 4, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 2, 6, 6, 6, 6, 6, 4, 4, 4, 2, 6, 6, 6, 6, 6, 4, 4, 4, 6, 6, 6, 6, 6, 8, 8, 8, 8, 8, 8, 8, 4, 4, 4, 2, 4, 4, 4, 2, 4, 4, 4, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 4, 4, 4, 6 (list; graph; listen)
OFFSET

4,1

FORMULA

Straddle primes are the nearest primes preceding and following composite n.

EXAMPLE

The first straddle prime pair is 3 and 5 which straddles the composite number

4 and 5-3 = 2 the first entry in the table.

PROGRAM

(PARI) \Straddle primes - largest prime preceding composite n and smallest \prime following n. straddiff(n) = { local (x, y, pp, np); for(x=1, n, y=composite(x); pp=precprime(y); np=nextprime(y); print1(np-pp", ") ) composite(n) = \ The n-th composite number. 1 is defined as as neither prime nor composite. { local(c, x); c=1; x=1; while(c <= n, x++; if(!isprime(x), c++); ); return(x) } }

CROSSREFS

Sequence in context: A104798 A006460 A064137 this_sequence A042946 A037202 A065285

Adjacent sequences: A104199 A104200 A104201 this_sequence A104203 A104204 A104205

KEYWORD

easy,nonn

AUTHOR

Cino Hilliard (hillcino368(AT)gmail.com), Mar 13 2005

page 1

Search completed in 0.002 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 July 24 12:00 EDT 2008. Contains 142294 sequences.


AT&T Labs Research