OFFSET
1,1
COMMENTS
LINKS
Alois P. Heinz, Table of n, a(n) for n = 1..1000
EXAMPLE
15 is in the sequence because 15 = (3*5)^1 and 15+1 = 16 = (2*2)^2 are both semiprime powers.
MAPLE
spp:= proc(n) option remember; local l;
if n<2 or isprime(n) then false
else l:= ifactors(n)[2];
if nops(l)>2 then false
elif nops(l)=2 then evalb(l[1][2]=l[2][2])
else evalb(irem(l[1][2], 2)=0)
fi
fi
end:
a:= proc(n) option remember; local k;
for k from 1+ `if`(n=1, 8, a(n-1))
while not spp(k) or not spp(k+1)
do od; k
end:
seq(a(n), n=1..80); # Alois P. Heinz, Jan 22 2011
MATHEMATICA
sppQ[n_] := With[{f = FactorInteger[n][[All, 2]]}, n==1 || Length[f]==1 && EvenQ[f[[1]]] || Length[f]==2 && f[[1]]==f[[2]]];
Select[Range[1000], sppQ[#] && sppQ[#+1]&] (* Jean-François Alcover, Nov 21 2020 *)
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Jonathan Vos Post, Jan 22 2011
EXTENSIONS
More terms and edited by Alois P. Heinz, Jan 22 2011
STATUS
approved