Unexpressed

AtCoder
IDabc193_c
Time2000ms
Memory256MB
Difficulty
Given is an integer $N$. How many integers between $1$ and $N$ (inclusive) are unrepresentable as $a^b$, where $a$ and $b$ are integers not less than $2$? ## Constraints * $N$ is an integer. * $1 ≤ N ≤ 10^{10}$ ## Input Input is given from Standard Input in the following format: $N$ [samples]
Samples
Input #1
8
Output #1
6

$4$ and $8$ are representable as $a^b$: we have $2^2 = 4$ and $2^3 = 8$.  
On the other hand, $1$, $2$, $3$, $5$, $6$, and $7$ are unrepresentable as $a^b$ using integers $a$ and $b$ not less than $2$, so the answer is $6$.
Input #2
100000
Output #2
99634
API Response (JSON)
{
  "problem": {
    "name": "Unexpressed",
    "description": {
      "content": "Given is an integer $N$. How many integers between $1$ and $N$ (inclusive) are unrepresentable as $a^b$, where $a$ and $b$ are integers not less than $2$?",
      "description_type": "Markdown"
    },
    "platform": "AtCoder",
    "limit": {
      "time_limit": 2000,
      "memory_limit": 262144
    },
    "difficulty": "None",
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "abc193_c"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "Given is an integer $N$. How many integers between $1$ and $N$ (inclusive) are unrepresentable as $a^b$, where $a$ and $b$ are integers not less than $2$?\n\n## Constraints\n\n*   $N$ is an integer.\n*   $...",
      "is_translate": false,
      "language": "English"
    }
  ]
}
Full JSON Raw Segments