login
A257012
Number of sequences of positive integers with length 5 and alternant equal to n.
3
0, 0, 1, 2, 3, 5, 5, 10, 8, 11, 11, 19, 15, 19, 17, 27, 17, 36, 17, 43, 27, 29, 31, 54, 30, 41, 45, 63, 29, 57, 33, 75, 49, 59, 47, 96, 39, 79, 57, 84, 61, 81, 49, 97, 81, 85, 47, 150, 64, 105, 75, 101, 69, 123, 77, 141, 81, 103, 71, 189, 75, 119, 121, 137, 82, 143, 85, 183, 101, 129, 93, 211, 89, 129, 131, 187, 116, 201
OFFSET
1,4
COMMENTS
See A257009 for the definition of the alternant of a sequence. The number of sequences of length 1 with given alternant value n is 1, while the number of sequences of length 2 with given alternant value n is d(n), the number of divisors of n (see A000005).
LINKS
EXAMPLE
The a(7) = 3 sequences with length 5 and alternant 7 are (1,1,1,3,1), (1,2,1,2,1), and (1,3,1,1,1).
MATHEMATICA
Length5Q[x_, y_] :=
Module[{l = ContinuedFraction[(x[[2]] + 2*x[[1]] + y)/(2*x[[1]])]},
If[OddQ[Length[l]], Return[Length[l] == 5],
If[Last[l] == 1, Return[Length[l] - 1 == 5], Return[Length[l] + 1 == 5]]]];
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], Length5Q[#, n] &]], {n, 3, 80}]
KEYWORD
nonn
AUTHOR
Barry R. Smith, Apr 19 2015
STATUS
approved