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

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A283265 a(n) = 1 if n is neither 2 nor a lesser or greater twin prime (in A001097), 0 otherwise. 2
1, 0, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 0, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1 (list; graph; refs; listen; history; text; internal format)
OFFSET

1

COMMENTS

Characteristic sequence of A171821, which is complement of 2 together with the twin primes. (After the original name of the sequence)

The recurrence for this sequence is essentially the sieve of Eratosthenes for the complement of A171821. It is possible to vary the recurrence to get the characteristic sequence of the complement of any prime constellation. The products in the recurrence are over the divisors.

LINKS

Antti Karttunen, Table of n, a(n) for n = 1..65539

Index entries for characteristic functions

FORMULA

a(n) = if n is found in A171821 then 0 else 1.

a(n) = 1 - A164292(n), for n > 2.

Recurrence:

t(1, 1) = 1;

t(2, 1) = 0;

t(n, k) = if n = k then 1 else if n > 2 then if k = 1 then (1 - (Product_{i = 2 .. n} t(n, i))*(Product_{i = 2 .. n - 2} t(n - 2, i)))*(1 - (Product_{i = 2 .. n} t (n, i))*Product_{i = 2 .. n + 2} (t(n + 2, i))) else if (mod (n, k) = 0 then t(n/k, 1) else 1) else 1.

MATHEMATICA

(* Recurrence: *) Clear[t, n, k, i, nn]; nn = 90; t[1, 1] = 1; t[2, 1] = 0; t[n_, k_] := t[n, k] = If[n == k, 1, If[n > 2, If[k == 1, (1 - Product[t[n, i], {i, 2, n}]*Product[t[n - 2, i], {i, 2, n - 2}])*(1 - Product[t[n, i], {i, 2, n}]*Product[t[n + 2, i], {i, 2, n + 2}]), If[Mod[n, k] == 0, t[n/k, 1], 1], 1]]]; Monitor[a = Table[t[n, 1], {n, 1, nn}], n]

PROG

(PARI) a(n)=if(isprime(n) && (isprime(n+2) || isprime(n-2)), 0, n!=2) \\ Charles R Greathouse IV, Mar 05 2017

CROSSREFS

Cf. A164292, A171821, A001097, A129950.

Sequence in context: A100810 A174889 A005171 * A181406 A285252 A076404

Adjacent sequences:  A283262 A283263 A283264 * A283266 A283267 A283268

KEYWORD

nonn

AUTHOR

Mats Granvik, Mar 04 2017

EXTENSIONS

More terms and new name from Antti Karttunen, Jan 03 2019

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

License Agreements, Terms of Use, Privacy Policy. .

Last modified November 20 10:09 EST 2019. Contains 329334 sequences. (Running on oeis4.)