login
A175854
Number of anagrams of n that are divisible by exactly 3 primes (counted with multiplicity).
2
0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 1, 1, 0, 1, 0, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 0
OFFSET
1
COMMENTS
An anagram of a k-digit number is a permutation of the digits that does not begin with 0.
This is to A014612, as A131371 is to semiprimes A001358, and as A046810 is to primes A000040.
The first term > 1 is a(103)=2.
LINKS
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