A067722 Least positive integer k such that n*(n + k) is a perfect square.
1, 3, 6, 9, 5, 15, 18, 21, 10, 7, 30, 33, 15, 39, 42, 45, 9, 51, 14, 57, 25, 63, 66, 69, 30, 11, 78, 21, 35, 87, 90, 93, 18, 99, 102, 105, 13, 111, 114, 117, 50, 123, 126, 129, 55, 35, 138, 141, 27, 15, 22, 153, 65, 159, 42, 165, 70, 171, 174, 177, 75, 183, 186, 49, 17
Offset: 0
Keywords
Examples
a(8) = 10 because 8*(8+10) = 144 = 12^2.
Links
- Peter Kagey, Table of n, a(n) for n = 0..5000
Crossrefs
Cf. A010052.
Programs
-
Haskell
a067722 n = head [k | k <- [1..], a010052 (n * (n + k)) == 1] -- Reinhard Zumkeller, Feb 07 2015
-
Mathematica
Do[k = 1; While[ !IntegerQ[ Sqrt[ k (k + n)]], k++ ]; Print[k], {n, 0, 75} ]
-
PARI
a(n) = my(k=1); while(!issquare(n*(n+k)), k++); k; \\ Michel Marcus, Feb 05 2015