A257013 Number of sequences of positive integers with length 6 and alternant equal to n.
0, 0, 0, 0, 0, 0, 0, 1, 0, 2, 0, 5, 0, 4, 4, 9, 0, 12, 1, 13, 10, 8, 4, 33, 4, 14, 12, 21, 4, 44, 2, 33, 22, 24, 12, 62, 8, 16, 29, 63, 2, 64, 4, 57, 52, 26, 10, 111, 21, 40, 48, 45, 8, 106, 26, 94, 40, 46, 18, 164, 21, 40, 61, 97, 40, 118, 12, 87, 65, 104, 14, 221, 14, 52, 116, 88, 30, 146, 21, 157
Offset: 1
Keywords
Examples
For n=14, the a(14)=4 sequences with alternant 14 and length 6 are (1,1,1,1,4,1), (1,2,1,1,3,1), (1,3,1,1,2,1), and (1,4,1,1,1,1).
Links
- B. R. Smith, Reducing quadratic forms by kneading sequences J. Int. Seq., 17 (2014) 14.11.8.
Programs
-
Mathematica
Length6Q[x_, y_] := Module[{l = ContinuedFraction[(x[[2]] + 2*x[[1]] + y)/(2*x[[1]])]}, If[EvenQ[Length[l]], Return[Length[l] == 6], If[Last[l] == 1, Return[Length[l] - 1 == 6], Return[Length[l] + 1 == 6]]]] Table[Length[ Select[Flatten[ Select[ Table[{a, k}, {k, Select[Range[Ceiling[-Sqrt[n^2 + 4]], Floor[Sqrt[n^2 + 4]]], Mod[# - n^2 - 4, 2] == 0 &]}, {a, Select[Divisors[(n^2 + 4 - k^2)/4], # > (Sqrt[n^2 + 4] - k)/2 &]}], UnsameQ[#, {}] &], 1], Length6Q[#, n] &]], {n, 1, 80}]
Comments