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.

A257010 Number of sequences of positive integers with length 3 and alternant equal to n.

This page as a plain text file.
%I A257010 #16 May 01 2020 21:23:13
%S A257010 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,
%T A257010 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,
%U A257010 6,12,11,32,6,15,16,16,9,19,8,30,8,14,9,30,8,15,12,21,16,22
%N A257010 Number of sequences of positive integers with length 3 and alternant equal to n.
%C A257010 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).
%C A257010 There are infinitely many sequences of length 3 and alternant equal to 2.  It is for this reason that the offset is 3.
%H A257010 Andrew Howroyd, <a href="/A257010/b257010.txt">Table of n, a(n) for n = 3..1000</a>
%H A257010 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.
%F A257010 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
%e A257010 For n=6, the a(6) = 4 sequences with alternant 6 are (1,1,3), (1,3,2), (2,3,1), (3,1,1)
%p A257010 Dbm:= proc(b,m) nops(select(t -> (t-1) mod b = 0, numtheory:-divisors(m))) end proc:
%p A257010 seq(add(Dbm(b,b^2+n*b+1)-2, b=1..n-1), n=3..100); # _Robert Israel_, Jan 24 2016
%t A257010 Length3Q[x_, y_] :=
%t A257010 Module[{l = ContinuedFraction[(x[[2]] + 2*x[[1]] + y)/(2*x[[1]])]},
%t A257010   If[OddQ[Length[l]], Return[Length[l] == 3],
%t A257010    If[Last[l] == 1, Return[Length[l] - 1 == 3], Return[Length[l] + 1 == 3]]]];
%t A257010 Table[Length[
%t A257010   Select[Flatten[
%t A257010     Select[
%t A257010      Table[{a, k}, {k,
%t A257010        Select[Range[Ceiling[-Sqrt[n^2 - 4]], Floor[Sqrt[n^2 - 4]]],
%t A257010         Mod[# - n^2 + 4, 2] == 0 &]}, {a,
%t A257010        Select[Divisors[(n^2 - 4 - k^2)/4], # > (Sqrt[n^2 - 4] - k)/2 &]}],
%t A257010      UnsameQ[#, {}] &], 1], Length3Q[#, n] &]], {n, 3, 60}]
%o A257010 (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
%Y A257010 Cf. A257009, A257011, A257012, A257013, A000012, A000005.
%K A257010 nonn
%O A257010 3,2
%A A257010 _Barry R. Smith_, Apr 18 2015
%E A257010 Terms a(61) and beyond from _Andrew Howroyd_, May 01 2020