%I #13 Aug 27 2020 12:12:06
%S 5,12,18,50,53,56,60,67,89,92,113,120,126,131,144,160,173,184,186,204,
%T 211,216,220,236,242,248,251,266,276,288,290,293,300,304,307,320,322,
%U 328,337,340,368,374,379,384,392
%N Examine the sequence of all (even or odd) semiprimes, A001358, and record the averages of any pair of successive terms of the same parity.
%H N. J. A. Sloane, <a href="/A109403/b109403.txt">Table of n, a(n) for n = 1..20000</a>
%e 5 is OK because sp(1)=4, sp(2)=6 and (4+6)/2=5; 12 is OK because sp(4)=10, sp(5)=14 and (10+14)/2=12; sp(n)=n-th semiprime.
%p A001358 := proc(n) option remember; local a; if n = 1 then 4; else for a from procname(n-1)+1 do if numtheory[bigomega](a) = 2 then return a; end if; end do: end if; end proc:
%p # To produce a b-file
%p M:=50000; c:=0;
%p for n from 1 to M do
%p if type(A001358(n)+A001358(n+1),even) then c:=c+1;
%p m:=(A001358(n)+A001358(n+1))/2;
%p lprint(c,m);
%p fi; od; # _N. J. A. Sloane_, Aug 27 2020
%t Select[Mean/@Partition[Select[Range[400],PrimeOmega[#]==2&],2,1],IntegerQ] (* _Harvey P. Dale_, Aug 27 2020 *)
%Y Cf. A001358, A100484.
%K nonn
%O 1,1
%A _Zak Seidov_, Jun 27 2005
%E Definition corrected by _N. J. A. Sloane_, Aug 26 2020. The original definition appeared to be based on A100484, but that was incorrect. Thanks to _Harvey P. Dale_ for pointing out that something was wrong.
|