login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A323162
a(n) = 1 if both n and n-1 are composite, 0 otherwise.
4
0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 1
OFFSET
1
COMMENTS
Characteristic function of A005381.
FORMULA
a(1) = 0; for n > 1, a(n) = (1-A010051(n-1)) * (1-A010051(n)).
a(A005381(n)) = 1, a(A093515(n)) = 0.
For n >= 4, a(n) = 1-A090405(n-2).
MATHEMATICA
Map[Boole[AllTrue[#, CompositeQ]] &, Partition[Range[0, 120], 2, 1]] (* Michael De Vlieger, Jan 07 2019 *)
PROG
(PARI) A323162(n) = ((n>1)&&(!isprime(n))&&(!isprime(n-1)));
CROSSREFS
KEYWORD
nonn
AUTHOR
Antti Karttunen, Jan 07 2019
STATUS
approved