while true
  n = gets.strip.to_i
  break if n == 0

  sqhash = {}
  (1...n).each{|i| sqhash[(i * i) % n] = 1}

  hn = (n - 1) / 2

  counts = (0..hn).map{0}

  sqhash.keys.permutation(2).each do |a, b|
    diff = a - b
    diff += n if diff < 0
    diff = n - diff if diff > hn
    counts[diff] += 1
  end

  (1..hn).each{|i| puts counts[i]}
end