Hi.

Here is one approach:

options(scipen=300)
numb <-
73167176531330624919225119674426574742355349194934969835203127745063262395783180169848018694788518438586156078911294949545950173795833195285320880551112540698747158523863050715693290963295227443043557
strsplit(as.character(numb), "")
blocks <- rep(1:(nchar(numb)/5), each=5)
tapply(as.numeric(unlist(strsplit(as.character(numb), ""))),
       blocks,
       prod)

Andrija


On Thu, Apr 18, 2013 at 10:47 AM, Janesh Devkota
<janesh.devk...@gmail.com>wrote:

> Hello,
>
> I have a big number lets say of around hundred digits. I want to subset
> that big number into consecutive number of 5 digits and find the product of
> those 5 digits. For example my first 5 digit number would be 73167. I need
> to check the product of the individual numbers in 73167 and so on.
>
> The sample number is as follows:
>
>
>
> 73167176531330624919225119674426574742355349194934969835203127745063262395783180169848018694788518438586156078911294949545950173795833195285320880551112540698747158523863050715693290963295227443043557
>
> I have a problem subsetting the small numbers out of the big number.
>
> Any help is highly appreciated.
>
> Best Regards,
> Janesh Devkota
>
>         [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to