OFFSET
1,1
COMMENTS
In general, the prime factors, p, of a(n) are given by: p = sqrt(a(n) + (k/2)^2) +- (k/2) where k is the positive difference of the prime factors. Equivalently, p = (1/2)( sqrt(4a(n) + k^2) +- k ). - Wesley Ivan Hurt, Jun 28 2013
LINKS
Zak Seidov and K. D. Bajpai, Table of n, a(n) for n = 1..10000 (first 1956 terms from Zak Seidov)
FORMULA
Sum_{n>=1} 1/a(n)^s = (1/2)*(P(s)^2 + P(2*s)) - P(s)/2^s, for s>1, where P is the prime zeta function. - Amiram Eldar, Nov 21 2020
EXAMPLE
From K. D. Bajpai, Jul 05 2014: (Start)
15 is a term because it is an odd number and 15 = 3 * 5, which is semiprime.
39 is a term because it is an odd number and 39 = 3 * 13, which is semiprime. (End)
MAPLE
A046315 := proc(n) option remember; local r;
if n = 1 then RETURN(9) fi;
for r from procname(n - 1) + 2 by 2 do
if numtheory[bigomega](r) = 2 then
RETURN(r)
end if
end do
end proc:
seq(A046315(n), n=1..56); # Peter Luschny, Feb 15 2011
MATHEMATICA
Reap[Do[If[Total[FactorInteger[n]][[2]] == 2, Sow[n]], {n, 1, 400, 2}]][[2, 1]] (* Zak Seidov *)
fQ[n_] := Plus @@ Last /@ FactorInteger@ n == 2; Select[2 Range@ 150 - 1, fQ] (* Robert G. Wilson v, Feb 15 2011 *)
Select[Range[5, 301, 2], PrimeOmega[#]==2&] (* Harvey P. Dale, May 22 2015 *)
PROG
(PARI) list(lim)=my(u=primes(primepi(lim\3)), v=List(), t); for(i=2, #u, for(j=i, #u, t=u[i]*u[j]; if(t>lim, break); listput(v, t))); vecsort(Vec(v)) \\ Charles R Greathouse IV, Jul 19 2011
(Haskell)
a046315 n = a046315_list !! (n-1)
a046315_list = filter odd a001358_list -- Reinhard Zumkeller, Jan 02 2014
(Python)
from math import isqrt
from sympy import primepi, primerange
def A046315(n):
def f(x): return int(n+x+((t:=primepi(s:=isqrt(x)))*(t-1)>>1)-sum(primepi(x//k) for k in primerange(3, s+1)))
m, k = n, f(n)
while m != k:
m, k = k, f(k)
return m # Chai Wah Wu, Aug 17 2024
CROSSREFS
KEYWORD
nonn
AUTHOR
Patrick De Geest, Jun 15 1998
STATUS
approved