OFFSET
1,4
COMMENTS
The distinct positive values of the substrings of binary n is row n of table A165416.
a(2^n) = 2^(n-1), for all n >=1.
LINKS
Rémy Sigrist, Table of n, a(n) for n = 1..8192
Rémy Sigrist, PARI program for A165418
EXAMPLE
9 in binary is 1001. The distinct positive integers that occur as substrings in binary 9 are 1, 2 (10 in binary), 4 (100 in binary), and 9 (1001 in binary). So a(9) = a(1)+a(2)+a(4) = 1 + 1 + 2 = 4.
MATHEMATICA
Fold[Function[{a, n}, Append[a, With[{w = IntegerDigits[n, 2]}, Total@ Part[a, Select[Union@ Map[FromDigits[#, 2] &, Apply[Join, Array[Partition[w, #, 1] &, Length@ w]]], Nor[# == 0, # == n] &]]]]], {1}, Range[2, 77]] (* Michael De Vlieger, Dec 31 2017 *)
PROG
(PARI) See Links section.
CROSSREFS
KEYWORD
base,nonn
AUTHOR
Leroy Quet, Sep 17 2009
EXTENSIONS
More terms from Sean A. Irvine, Nov 19 2009
STATUS
approved