• [B] GCD

  • 时间限制: 2000 ms 内存限制: 65535 K
  • 问题描述
  • Given an integer n(1 <= n <= 400000), you need to calculator the sum of all gcd(i, j) for 1 <= i < j <= n.
  • 输入
  • Each test case contains an integer n.
    The last line contains 0, you need not to process it.
  • 输出
  • For each test case, print the sum of of all gcd(i, j) for 1 <= i < j <= n.
  • 样例输入
  • 3
    12452
  • 样例输出
  • 3
    424642359
  • 提示
  • 来源
  • Alex@NBUT
  • 操作

显示春菜