public static boolean isKSparse(long num, int k) {

		if (num <= 0 || num == 1) {
			return false;
		}

		if ((num & (num - 1)) == 0) {
			return true;
		}

		while (num > 0) {
			if ((num & 1) > 0) {
				int zcount = 0;
				num >>= 1;
				while ((num > 0) && ((num & 1) == 0)) {
					zcount++;
					num >>= 1;
				}
				if (zcount < k)
					return false;
			} else {
				num >>= 1;
			}
			if (num == 1) {
				return true;
			}
		}

		return true;
	}