login
Conway's triangle of "happy factorizations" (flattened).
0

%I #21 Sep 20 2015 04:09:39

%S 0,0,1,1,1,2,1,3,2,2,1,5,2,3,7,1,2,4,3,3,1,10,1,11,3,4,1,13,7,2,3,5,4,

%T 4,1,17,2,9,1,19,4,5,3,7,2,11,23,1,4,6,5,5,1,26,1,27,7,4,1,29,5,6,31,

%U 1,16,2,11,3,17,2,5,7,6,6,1,37,2,19,3,13,2,20,1,41,6,7,1,43,11,4,5,9,23,2,47,1,6,8,7,7

%N Conway's triangle of "happy factorizations" (flattened).

%C Conway's triangle is listed by increasing couple products, with duplicate squares removed.

%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.

%e Triangle begins:

%e {0,0},

%e {1,1},

%e {1,2}, {1,3}, {2,2},

%e {1,5}, {2,3}, {7,1}, {2,4}, {3,3},

%e {1,10}, {1,11}, {3,4}, {1,13}, {7,2}, {3,5}, {4,4},

%e {1,17}, {2,9}, {1,19}, {4,5}, {3,7}, {2,11}, {23,1}, {4,6}, {5,5},

%e ...

%e The original triangle (adapted and truncated):

%e ...

%e 5^2 ...

%e 4^2 1*26 ...

%e 3^2 1*17 1*27 ...

%e 2^2 1*10 2*9 7*4 ...

%e 1^2 1*5 1*11 1*19 1*29 ...

%e 0^2 1*2 2*3 3*4 4*5 5*6 ...

%e 1^2 1*3 7*1 1*13 3*7 31*1 ...

%e 2^2 2*4 7*2 2*11 16*2 ...

%e 3^2 3*5 23*1 11*3 ...

%e 4^2 4*6 17*2 ...

%e 5^2 5*7 ...

%e 6^2 ...

%e ...

%t f[0] = {0, 0}; f[32] = {16, 2}(* to speed up *); f[n_] := Do[c = n/b; If[b == c, Return[{b, b}]]; r1 = Reduce[r >= 0 && s >= 0 && c > 1 && b*r^2 + 1 == c*s^2, {r, s}, Integers]; If[r1 =!= False, Return[{b, c}]]; r2 = Reduce[r >= 0 && s >= 0 && r == 2x + 1 && s == 2y + 1 && b*r^2 + 2 == c *s^2, {r, s, x, y}, Integers]; If[r2 =!= False, Return[{b, c}]], {b, Divisors[n]}]; Table[Print["f(", n, ") = ", fn = f[n]]; fn, {n, 0, 49}] // Flatten

%Y Cf. A007966, A007969, A007970, A191854, A191855, A191856.

%K tabf,nonn

%O 0,6

%A _Jean-François Alcover_, Sep 18 2015