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.

A072084 In prime factorization of n replace all primes with their numbers of 1's in binary representation.

This page as a plain text file.
%I A072084 #28 Feb 19 2019 15:17:27
%S A072084 1,1,2,1,2,2,3,1,4,2,3,2,3,3,4,1,2,4,3,2,6,3,4,2,4,3,8,3,4,4,5,1,6,2,
%T A072084 6,4,3,3,6,2,3,6,4,3,8,4,5,2,9,4,4,3,4,8,6,3,6,4,5,4,5,5,12,1,6,6,3,2,
%U A072084 8,6,4,4,3,3,8,3,9,6,5,2,16,3,4,6,4,4,8,3,4,8,9,4,10,5,6
%N A072084 In prime factorization of n replace all primes with their numbers of 1's in binary representation.
%C A072084 a(n)<n for n>1.
%C A072084 Multiplicative with a(p^e) = A000120(p)^e. - _Mitch Harris_, Apr 19 2005
%H A072084 Reinhard Zumkeller, <a href="/A072084/b072084.txt">Table of n, a(n) for n = 1..10000</a>
%F A072084 Completely multiplicative with a(p) = number of 1's in binary representation of prime p.
%F A072084 Multiplicative with a(p^e) = A000120(p)^e
%e A072084 a(30) = a(2*3*5) = a(2)*a(3)*a(5) = 1*2*2 = 4,
%e A072084 as a(2)=a('10')=1, a(3)=a('11')= 2 and a(5)=a('101')=2.
%p A072084 A072084 := proc(n) local a,c; readlib(ifactors):
%p A072084 a := n -> add(i,i=convert(n, base, 2));
%p A072084 mul(a(c[1])^c[2],c=ifactors(n)[2]) end:
%p A072084 # _Peter Luschny_, Jan 16 2010
%t A072084 a[n_] := Times @@ Power @@@ (FactorInteger[n] /. {p_Integer, e_} :> {DigitCount[p, 2, 1], e}); Array[a, 100] (* _Jean-François Alcover_, Feb 09 2018 *)
%o A072084 (Sage) A072084 = lambda n: prod(p.digits(base=2).count(1)**m for p,m in factor(n)) # _D. S. McNeil_, Jan 17 2011
%o A072084 (Haskell)
%o A072084 a072084 = product . map a000120 . a027746_row
%o A072084 -- _Reinhard Zumkeller_, Feb 10 2013
%o A072084 (PARI) a(n)=my(f=factor(n)); f[,1]=apply(hammingweight, f[,1]); factorback(f) \\ _Charles R Greathouse IV_, Aug 06 2015
%Y A072084 Cf. A000120, A072085, A072087, A027746, A014499.
%K A072084 nonn,base,mult
%O A072084 1,3
%A A072084 _Reinhard Zumkeller_, Jun 14 2002