login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A007967 Second factor in happy factorization of n. 8

%I #21 Feb 15 2016 12:17:02

%S 0,1,2,3,2,5,3,1,4,3,10,11,4,13,2,5,4,17,9,19,5,7,11,1,6,5,26,27,4,29,

%T 6,1,2,3,2,7,6,37,19,13,20,41,7,43,4,9,2,1,8,7,50,51,13,53,27,5,8,19,

%U 58,59,4,61,2,9,8,65,33,67,17,3,14,1,9,73,74,3,4,11,3,1,10,9,82,83

%N Second factor in happy factorization of n.

%C a(n) = n / A007966(n);

%C a(A007969(n)) = A191855(n); a(A007970(n)) = A191857(n). - _Reinhard Zumkeller_, Jun 18 2011

%H Reinhard Zumkeller, <a href="/A007967/b007967.txt">Table of n, a(n) for n = 0..300</a>

%H J. H. Conway, <a href="http://www.cs.uwaterloo.ca/journals/JIS/happy.html">On Happy Factorizations</a>, J. Integer Sequences, Vol. 1, 1998, #1.

%H <a href="/A007968/a007968.txt">Initial Happy Factorization Data</a>

%t r[b_, c_, d_] := (red = Reduce[x > 0 && y > 0 && b*x^2 + d == c*y^2, {x, y}, Integers] /. C[1] -> 1 // Simplify; If[Head[red] === Or, red[[1]], red]); f[n_] := f[n] = If[IntegerQ[rn = Sqrt[n]], {0, rn, rn, rn, rn}, Catch[Do[b = bc[[1]]; c = bc[[2]]; If[c > 1 && (r0 = r[b, c, 1]) =!= False, rr = ToRules[r0]; x0 = x /. rr; y0 = y /. rr; Throw[{1, b, c, x0, y0}]]; If[b > 1 && (r0 = r[c, b, 1]) =!= False, rr = ToRules[r0]; x0 = x /. rr; y0 = y /. rr; Throw[{1, c, b, x0, y0}]]; If[(r0 = r[b, c, 2]) =!= False, rr = ToRules[r0]; x0 = x /. rr; y0 = y /. rr; If[OddQ[x0] && OddQ[y0], Throw[{2, b, c, x0, y0}]]]; If[(r0 = r[c, b, 2]) =!= False, rr = ToRules[r0]; x0 = x /. rr; y0 = y /. rr; If[OddQ[x0] && OddQ[y0], Throw[{2, c, b, x0, y0}]]];, {bc, Union[Sort[{#, n/#}] & /@ Divisors[n]]}]]];a[n_] := f[n][[3]]; A007967 = Table[Print["a(", n, ") = ", a[n]]; a[n], {n, 0, 90}] (* _Jean-François Alcover_, Sep 18 2015 *)

%o (Haskell)

%o import Data.List (genericIndex)

%o a007967 n = genericIndex a007967_list n

%o a007967_list = map snd hCouples

%o -- Pairs hCouples are defined in A007968.

%o -- _Reinhard Zumkeller_, Oct 11 2015

%Y Cf. A191914.

%Y Cf. A007968, A007969, A007970, A191855, A191857.

%K nonn,easy,nice

%O 0,3

%A _J. H. Conway_

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 25 04:42 EDT 2024. Contains 371964 sequences. (Running on oeis4.)