A239431 Consider the sequence A235598. Recalling that A235598(n) forms part of a Pythagorean triple, a(n) states its relationship to both a(n-1) and a(n+1). 1 denotes the lesser leg, 2 denotes the greater leg and 3 denotes the hypotenuse. The tens place returns its relationship to the side to its left, a(n-1), and the units place its relationship to the side to its right, a(n+1). a(0)=1.
1, 22, 31, 22, 11, 32, 12, 11, 31, 22, 11, 33, 23, 21, 23, 11, 22, 13, 22, 11, 32, 12, 12, 31, 22, 13, 11, 22, 32, 12, 11, 33, 23, 21, 22, 11, 31, 22, 11, 31, 22, 11, 22, 31, 22, 13, 12, 13, 11, 21, 23, 12, 12, 13, 22, 11, 32, 12, 12, 31, 22, 11, 33, 13, 12, 11, 33, 11, 22, 12, 31, 22, 12, 12, 11, 31, 22, 11, 22, 12
Offset: 0
Keywords
Examples
a(2)=31 because 5 is the hypotenuse in the 3-4-5 Pythagorean triple, a(n-1) is 4 and 5 is the lesser side in the 5-12-13 Pythagorean triple, a(n+1) is 12.
Links
- Robert G. Wilson v, Table of n, a(n) for n = 0..10000
Programs
-
Mathematica
lst={ (* the terms from A235598 *) }; g[j_, k_] := Block[{hyp = Sqrt[ j^2 + k^2], lg = Abs@ Sqrt[ j^2 - k^2]}, If[ IntegerQ@ hyp, If[ Min[j, k] == k, 1, 2], If[ Max[j, k] == k, 3, If[lg > k, 1, 2]]]]; f[n_] := Block[{s = Take[lst, {n - 1, n + 1}]}, 10g[ s[[1]], s[[2]] ] + g[ s[[3]], s[[2]] ]]; f[1] = 1; Array[f, 80]
Comments