login
A165955
n-th odd nonprime plus n-th even nonprime.
1
1, 13, 21, 29, 35, 39, 47, 51, 57, 65, 71, 75, 81, 85, 93, 97, 103, 111, 115, 121, 127, 131, 137, 141, 145, 151, 159, 167, 173, 177, 181, 185, 189, 193, 199, 205, 209, 217, 221, 225, 229, 237, 241, 247, 251, 257, 263, 267, 273, 277, 285, 289, 293, 297, 305, 313, 317, 321, 325
OFFSET
1,2
LINKS
FORMULA
a(n) = A014076(n) + A163300(n).
EXAMPLE
a(1) = 1+0 = 1. a(2) = 9+4 = 13. a(3) = 15+6 = 21.
MATHEMATICA
A014076 := Select[Range@500, ! PrimeQ@# && OddQ@# &]; A163300 := Drop[Range[0, 500, 2], {2}]; Table[(A163300[[n]] + A014076[[n]]), {n, 1, 50}] (* G. C. Greubel, Sep 17 2017 *)
Module[{nn=300, np, enp, onp, len}, np=Select[Range[0, nn], !PrimeQ[#]&]; enp= Select[ np, EvenQ]; onp=Select[np, OddQ]; len=Min[Length[enp], Length[ onp]]; Total/@Thread[{Take[enp, len], Take[onp, len]}]] (* Harvey P. Dale, Nov 28 2018 *)
PROG
(Python)
from sympy import primepi
def A165955(n):
if n == 1: return 1
m, k = n-1, primepi(n) + n - 1 + (n>>1)
while m != k:
m, k = k, primepi(k) + n - 1 + (k>>1)
return m+(n<<1) # Chai Wah Wu, Aug 01 2024
CROSSREFS
KEYWORD
nonn
AUTHOR
EXTENSIONS
Entries checked by R. J. Mathar, Oct 10 2009
STATUS
approved