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.

A257013 Number of sequences of positive integers with length 6 and alternant equal to n.

This page as a plain text file.
%I A257013 #7 May 20 2025 08:32:14
%S A257013 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,
%T A257013 2,33,22,24,12,62,8,16,29,63,2,64,4,57,52,26,10,111,21,40,48,45,8,106,
%U A257013 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
%N A257013 Number of sequences of positive integers with length 6 and alternant equal to n.
%C A257013 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 A257013 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 A257013 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).
%t A257013 Length6Q[x_, y_] :=
%t A257013  Module[{l = ContinuedFraction[(x[[2]] + 2*x[[1]] + y)/(2*x[[1]])]},
%t A257013   If[EvenQ[Length[l]], Return[Length[l] == 6],
%t A257013    If[Last[l] == 1, Return[Length[l] - 1 == 6], Return[Length[l] + 1 == 6]]]]
%t A257013 Table[Length[
%t A257013   Select[Flatten[
%t A257013     Select[
%t A257013      Table[{a, k}, {k,
%t A257013        Select[Range[Ceiling[-Sqrt[n^2 + 4]], Floor[Sqrt[n^2 + 4]]],
%t A257013         Mod[# - n^2 - 4, 2] == 0 &]}, {a,
%t A257013        Select[Divisors[(n^2 + 4 - k^2)/4], # > (Sqrt[n^2 + 4] - k)/2 &]}],
%t A257013      UnsameQ[#, {}] &], 1], Length6Q[#, n] &]], {n, 1, 80}]
%Y A257013 Cf. A257009, A257010, A257011, A257012, A000012, A000005
%K A257013 nonn
%O A257013 1,10
%A A257013 _Barry R. Smith_, Apr 19 2015