We want 8n+1=k2 for some integer k.
Then 8n=k2−1=(k−1)(k+1).
So n=8(k−1)(k+1).
We require n to be an integer with 1≤n≤800.
Let us analyze when n is an integer.
Note that k must be odd, since k2≡1(mod8) only when k is odd.
Let k=2m+1 for integer m≥1.
Then:
k−1=2m, k+1=2m+2
So (k−1)(k+1)=2m⋅(2m+2)=4m(m+1)
Therefore,
n=84m(m+1)=2m(m+1)
We require 1≤n≤800.
So 1≤2m(m+1)≤800
Multiply both sides by 2:
2≤m(m+1)≤1600
Now, m(m+1) increases rapidly. Let's find the largest m such that m(m+1)≤1600.
Solve m2+m−1600≤0
The positive root is m=2−1+1+6400=2−1+80.00625...≈39.5
So m can be at most 39.
Now, m must be a positive integer such that m(m+1)≥2.
For m=1, 1⋅2=2.
So m runs from 1 to 39 inclusive.
Thus, the number of such n is 39.
Answer: 39