cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A257012 Number of sequences of positive integers with length 5 and alternant equal to n.

This page as a plain text file.
%I A257012 #4 Apr 20 2015 20:58:01
%S A257012 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,
%T A257012 41,45,63,29,57,33,75,49,59,47,96,39,79,57,84,61,81,49,97,81,85,47,
%U A257012 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
%N A257012 Number of sequences of positive integers with length 5 and alternant equal to n.
%C A257012 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).
%H A257012 B. R. Smith, <a href="https://cs.uwaterloo.ca/journals/JIS/VOL17/Smith/smith5.html">Reducing quadratic forms by kneading sequences</a> J. Int. Seq., 17 (2014) 14.11.8.
%e A257012 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).
%t A257012 Length5Q[x_, y_] :=
%t A257012  Module[{l = ContinuedFraction[(x[[2]] + 2*x[[1]] + y)/(2*x[[1]])]},
%t A257012   If[OddQ[Length[l]], Return[Length[l] == 5],
%t A257012    If[Last[l] == 1, Return[Length[l] - 1 == 5], Return[Length[l] + 1 == 5]]]];
%t A257012 Table[Length[
%t A257012   Select[Flatten[
%t A257012     Select[
%t A257012      Table[{a, k}, {k,
%t A257012        Select[Range[Ceiling[-Sqrt[n^2 - 4]], Floor[Sqrt[n^2 - 4]]],
%t A257012         Mod[# - n^2 + 4, 2] == 0 &]}, {a,
%t A257012        Select[Divisors[(n^2 - 4 - k^2)/4], # > (Sqrt[n^2 - 4] - k)/2 &]}],
%t A257012      UnsameQ[#, {}] &], 1], Length5Q[#, n] &]], {n, 3, 80}]
%Y A257012 Cf. A257009, A257010, A257011, A257013, A000012, A000005
%K A257012 nonn
%O A257012 1,4
%A A257012 _Barry R. Smith_, Apr 19 2015