OFFSET
1
COMMENTS
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
EXAMPLE
a(125) = 1 because 125 = 5^3 is divisible by exactly 3 primes (counted with multiplicity); 152 = 2^3 * 19 is in A014613 (quadruprimes); 215 = 5 * 43 is a semiprime; 251 is prime; 512 = 2^9; and 521 is prime.
MAPLE
N:= 10^3:
TP:= select(t -> numtheory:-bigomega(t)=3, {$1..N}):
f:= proc(n) local L, d, w, x, i;
L:= convert(n, base, 10); d:= nops(L);
L:= select(t -> t[-1] <> 0, combinat:-permute(L));
L:= map(t-> add(t[i]*10^(i-1), i=1..d), L);
nops(convert(L, set) intersect TP)
end proc:
map(f, [$1..N]); # Robert Israel, Jan 15 2024
PROG
(Sage)
concat = lambda x: Integer(''.join(map(str, x)))
def A175854(n):
d3 = lambda x: sum(m for p, m in factor(x)) == 3
return sum(1 for p in Permutations(n.digits()) if p[0] != 0 and d3(concat(p))) # D. S. McNeil, Jan 25 2011
CROSSREFS
KEYWORD
nonn,easy,base
AUTHOR
Jonathan Vos Post, Jan 24 2011
STATUS
approved