Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, is already up and running.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: Decomposing integers

From   A Loumiotis <>
Subject   st: Decomposing integers
Date   Thu, 19 Jul 2012 14:54:03 +0300


I have integer numbers of the following form:


where a[i] equals either 0 or 1 if i=0/4 and a[5] equals to any
positive integer or 0.

Given this construction I would like to find the unique combinations
of a[i]'s that generated X.

For example:

X=22 was generated using a[1]=1, a[2]=1 and a[4]=1.
So I would like to construct a local that contains the following list
0 1 1 0 1 0

X=65 was generated using a[0]=1 and a[5]=2
So in this case the local should contain 1 0 0 0 0 1

Is this possible?


*   For searches and help try:

© Copyright 1996–2015 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index