OFFSET
1,4
COMMENTS
Are there no adjacent equal terms? I have verified this up to n = 10^6. - Gus Wiseman, Dec 04 2020
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
FORMULA
EXAMPLE
From Gus Wiseman, Dec 04 2020: (Start)
The sequence of semiprimes together with the corresponding differences begins:
4: 1 - 1 = 0
6: 2 - 1 = 1
9: 2 - 2 = 0
10: 3 - 1 = 2
14: 4 - 1 = 3
15: 3 - 2 = 1
21: 4 - 2 = 2
22: 5 - 1 = 4
25: 3 - 3 = 0
26: 6 - 1 = 5
33: 5 - 2 = 3
(End)
MAPLE
isA001358 := proc(n) numtheory[bigomega](n) = 2 ; end proc:
A001358 := proc(n) option remember ; if n = 1 then return 4 ; else for a from procname(n-1)+1 do if isA001358(a) then return a; end if; end do; end if; end proc:
A176506 := proc(n) numtheory[pi](A084127(n)) - numtheory[pi](A084126(n)) ; end proc: seq(A176506(n), n=1..120) ; # R. J. Mathar, Apr 22 2010
# Alternative:
N:= 500: # to use the first N semiprimes
Primes:= select(isprime, [2, seq(i, i=3..N/2, 2)]):
SP:= NULL:
for i from 1 to nops(Primes) do
for j from 1 to i do
sp:= Primes[i]*Primes[j];
if sp > N then break fi;
SP:= SP, [sp, i-j]
od od:
SP:= sort([SP], (s, t) -> s[1]<t[1]):
map(t -> t[2], SP); # Robert Israel, Jan 17 2019
MATHEMATICA
M = 500; (* to use the first M semiprimes *)
primes = Select[Join[{2}, Range[3, M/2, 2]], PrimeQ];
SP = {};
For[i = 1, i <= Length[primes], i++,
For[j = 1, j <= i, j++,
sp = primes[[i]] primes[[j]];
If[sp > M, Break []];
AppendTo[SP, {sp, i - j}]
]];
SortBy[SP, First][[All, 2]] (* Jean-François Alcover, Jul 18 2020, after Robert Israel *)
Table[If[!SquareFreeQ[n], 0, -Subtract@@PrimePi/@First/@FactorInteger[n]], {n, Select[Range[100], PrimeOmega[#]==2&]}] (* Gus Wiseman, Dec 04 2020 *)
PROG
(PARI) lista(nn) = {my(vsp = select(x->(bigomega(x)==2), [1..nn])); vector(#vsp, k, my(f=factor(vsp[k])[, 1]); primepi(vecmax(f)) - primepi(vecmin(f))); } \\ Michel Marcus, Jul 18 2020
CROSSREFS
Cf. A109313.
A087794 is product of the same indices.
A176504 is the sum of the same indices.
A115392 lists positions of first appearances.
A128301 lists positions of 0's.
A172348 lists positions of 1's.
A338898 has this sequence as row differences.
A338900 is the squarefree case.
A006881 lists squarefree semiprimes.
A024697 is the sum of semiprimes of weight n.
A056239 gives sum of prime indices (Heinz weight).
A087112 groups semiprimes by greater factor.
A338904 groups semiprimes by weight.
KEYWORD
nonn,look
AUTHOR
Juri-Stepan Gerasimov, Apr 19 2010
EXTENSIONS
a(51) and a(69) corrected by R. J. Mathar, Apr 22 2010
STATUS
approved