Re: Find count of binary number pattern within concatenated
- To: mathgroup at smc.vnet.net
- Subject: [mg91141] Re: [mg91093] Find count of binary number pattern within concatenated
- From: DrMajorBob <drmajorbob at att.net>
- Date: Thu, 7 Aug 2008 04:40:24 -0400 (EDT)
- References: <8011894.1218027722879.JavaMail.root@m08>
- Reply-to: drmajorbob at longhorns.com
n = 13;
Count[Partition[Flatten@IntegerDigits[Range[n], 2], 4], {1, 1, 0, 1}]
2
or
Length@Position[
Partition[Flatten@IntegerDigits[Range[n], 2], 4], {1, 1, 0, 1}]
2
Bobby
On Wed, 06 Aug 2008 04:03:51 -0500, Diana <diana.mecum at gmail.com> wrote:
> Math folks,
>
> Can someone tell me how to find the count of the occurrences of "1101"
> within "11011100101110111100010011010101111001101" generated with the
> FromDigits statements below? I will be increasing "n".
>
> n=13
>
> FromDigits[Flatten[IntegerDigits[Range[n],2]]]
>
> 11011100101110111100010011010101111001101.
>
> FromDigits[IntegerDigits[n, 2]]
>
> 1101
>
> Diana
>
>
>
--
DrMajorBob at longhorns.com