OFFSET
1,1
COMMENTS
a(n) is the least semiprime > a(n-1) such that (a(n) mod 2) != (a(n-1) mod 2).
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
EXAMPLE
The sequence starts with 4, which is even.
The next semiprime is 6, but that's also even, so 6 is skipped over and the sequence continues with 9, which is odd.
The next semiprime is 10, and since that's even, it's the next term in the sequence.
MAPLE
R:= 4: x:= 3: count:= 1:
while count < 100 do
x:= x+2;
if numtheory:-bigomega(x) = 2 then
count:= count+1; R:= R, x; x:= x-1
fi
od:
R; # Robert Israel, Aug 04 2023
MATHEMATICA
s={4}; a=4; Do[a=a+1; While[PrimeOmega[a]!=2, a=a+2]; AppendTo[s, a], {100}]; s (* Zak Seidov, Feb 12 2015 *)
PROG
(PARI)s=[4]; a=4; for(k=1, 100, a=a+1; while(2<>bigomega(a), a=a+2); s=concat(s, a)); s \\ Zak Seidov, Feb 12 2015
(Sage)
A=[4]
for x in [2..314]:
if x % 2 != A[-1] % 2 and is_prime(x//prime_divisors(x)[0]):
A.append(x) # Tom Edgar, Feb 12 2015
CROSSREFS
KEYWORD
nonn
AUTHOR
Zak Seidov, Feb 10 2015
STATUS
approved