login
A257010
Number of sequences of positive integers with length 3 and alternant equal to n.
4
0, 2, 2, 4, 3, 6, 2, 9, 4, 6, 5, 11, 4, 9, 6, 10, 5, 14, 2, 16, 7, 6, 9, 16, 6, 11, 8, 17, 5, 14, 4, 20, 10, 8, 9, 22, 2, 17, 10, 16, 11, 14, 6, 18, 13, 12, 5, 28, 6, 19, 9, 15, 13, 16, 8, 24, 6, 12, 11, 32, 6, 15, 16, 16, 9, 19, 8, 30, 8, 14, 9, 30, 8, 15, 12, 21, 16, 22
OFFSET
3,2
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).
There are infinitely many sequences of length 3 and alternant equal to 2. It is for this reason that the offset is 3.
LINKS
B. R. Smith, Reducing quadratic forms by kneading sequences J. Int. Seq., 17 (2014) 14.11.8.
FORMULA
a(n) = Sum_{b=1..n-1} (Dbm (b,b^2+nb+1)-2), where Dbm(b,m) is the number of positive divisors of m that are congruent to 1 modulo b. - Barry R. Smith, Jan 24 2016
EXAMPLE
For n=6, the a(6) = 4 sequences with alternant 6 are (1,1,3), (1,3,2), (2,3,1), (3,1,1)
MAPLE
Dbm:= proc(b, m) nops(select(t -> (t-1) mod b = 0, numtheory:-divisors(m))) end proc:
seq(add(Dbm(b, b^2+n*b+1)-2, b=1..n-1), n=3..100); # Robert Israel, Jan 24 2016
MATHEMATICA
Length3Q[x_, y_] :=
Module[{l = ContinuedFraction[(x[[2]] + 2*x[[1]] + y)/(2*x[[1]])]},
If[OddQ[Length[l]], Return[Length[l] == 3],
If[Last[l] == 1, Return[Length[l] - 1 == 3], Return[Length[l] + 1 == 3]]]];
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], Length3Q[#, n] &]], {n, 3, 60}]
PROG
(PARI) a(n)={sum(b=1, n-1, sumdiv(b^2+n*b+1, d, (d-1)%b==0) - 2)} \\ Andrew Howroyd, May 01 2020
CROSSREFS
KEYWORD
nonn
AUTHOR
Barry R. Smith, Apr 18 2015
EXTENSIONS
Terms a(61) and beyond from Andrew Howroyd, May 01 2020
STATUS
approved