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

 

Logo

Annual appeal: Please make a donation to keep the OEIS running! Over 6000 articles have referenced us, often saying "we discovered this result with the help of the OEIS".
Other ways to donate

Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A139312 Characteristic function of the good primes (version 1). 0
0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 0, 1, 0, 1, 1, 1, 1, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 1, 1, 0, 0 (list; graph; refs; listen; history; text; internal format)
OFFSET

2,1

COMMENTS

a(n)=1 if prime(n)^2 - prime(n-1)*prime(n+1) >=0, else a(n)=0.

LINKS

Table of n, a(n) for n=2..106.

FORMULA

a(n) = 1 if A056221(n-1)<=0, else a(n)=0.

MATHEMATICA

f[n_] := If[ Prime[n]^2 - Prime[n - 1]*Prime[n + 1] > 0, 1, 0]; Array[f, 105, 2] (*alternative formula: derived*) Solve[x^2 - (x - a)*(x + b) == 0, x]; a = -Prime[n - 1] + Prime[n]; b = -Prime[n] + Prime[n + 1]; f[n_] = If[-Prime[-1 + n] + 2 Prime[n] - Prime[1 + n] == 0, 0, a*b/(b - a)]; Table[ If[ f[n] > 0, 0, 1], {n, 2, 106}]

If[#[[2]]^2-(#[[1]]#[[3]])>=0, 1, 0]&/@Partition[Prime[Range[110]], 3, 1] (* Harvey P. Dale, Jan 25 2015 *)

PROG

(PARI) a(n)=my(p=prime(n)); p^2>=precprime(p-1)*nextprime(p+1) \\ Charles R Greathouse IV, Jun 24, 2011

CROSSREFS

Cf. A056221, A046869, A068828.

Sequence in context: A141743 A112416 A061265 * A173923 A125122 A000035

Adjacent sequences:  A139309 A139310 A139311 * A139313 A139314 A139315

KEYWORD

nonn,easy

AUTHOR

Roger L. Bagula, Jun 07 2008

EXTENSIONS

All entries corrected. - R. J. Mathar, Charles R Greathouse IV  Robert G. Wilson v, Jun 16 2011

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 | More pages
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy .

Last modified November 21 14:44 EST 2017. Contains 295002 sequences.