A155828 Number of integers k in {1,2,3,..,n} such that kn+1 is a square.
0, 0, 1, 1, 1, 1, 1, 3, 1, 1, 1, 3, 1, 1, 3, 3, 1, 1, 1, 3, 3, 1, 1, 7, 1, 1, 1, 3, 1, 3, 1, 3, 3, 1, 3, 3, 1, 1, 3, 7, 1, 3, 1, 3, 3, 1, 1, 7, 1, 1, 3, 3, 1, 1, 3, 7, 3, 1, 1, 7, 1, 1, 3, 3, 3, 3, 1, 3, 3, 3, 1, 7, 1, 1, 3, 3, 3, 3, 1, 7, 1, 1, 1, 7, 3, 1, 3, 7, 1, 3, 3, 3, 3, 1, 3, 7, 1, 1, 3, 3, 1, 3, 1, 7, 7
Offset: 1
Keywords
Examples
1*8 + 1 = 9, 3*8 + 1 = 25, 6*8 + 1 = 49, whereas other values are not square, so a(8) = 3.
Links
- Antti Karttunen, Table of n, a(n) for n = 1..10000
Crossrefs
Cf. A060594.
Programs
-
PARI
a(n) = sum(k=1, n, issquare(k*n+1)); \\ Michel Marcus, Jul 10 2014
-
PARI
a(n)=if(n>2, 2^#znstar(n)[3]-1) \\ Charles R Greathouse IV, Jun 18 2025
Comments