## https://yukicoder.me/problems/no/2211 MOD = 998244353 import math def main(): N, M = map(int, input().split()) A = list(map(int, input().split())) a_map = {} for a in A: if a not in a_map: a_map[a] = 0 a_map[a] += 1 gcd_array = [0] * (M + 1) for a, num in a_map.items(): sqrt_a = int(math.sqrt(a)) for p in range(1, sqrt_a + 1): if a % p == 0: q = a // p gcd_array[p] += num if q != p: gcd_array[q] += num # 答えを出す answer = [0] * (M + 1) for m in reversed(range(1, M + 1)): if gcd_array[m] == 0: continue ans = (pow(2, gcd_array[m], MOD) - 1) % MOD x = 2 * m while x <= M: ans -= answer[x] ans %= MOD x += m answer[m] = ans for i in range(1, M + 1): print(answer[i]) if __name__ == "__main__": main()