A171386 The characteristic function of 2 and 3: 1 if n is prime such that either n-1 or n+1 is prime, else 0.
0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
Offset: 1
Links
- Index entries for linear recurrences with constant coefficients, signature (1).
Programs
-
Mathematica
Join[{0, 1, 1},LinearRecurrence[{1},{0},102]] (* Ray Chandler, Sep 23 2015 *)
-
PARI
a(n)=n==2||n==3 \\ Charles R Greathouse IV, Sep 24 2015
Extensions
Edited by Charles R Greathouse IV, Mar 23 2010
Comments