OFFSET
1,3
LINKS
Reinhard Zumkeller, Table of n, a(n) for n = 1..10000
EXAMPLE
a(120) = #{2,3,5,7,11,23,29,41,47,53,59,83,89,107,113} = 15.
MATHEMATICA
Accumulate[Table[If[AllTrue[{n, 2n+1}, PrimeQ]||AllTrue[{n, (n-1)/2}, PrimeQ], 1, 0], {n, 100}]] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Sep 24 2019 *)
PROG
(PARI) a(n) = my(nb=0); forprime(p=2, n, if (isprime(2*p+1) || isprime((p-1)/2), nb++)); nb; \\ Michel Marcus, Nov 06 2022
CROSSREFS
KEYWORD
nonn
AUTHOR
Reinhard Zumkeller, Feb 18 2009
STATUS
approved