|
|
A254315
|
|
Number of distinct digits in the prime factorization of n (counting terms of the form p^1 as p).
|
|
3
|
|
|
1, 1, 1, 1, 2, 1, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 1, 2, 2, 3, 2, 2, 2, 3, 2, 2, 2, 3, 2, 3, 2, 3, 2, 2, 3, 2, 2, 3, 2, 2, 3, 3, 2, 2, 2, 3, 3, 2, 2, 3, 2, 3, 3, 2, 3, 3, 2, 3, 2, 3, 2, 2, 2, 3, 3, 3, 2, 3, 2, 3, 2, 3, 2, 3, 3, 3, 3, 3
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
2,5
|
|
COMMENTS
|
Write n as product of primes raised to powers; then a(n) is the total number of distinct digits in product representation (number of distinct digits in all the primes and number of distinct digits in all the exponents that are greater than 1).
a(n)<=10. The least n such that a(n)=10 is n = 41701690 = 2*5*47*83*1069.
Property: a(p) = A043537(p), for p prime.
(End)
|
|
LINKS
|
|
|
EXAMPLE
|
a(36)=2 because 36 = 2^2 * 3^2 => 2 distinct digits.
a(414)=2 because 414 = 2 * 3^2 * 23 => 2 distinct digits.
|
|
MAPLE
|
with(ListTools):
nn:=100:
for n from 2 to nn do:
n0:=length(n):lst:={}:x0:=ifactors(n):
y:=Flatten(x0[2]):z:=convert(y, set):
z1:=z minus {1}:nn0:=nops(z1):
for k from 1 to nn0 do :
t1:=convert(z1[k], base, 10):z2:=convert(t1, set):
lst:=lst union z2:
od:
nn1:=nops(lst):printf(`%d, `, nn1):
od :
|
|
MATHEMATICA
|
f[n_] := Block[{pf = FactorInteger@ n, i}, Length@ DeleteDuplicates@ Flatten@ IntegerDigits@ Rest@ Flatten@ Reap@ Do[If[Last[pf[[i]]] == 1, Sow@ First@ pf[[i]], Sow@ FromDigits@ Flatten[IntegerDigits /@ pf[[i]]]], {i, Length@ pf}]]; Array[f, 100] (* Michael De Vlieger, Jan 29 2015 *)
|
|
PROG
|
(PARI) print1(1, ", "); for(k=2, 100, s=[]; F=factor(k); for(i=1, #F[, 1], s=concat(s, digits(F[i, 1])); if(F[i, 2]>1, s=concat(s, digits(F[i, 2])))); print1(#vecsort(s, , 8), ", ")) \\ Derek Orr, Jan 30 2015
(Python)
from sympy import factorint
....return len(set([x for l in [[d for d in str(p)]+[d for d in str(e) if d != '1'] for p, e in factorint(n).items()] for x in l]))
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,base,easy
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|