OFFSET
1,1
COMMENTS
Given the n-th semiprime, it is occasionally possible to form the (n+1)-th semiprime using the same digits in a different order.
"Anagram" means that both semiprimes must not only use the same digits but must use each digit the same number of times.
EXAMPLE
278 and 287 are two successive semiprimes.
MAPLE
with(numtheory):T:=array(1..50000):k:=0:for i from 1 to 200000 do:if bigomega(i)=2 then k:=k+1:T[k]:=i:else fi:od:for n from 1 to k-1 do:p1:=T[n]:p2:= T[n+1]:pp1:=convert(p1, base, 10): pp2:=convert(p2, base, 10):n1:=sort(pp1):n2:=sort(pp2): if n1=n2 then printf(`%d, `, p1):else fi:od:
MATHEMATICA
range[n_Integer]:=Select[Range@n, PrimeOmega@#==2&];
anagramQ[l_List]:=(l1=Sort@#&/@IntegerDigits@l; l1[[1]]==l1[[2]]);
Select[Partition[range@100000, 2, 1], anagramQ]\[Transpose]//First (* Hans Rudolf Widmer, Oct 06 2021 *)
CROSSREFS
KEYWORD
nonn,base,less
AUTHOR
Michel Lagneau, Aug 12 2013
STATUS
approved