OFFSET
1,1
COMMENTS
LINKS
Alois P. Heinz, Table of n, a(n) for n = 1..1000
EXAMPLE
51 is in the sequence because, though it is a semiprime whose digits are in descending order, once the digits are sorted to be nondecreasing, it is the semiprime 15, whose digits are (left to right) nondecreasing.
MAPLE
h:= proc(m) local k; for k from m+1 while isprime(k) or
add(i[2], i=ifactors(k)[2])<>2 do od; k
end:
a:= proc(n) option remember; local k, l, s;
k:= h(a(n-1));
do l:= sort(convert(k, base, 10));
s:= add(l[i]*10^(nops(l)-i), i=1..nops(l));
if h(s-1)=s then return k else k:=h(k) fi
od
end: a(0):=0:
seq(a(n), n=1..100); # Alois P. Heinz, Apr 22 2012
MATHEMATICA
Select[Range[300], PrimeOmega[#]==2&&PrimeOmega[FromDigits[ Sort[ IntegerDigits[ #]]]]==2&] (* Harvey P. Dale, Nov 13 2014 *)
CROSSREFS
KEYWORD
nonn,base,easy
AUTHOR
Jonathan Vos Post, Apr 18 2012
EXTENSIONS
More terms from Alois P. Heinz, Apr 22 2012
STATUS
approved