login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A292438 Characteristic function of non-isolated nonprimes. 1
1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,1
COMMENTS
Non-isolated nonprimes in the sense that at least one of the two adjacent integers is also a nonprime.
LINKS
FORMULA
a(0)=1, a(1)=1, a(2)=0, a(n) = 1 - A010051(n-((n+1) mod 2)) * A010051(n+((n+1) mod 2)) for n > 2.
a(n) = 1 - (pi(n) - pi(n-2))*(pi(n+1) - pi(n-1)), for n>3, where pi = A000720. - Ridouane Oudra, Jan 10 2022
MATHEMATICA
a[0] = 1; a[1] = 1; a[2] = 0; a[n_] := 1 - (PrimePi[n - Mod[n + 1, 2]] - PrimePi[n - Mod[n + 1, 2] - 1]) (PrimePi[n + Mod[n + 1, 2]] - PrimePi[n + Mod[n + 1, 2] - 1]); Table[a[n], {n, 0, 100}]
PROG
(PARI) A292438(n) = if(n<2, 1, !isprime(n)&&((!isprime(n-1))||(!isprime(n+1)))); \\ Antti Karttunen, Jul 02 2018
CROSSREFS
Sequence in context: A279329 A359430 A374121 * A244525 A214263 A263428
KEYWORD
nonn
AUTHOR
Wesley Ivan Hurt, Mar 31 2018
EXTENSIONS
More terms from Antti Karttunen, Jul 02 2018
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified July 1 18:02 EDT 2024. Contains 373920 sequences. (Running on oeis4.)