cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A254315 Number of distinct digits in the prime factorization of n (counting terms of the form p^1 as p).

This page as a plain text file.
%I A254315 #43 May 21 2025 15:01:45
%S A254315 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,
%T A254315 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,
%U A254315 3,2,2,2,3,3,3,2,3,2,3,2,3,2,3,3,3,3,3
%N A254315 Number of distinct digits in the prime factorization of n (counting terms of the form p^1 as p).
%C A254315 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).
%C A254315 a(n)<=10. The least n such that a(n)=10 is n = 41701690 = 2*5*47*83*1069.
%C A254315 Property: a(p) = A043537(p), for p prime.
%C A254315 From _Michel Marcus_, Feb 21 2015: (Start)
%C A254315 For p in A038604, a(p^2) = A043537(p) + 1.
%C A254315 For p in A038611, a(p^3) = A043537(p) + 1.
%C A254315 For p in A038612, a(p^4) = A043537(p) + 1.
%C A254315 For p in A038613, a(p^5) = A043537(p) + 1.
%C A254315 For p in A038614, a(p^6) = A043537(p) + 1.
%C A254315 For p in A038615, a(p^7) = A043537(p) + 1.
%C A254315 For p in A038616, a(p^8) = A043537(p) + 1.
%C A254315 For p in A038617, a(p^9) = A043537(p) + 1.
%C A254315 (End)
%H A254315 Michel Lagneau, <a href="/A254315/b254315.txt">Table of n, a(n) for n = 2..10000</a>
%e A254315 a(36)=2 because 36 = 2^2 * 3^2 => 2 distinct digits.
%e A254315 a(414)=2 because 414 = 2 * 3^2 * 23 => 2 distinct digits.
%p A254315 with(ListTools):
%p A254315 nn:=100:
%p A254315   for n from 2 to nn do:
%p A254315     n0:=length(n):lst:={}:x0:=ifactors(n):
%p A254315     y:=Flatten(x0[2]):z:=convert(y,set):
%p A254315     z1:=z minus {1}:nn0:=nops(z1):
%p A254315      for k from 1 to nn0 do :
%p A254315       t1:=convert(z1[k],base,10):z2:=convert(t1,set):
%p A254315       lst:=lst union z2:
%p A254315      od:
%p A254315      nn1:=nops(lst):printf(`%d, `,nn1):
%p A254315      od :
%t A254315 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 *)
%o A254315 (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
%o A254315 (Python)
%o A254315 from sympy import factorint
%o A254315 def A254315(n):
%o A254315     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]))
%o A254315 # _Chai Wah Wu_, Feb 24 2015
%Y A254315 Cf. A027748, A043537, A050252, A254317.
%K A254315 nonn,base,easy
%O A254315 2,5
%A A254315 _Michel Lagneau_, Jan 28 2015