Digit Block

Author

Eric W. Weisstein
March 30, 2002

This notebook downloaded from http://mathworld.wolfram.com/notebooks/IntegerSequences/DigitBlock.nb.

For more information, see Eric's MathWorld entry http://mathworld.wolfram.com/DigitBlock.html.

©2005 Wolfram Research, Inc. except for portions noted otherwise

Initialization

u[n_,b_,block_]:=Count[Partition[IntegerDigits[n,b],Length[block],1],block]

Binary Blocks of Length 2

FormatSequence[Table[u[n,2,{0,0}],{n,110}],056973,1,
Name->"Number of blocks of {0,0} in the binary expansion of n.",
Cross->{014081,033264,037800},
html["DigitBlock"]
]

FormatSequence[Table[u[n,2,{0,1}],{n,110}],037800,1,
Name->"Number of blocks of {0,1} in the binary expansion of n.",
Cross->{014081,033264,056973},
html["DigitBlock"]
]

FormatSequence[Table[u[n,2,{1,0}],{n,110}],033264,1,
Name->"Number of blocks of {1,0} in the binary expansion of n.",
Cross->{014081,037800,056973},
html["DigitBlock"]
]

FormatSequence[Table[u[n,2,{1,1}],{n,110}],014081,1,
Name->"Number of blocks of {1,1} in the binary expansion of n.",
Cross->{033264,037800,056973},
html["DigitBlock"]
]

Binary Blocks of Length 3

Do[FormatSequence[Table[u[n,2,IntegerDigits[i,2,3]],{n,110}],056974+i,1,
Name->"Number of blocks of "<>ToString[IntegerDigits[i,2,3]]<>" in the binary expansion of n.",
Cross->Prepend[Range[056974,056974+6],014082],
html["DigitBlock"]
],{i,0,6}]

FormatSequence[Table[u[n,2,{1,1,1}],{n,110}],014082,1,
Name->"Number of blocks of {1,1,1} in the binary expansion of n.",
Cross->Range[056974,056974+6],
html["DigitBlock"]
]