login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A067872
Least m > 0 for which m*n^2 + 1 is a square.
6
3, 2, 7, 3, 23, 8, 47, 15, 79, 24, 119, 2, 167, 48, 3, 63, 287, 80, 359, 6, 88, 120, 527, 28, 623, 168, 727, 12, 839, 44, 959, 255, 216, 288, 8, 20, 1367, 360, 19, 77, 1679, 22, 1847, 30, 208, 528, 2207, 7, 2399, 624, 128, 42, 2807, 728, 696, 3, 160, 840, 3479, 11
OFFSET
1,1
COMMENTS
Least m > 0 for which x^2 - m*y^2 = 1 has a solution with y = n.
For n > 1, a(n) <= n^2-2. - Chai Wah Wu, Jan 26 2016
LINKS
T. D. Noe and Chai Wah Wu, Table of n, a(n) for n = 1..10000 n = 1..500 from T. D. Noe
FORMULA
For n a power of an odd prime, a(n) = n^2 - 2. For n twice a power of an odd prime, a(n) = (n/2)^2 - 1. - T. D. Noe, Sep 13 2007
EXAMPLE
a(4)=3, based on 3*4^2 + 1 = 7^2.
MATHEMATICA
a[n_] := For[m=1, True, m++, If[IntegerQ[Sqrt[m*n^2+1]], Return[m]]]; Table[a[n], {n, 100}]
lm[n_]:=Module[{m=1}, While[!IntegerQ[Sqrt[m n^2+1]], m++]; m]; Array[lm, 60] (* Harvey P. Dale, Feb 24 2013 *)
PROG
(Haskell)
a067872 n = (until ((== 1) . a010052 . (+ 1)) (+ nn) nn) `div` nn
where nn = n ^ 2
-- Reinhard Zumkeller, Jun 28 2013
(Python)
def A067872(n):
y, x, n2 = n*(n+2), 2*n+3, n**2
m, r = divmod(y, n2)
while r:
y += x
x += 2
m, r = divmod(y, n2)
return m # Chai Wah Wu, Jan 25 2016
CROSSREFS
Cf. A010052.
Sequence in context: A241559 A165794 A075270 * A318457 A198501 A230072
KEYWORD
nice,nonn
AUTHOR
Lekraj Beedassy, Feb 25 2002
EXTENSIONS
Edited by Dean Hickerson, Mar 19 2002
STATUS
approved