OFFSET
1,2
COMMENTS
The number of terms with d digits, for d = 1,...,20 is 1, 2, 8, 6, 19, 37, 49, 95, 152, 240, 374, 528, 748, 1174, 1607, 2415, 3309, 4687, 7202, 9357. - Giovanni Resta, Mar 28 2013
LINKS
Harry J. Smith and Donovan Johnson, Table of n, a(n) for n = 1..1000 (first 200 terms from Harry J. Smith)
EXAMPLE
Product of digits of 15211 is 10, 15211 = 11101101101011 in binary with 10 "1's", hence 15211 is in the sequence.
MATHEMATICA
Select[Range[120000], Times@@IntegerDigits[#]==Total[ IntegerDigits[#, 2]]&] (* Harvey P. Dale, Mar 01 2012 *)
(* dig[x] generates all terms with x digits *) dig[nd_] := Block[{dec, w}, dec[p_, n_] := If[Length@p == nd, n==1 && AppendTo[w, p], Do[If[Mod[n, x] == 0, dec[Append[p, x], n/x]], {x, Max[Max@p, 1], 9}]]; Sort@Flatten@Table[w = {}; dec[{}, nb]; Select[FromDigits /@ Flatten[Permutations /@ w, 1], Total@ IntegerDigits[#, 2] == nb &], {nb, Ceiling@Log[2, 10^nd]}]]; (* Giovanni Resta, Mar 28 2013 *)
PROG
(PARI) isok(k) = { vecprod(digits(k)) == hammingweight(k) } \\ Harry J. Smith, Sep 05 2009
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Benoit Cloitre, Jun 05 2002
STATUS
approved