Dcoder icon

Dcoder Admiration @ Dcoder

By Lochard | As a newbie programmer | 6 Aug 2023


Problem: Dcoder has N members each numbered from 1 to N. A member admires other member if its number divides the other member's number. 

 

Given a number N you need to find the number of people with odd number of admirers

 

Input: T the number of test cases.

For each test case an integer N

Output: A single integer representing the number of members with odd admirers.

Constraints:

1 < T < 100

1 < N < 10^9

Sample Input: 1

5

Sample Output: 

3

for i in range( int( input() ) ):
    n = int( input() )
    print( n - int( pow( n, 0.5 ) ) )

How do you rate this article?

2


Lochard
Lochard

20240228 Arrived in the UK for about 2 week. All my fears persist. Some are even getting worse. https://github.com/locharp/asylum_diary/


As a newbie programmer
As a newbie programmer

Sharing entry level codes. My snippets on GitHub https://github.com/locharp/code-snippets

Send a $0.01 microtip in crypto to the author, and earn yourself as you read!

20% to author / 80% to me.
We pay the tips from our rewards pool.