Logo

Greetings from The On-Line Encyclopedia of Integer Sequences!

Hints

Search: id:A074332
Displaying 1-1 of 1 results found. page 1
     Format: long | short | internal | text      Sort: relevance | references | number      Highlight: on | off
A074332 Direction from n-th perfect power to closest prime (-1 if down, 1 if up, 0 if two primes are closest). +0
1
-1, 0, 1, 0, -1, 1, -1, 1, -1, 1, 0, 0, -1, -1, -1, 1, 0, 1, -1, 1, 0, 1, -1, -1, 0, -1, 1, -1, 0, -1, 1, 1, -1, 0, -1, 1, -1, 1, -1, -1, 1, 1, 0, 1, 1, -1, 1, 1, -1, -1, -1, 0, 0, 1, 1, 1, -1, -1, 1, 1, -1, 1, -1, 1, -1, 0, -1, 1, 1, -1, 1, 1, -1, -1, 1, 1, -1, 0, 1, -1, 1, 0, -1, -1, -1, 1, 1, -1, 1, 1, 0, -1, -1, 1, -1, 1, 1, 0, -1, 1, -1, 1, 1, 1, -1 (list; graph; listen)
OFFSET

1,1

FORMULA

Sign(n-th perfect power - closest prime) or 0 if two primes are closest.

EXAMPLE

The 7th perfect power (A001597) is 27. The closest prime to 27 is 29. sign(27-29)=-1, so a(7)=-1. The 11th perfect power is 64. There is no single closest prime to 64, since two primes are closest, namely 61 and 67, so a(11)=0.

MATHEMATICA

NextPrim[n_] := Block[{k = n + 1}, While[ !PrimeQ[k], k++ ]; k]; PrevPrim[n_] := Block[{k = n - 1}, While[ !PrimeQ[k], k-- ]; k]; pp = Select[ Range[10000], !PrimeQ[ # ] && Apply[ GCD, Last[ Transpose[FactorInteger[ # ]]]] > 1 & ]; Join[{-1}, Sign[ Table[ NextPrim[pp[[n]]] - pp[[n]], {n, 1, 124}] - Table[ pp[[n]] - PrevPrim[pp[[n]]], {n, 1, 124}]]]

CROSSREFS

Cf. A001597.

Sequence in context: A054354 A156728 A071039 this_sequence A152065 A113428 A133101

Adjacent sequences: A074329 A074330 A074331 this_sequence A074333 A074334 A074335

KEYWORD

sign

AUTHOR

N. Fernandez (primeness(AT)borve.org), Oct 12 2002

EXTENSIONS

Edited by Robert G. Wilson v (rgwv(AT)rgwv.com), Oct 13 2002

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 November 27 22:38 EST 2009. Contains 167602 sequences.


AT&T Labs Research