OFFSET
1,1
COMMENTS
This sequence gives the values d of the Pell equation x^2 - d*y^2 = +1 that have positive fundamental solutions (x0, y0) with odd y0. This was first conjectured and is proved provided Conway's theorem in the link is assumed and the proof of the conjecture stated in A007869, given there in a W. Lang link, is used. - Wolfdieter Lang, Sep 19 2015
For a proof of Conway's theorem on the happy number factorization see the W. Lang link (together with the link given under A007969). - Wolfdieter Lang, Oct 04 2015
LINKS
Reinhard Zumkeller, Table of n, a(n) for n = 1..99
J. H. Conway, On Happy Factorizations, J. Integer Sequences, Vol. 1, 1998, #1.
Wolfdieter Lang, Proof of a Theorem Related to the Happy Number Factorization.
FORMULA
a(n) is in the sequence if a(n) = D*E with positive integers D and E, such that E*U^2 - D*T^2 = 2 has an integer solution with U*T odd (without loss of generality one may take U and T positive). See the Conway link. D and E are given in A191856 and A191857, respectively. - Wolfdieter Lang, Oct 05 2015
MATHEMATICA
r[b_, c_] := (red = Reduce[x > 0 && y > 0 && b*x^2 + 2 == c*y^2, {x, y}, Integers] /. C[1] -> 1 // Simplify; If[Head[red] === Or, First[red], red]);
f[n_] := f[n] = If[! IntegerQ[Sqrt[n]], Catch[Do[{b, c} = bc; If[ (r0 = r[b, c]) =!= False, {x0, y0} = {x, y} /. ToRules[r0]; If[OddQ[x0] && OddQ[y0], Throw[n]]]; If[ (r0 = r[c, b]) =!= False, {x0, y0} = {x, y} /. ToRules[r0]; If[OddQ[x0] && OddQ[y0], Throw[n]]], {bc, Union[Sort[{#, n/#}] & /@ Divisors[n]]} ]]];
A007970 = Reap[ Table[ If[f[n] =!= Null, Print[f[n]]; Sow[f[n]]], {n, 1, 180}] ][[2, 1]](* Jean-François Alcover, Jun 26 2012 *)
PROG
(Haskell)
a007970 n = a007970_list !! (n-1)
a007970_list = filter ((== 2) . a007968) [0..]
-- Reinhard Zumkeller, Oct 11 2015
CROSSREFS
Cf. A007968.
KEYWORD
nonn
AUTHOR
EXTENSIONS
159 and 175 inserted by Jean-François Alcover, Jun 26 2012
STATUS
approved