%I #145 Oct 12 2024 09:04:23
%S 0,3,4,7,8,11,12,15,16,19,20,23,24,27,28,31,32,35,36,39,40,43,44,47,
%T 48,51,52,55,56,59,60,63,64,67,68,71,72,75,76,79,80,83,84,87,88,91,92,
%U 95,96,99,100,103,104,107,108,111,112,115,116,119,120,123,124
%N Numbers congruent to 0 or 3 mod 4.
%C Discriminants of orders in imaginary quadratic fields (negated). [Comment corrected by _Christopher E. Thompson_, Dec 11 2016]
%C Numbers such that Langford-Skolem problem has a solution - see A014552.
%C Complement of A042963. - _Reinhard Zumkeller_, Oct 04 2004
%C Also called skew amenable numbers; a number k is skew amenable if there exist a set {a(i)} of integers satisfying the relations k = Sum_{i=1..k} a(i) = -Product_{i=1..k} a(i). Thus we have 8 = 1 + 1 + 1 + 1 + 1 + 1 - 2 + 4 = -(1*1*1*1*1*1*(-2)*4). - _Lekraj Beedassy_, Jan 07 2005
%C Possible nonpositive discriminants of quadratic equation a*x^2 + b*x + c or discriminants of binary quadratic forms a*x^2 + b*x*y + c*y^2. - _Artur Jasinski_, Apr 28 2008
%C Also, disregarding the 0 term, positive integers m such that, equivalently,
%C (i) +-1 +-2 +-... +-m is even for all choices of signs,
%C (ii) +-1 +-2 +-... +-m = 0 for some choices of signs,
%C (iii) for all -m <= k <= m, k = +-1 +-2 +-... +-(k-1) +-(k+1) +-(k+2) +-... +-m for at least one choice of signs. - _Rick L. Shepherd_, Oct 29 2008
%C A145768(a(n)) is even. - _Reinhard Zumkeller_, Jun 05 2012
%C Multiples of 4 interleaved with 1 less than multiples of 4. - _Wesley Ivan Hurt_, Nov 08 2013
%C ((2*k+0) + (2*k+1) + ... + (2*k+m-1) + (2*k+m)) is even if and only if m = a(n) for some n where k is any nonnegative integer. - _Gionata Neri_, Jul 24 2015
%C Numbers whose binary reflected Gray code (A014550) ends with 0. - _Amiram Eldar_, May 17 2021
%D H. Cohen, Course in Computational Alg. No. Theory, Springer, 1993, pp. 514-5.
%D A. Scholz and B. Schoeneberg, Einführung in die Zahlentheorie, 5. Aufl., de Gruyter, Berlin, New York, 1973, p. 108.
%H Vincenzo Librandi, <a href="/A014601/b014601.txt">Table of n, a(n) for n = 0..1000</a>
%H S. F. Barger, <a href="http://www.jstor.org/stable/2589724">Solution to problem 10454: Amenable Numbers</a>, Amer. Math. Monthly, Vol. 105, No. 4 (April 1998), p. 368.
%H Steven R. Finch, <a href="/A000924/a000924.pdf">Class number theory</a> [Cached copy, with permission of the author]
%H Heiko Harborth, <a href="http://dx.doi.org/10.1016/0097-3165(72)90039-8">Solution of Steinhaus's problem with plus and minus signs</a>, Journal of Combinatorial Theory, Series A, Volume 12, Issue 2 (March 1972), Pages 253-259.
%H Mickaël Launay, <a href="https://www.lemonde.fr/sciences/article/2024/02/24/les-routes-de-numland-l-enigme-maths-du-monde-n-2_6218343_1650684.html">Les routes de Numland</a>, L’énigme maths du "Monde" n°2. In French.
%H Michael Penn, <a href="https://www.youtube.com/watch?v=LXNxOG78ILw">The most beautiful arrangement of numbers</a>, YouTube video, 2024.
%H Rick L. Shepherd, <a href="http://libres.uncg.edu/ir/uncg/f/Shepherd_uncg_0154M_11099.pdf">Binary quadratic forms and genus theory</a>, Master of Arts Thesis, University of North Carolina at Greensboro, 2013.
%H <a href="/index/Rec#order_03">Index entries for linear recurrences with constant coefficients</a>, signature (1,1,-1).
%F a(n) = (n + 1)*2 + 1 - n mod 2. - _Reinhard Zumkeller_, Apr 21 2003
%F A014494(n) = A000217(a(n)). - _Reinhard Zumkeller_, Oct 04 2004
%F a(n) = Sum_{k=1..n} (2 - (-1)^k). - _William A. Tedeschi_, Mar 20 2008
%F A139131(a(n)) = A078636(a(n)). - _Reinhard Zumkeller_, Apr 10 2008
%F From _R. J. Mathar_, Sep 25 2009: (Start)
%F a(n) = a(n-1) + a(n-2) - a(n-3) for n > 2.
%F G.f.: x*(3+x)/((1+x)*(x-1)^2). (End)
%F a(n) = 2*n + (n mod 2). - Paolo Valzasina (p.valzasina(AT)gmail.com), Nov 24 2009
%F a(n) = (4*n - (-1)^n + 1)/2. - _Bruno Berselli_, Oct 06 2010
%F a(n) = 4*n - a(n-1) - 1 (with a(0) = 0). - _Vincenzo Librandi_, Dec 24 2010
%F a(n) = -A042948(-n) for all n in Z. - _Michael Somos_, Dec 27 2010
%F G.f.: 2*x / (1 - x)^2 + (1 / (1 - x) + 1 / (1 + x)) * x/2. - _Michael Somos_, Dec 27 2010
%F a(n) = Sum_{k>=0} A030308(n,k)*b(k) with b(0) = 3 and b(k) = 2^(k+1) for k > 0. - _Philippe Deléham_, Oct 17 2011
%F a(n) = ceiling((4/3)*ceiling(3*n/2)). - _Clark Kimberling_, Jul 04 2012
%F a(n) = 3n - 2*floor(n/2). - _Wesley Ivan Hurt_, Nov 08 2013
%F a(n) = A042948(n+1) - 1 for all n in Z. - _Michael Somos_, Jul 24 2015
%F a(n) + a(n+1) = A004767(n) for all n in Z. - _Michael Somos_, Jul 24 2015
%F Sum_{n>=1} (-1)^(n+1)/a(n) = 3*log(2)/4 - Pi/8. - _Amiram Eldar_, Dec 05 2021
%F E.g.f.: ((4*x + 1)*exp(x) - exp(-x))/2. - _David Lovler_, Aug 04 2022
%e G.f. = 3*x + 4*x^2 + 7*x^3 + 8*x^4 + 11*x^5 + 12*x^6 + 15*x^7 + 16*x^8 + ...
%p A014601:=n->3*n-2*floor(n/2); seq(A014601(k), k=0..100); # _Wesley Ivan Hurt_, Nov 08 2013
%t aa = {}; Do[Do[Do[d = b^2 - 4 a c; If[d <= 0, AppendTo[aa, -d]], {a, 0, 50}], {b, 0, 50}], {c, 0, 50}]; Union[aa] (* _Artur Jasinski_, Apr 28 2008 *)
%t Select[Range[0, 124], Or[Mod[#, 4] == 0, Mod[#, 4] == 3] &] (* _Ant King_, Nov 18 2010 *)
%t CoefficientList[Series[2 x/(1 - x)^2 + (1/(1 - x) + 1/(1 + x)) x/2, {x, 0, 100}], x] (* _Vincenzo Librandi_, May 18 2014 *)
%t a[ n_] := 2 n + Mod[n, 2]; (* _Michael Somos_, Jul 24 2015 *)
%o (Magma)[n: n in [0..200]|n mod 4 in {0,3}]; // _Vincenzo Librandi_, Dec 24 2010
%o (PARI) {a(n) = 2*n + n%2}; /* _Michael Somos_, Dec 27 2010 */
%o (Haskell)
%o a014601 n = a014601_list !! n
%o a014601_list = [x | x <- [0..], mod x 4 `elem` [0, 3]]
%o -- _Reinhard Zumkeller_, Jun 05 2012
%Y Cf. A004676, A014550, A042948, A079896.
%Y Cf. A274406. - _Bruno Berselli_, Jun 26 2016
%K nonn,easy
%O 0,2
%A Eric Rains (rains(AT)caltech.edu)