%I #24 Sep 27 2018 12:48:53
%S 3,7,10,12,15,19,22,24,27,31,34,36,39,43,46,48,51,55,58,60,63,67,70,
%T 72,75,79,82,84,87,91,94,96,99,103,106,108,111,115,118,120,123,127,
%U 130,132,135,139,142,144,147,151,154,156,159,163,166,168,171,175,178,180,183,187,190
%N Minimal scope of an (n,2) difference triangle.
%C a(n)*Pi is also the total length of irregular spiral (center points: 1, 2, 5, 3, 4) after n-rotations. - _Kival Ngaokrajang_, Jan 08 2014
%D CRC Handbook of Combinatorial Designs, 1996, p. 315.
%H Colin Barker, <a href="/A013574/b013574.txt">Table of n, a(n) for n = 1..1000</a>
%H Y. M. Chee, C. J. Colbourn, <a href="http://arxiv.org/abs/0712.2553">Constructions for difference triangle sets</a>, arXiv:0712.2553 [cs.IT], 2007.
%H Kival Ngaokrajang, <a href="/A013574/a013574.pdf">Illustration of irregular spiral (center points: 1, 2, 5, 3, 4)</a>
%H J. B. Shearer, <a href="http://www.research.ibm.com/people/s/shearer/dtsopt.html">Difference Triangle Sets: Known optimal solutions</a>.
%H J. B. Shearer, <a href="http://www.research.ibm.com/people/s/shearer/dtslb.html">Difference Triangle Sets: Discoverers</a>
%H <a href="/index/Rec#order_04">Index entries for linear recurrences with constant coefficients</a>, signature (2,-2,2,-1).
%F a(n) = 3n if n = {0,1} (mod 4). a(n) = 3n+1 if n = {2,3} (mod 4). [Chee Theor. 2] - _R. J. Mathar_, Nov 28 2016
%F G.f.: x*(3+x+2*x^2) / ( (x^2+1)*(x-1)^2 ). - _R. J. Mathar_, Nov 28 2016
%F From _Colin Barker_, Nov 25 2017: (Start)
%F a(n) = (-1/4 - i/4) * ((-1+i) + (-i)^n - i*i^n - (6-6*i)*n).
%F a(n) = 2*a(n-1) - 2*a(n-2) + 2*a(n-3) - a(n-4) for n>4.
%F (End)
%p A013574 := proc(n)
%p if modp(n,4) in {0,1} then
%p 3*n ;
%p else
%p 3*n+1 ;
%p end if;
%p end proc: # _R. J. Mathar_, Nov 28 2016
%t LinearRecurrence[{2, -2, 2, -1}, {3, 7, 10, 12}, 63] (* _Jean-François Alcover_, Nov 24 2017 *)
%o (PARI) Vec(x*(3 + x + 2*x^2) / ((1 - x)^2*(1 + x^2)) + O(x^40)) \\ _Colin Barker_, Nov 25 2017
%Y A row or column of array in A234943.
%Y A319279 is an essentially identical sequence.
%K nonn,easy
%O 1,1
%A _N. J. A. Sloane_