OFFSET
1,2
LINKS
Charles R Greathouse IV, Table of n, a(n) for n = 1..10000
FORMULA
a(n) ~ 2n. - Charles R Greathouse IV, Apr 07 2015
MATHEMATICA
Select[Range@94, PrimeQ[#/2]||OddQ[#]&] (* Ivan N. Ianakiev, Apr 08 2015 *)
PROG
(PARI) lista(nn) = nb = primepi(nn)\2; vecsort(setunion(vector(prime(nb), n, 2*n-1), 2*primes(nb))); \\ Michel Marcus, Apr 07 2015
(PARI) list(lim)=setunion(vector((lim+1)\2, i, 2*i-1), 2*primes([2, lim])) \\ Charles R Greathouse IV, Apr 07 2015
(Python)
from sympy import primepi
def A256421(n):
def f(x): return int(n+(m:=x>>1)-primepi(m))
m, k = n, f(n)
while m != k: m, k = k, f(k)
return m # Chai Wah Wu, Oct 15 2024
CROSSREFS
KEYWORD
nonn
AUTHOR
N. J. A. Sloane, Apr 07 2015
STATUS
approved