login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A131371 Number of anagrams of n that are semiprimes. 4
0, 0, 0, 1, 0, 1, 0, 0, 1, 1, 0, 1, 0, 1, 2, 0, 0, 0, 1, 0, 1, 1, 0, 0, 1, 2, 0, 1, 0, 0, 0, 0, 1, 1, 1, 0, 0, 1, 2, 0, 1, 0, 1, 0, 0, 1, 1, 0, 2, 0, 2, 1, 1, 0, 1, 1, 1, 2, 1, 0, 0, 2, 0, 1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 1, 1, 0, 2, 1, 1, 0, 0, 0, 1, 0, 2, 2, 1, 1, 0, 0, 0, 0, 0, 1, 1, 0, 1 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,15
COMMENTS
An anagram of a k-digit number is one of the k! permutations of the digits that does not begin with 0.
LINKS
EXAMPLE
a(123) = 3 because 123 = 3 * 41 is semiprime, 213 = 3 * 71 is semiprime, 321 = 3 * 107 is semiprime, while the other anagrams 132, 231 and 312 have respectively 3, 3 and 5 prime factors with multiplicity.
a(129) = 4 because 129 = 3 * 43 is semiprime, 219 = 3 * 73 is semiprime, 291 = 3 * 97 is semiprime, 921 = 3 * 307 is semiprime, while 192 and 912 have 7 and 6 prime factors with multiplicity.
a(134) = 5 because 134 = 2 * 67 and 143 = 11 * 13 and 314 = 2 * 157 and 341 = 11 * 31 and 413 = 7 * 59 are semiprimes, while 431 is prime.
MAPLE
f:= proc(n) local L, m, t, i;
L:= convert(n, base, 10); m:= nops(L);
nops(select(t -> t[-1] <> 0 and numtheory:-bigomega(add(t[i]*10^(i-1), i=1..m))=2, combinat:-permute(L)));
end proc:
map(f, [$1..200]); # Robert Israel, Jun 11 2023
PROG
(Python)
from sympy import factorint
from sympy.utilities.iterables import multiset_permutations as mp
def c(n):
return sum(factorint(n).values()) == 2
def a(n):
return sum(1 for p in mp(str(n)) if p[0]!="0" and c(t:=int("".join(p))))
print([a(n) for n in range(1, 106)]) # Michael S. Branicky, Jun 11 2023
CROSSREFS
Sequence in context: A248911 A116681 A359911 * A319195 A003475 A248639
KEYWORD
base,easy,less,nonn
AUTHOR
Jonathan Vos Post, Sep 30 2007
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 19 02:01 EDT 2024. Contains 371782 sequences. (Running on oeis4.)