A042948 Numbers congruent to 0 or 1 (mod 4).
0, 1, 4, 5, 8, 9, 12, 13, 16, 17, 20, 21, 24, 25, 28, 29, 32, 33, 36, 37, 40, 41, 44, 45, 48, 49, 52, 53, 56, 57, 60, 61, 64, 65, 68, 69, 72, 73, 76, 77, 80, 81, 84, 85, 88, 89, 92, 93, 96, 97, 100, 101, 104, 105, 108
Offset: 0
Links
- James Spahlinger, Table of n, a(n) for n = 0..10000
- H. W. Gould, The inverse of a finite series and a third-order recurrent sequence, Fibonacci Quart., Vol. 44, No. 4 (2006), pp. 302-315. See p. 311.
- M. J. Pelling and J. H. Steelman, E3269. Permutations with distinct displacements, (problem by Pelling and solution by Steelman), The American Mathematical Monthly, 96 (1989), 843-844.
- T. Skolem, On certain distributions of integers in pairs with given differences, Math. Scand., Vol. 5 (1957), pp. 57-68.
- Harry Tamvakis and O. P. Lossers, Amenable Numbers: 10454, The American Mathematical Monthly, Vol. 105, No. 4 (Apr., 1998), p. 368.
- Leo Tavares, Illustration: Diamond Crosses
- Eric Weisstein's World of Mathematics, Bishop Graph.
- Eric Weisstein's World of Mathematics, Black Bishop Graph.
- Eric Weisstein's World of Mathematics, Maximal Clique.
- Eric Weisstein's World of Mathematics, Maximum Vertex Degree.
- Index entries for linear recurrences with constant coefficients, signature (1,1,-1).
Programs
-
Magma
[n: n in [0..150]|n mod 4 in {0, 1}]; // Vincenzo Librandi, Dec 09 2015
-
Maple
a[0]:=0:a[1]:=1:for n from 2 to 100 do a[n]:=a[n-2]+4 od: seq(a[n], n=0..54); # Zerinvary Lajos, Mar 16 2008
-
Mathematica
Select[Range[0, 150], Or[Mod[#, 4] == 0, Mod[#, 4] == 1] &] (* Vincenzo Librandi, Dec 09 2015 *) Table[(4 n - 5 - (-1)^n)/2, {n, 20}] (* Eric W. Weisstein, Dec 01 2017 *) LinearRecurrence[{1, 1, -1}, {1, 4, 5}, {0, 20}] (* Eric W. Weisstein, Dec 01 2017 *) CoefficientList[Series[x (1 + 3 x)/((-1 + x)^2 (1 + x)), {x, 0, 20}], x] (* Eric W. Weisstein, Dec 01 2017 *) {#, # + 1} & /@ (4 Range[0, 40]) // Flatten (* Harvey P. Dale, Jan 15 2024 *)
-
Maxima
makelist(-1/2+1/2*(-1)^n+2*n, n, 0, 60); /* Martin Ettl, Nov 05 2012 */
-
PARI
a(n)=2*n-n%2;
-
PARI
concat(0, Vec(x*(1+3*x)/((1+x)*(1-x)^2) + O(x^100))) \\ Altug Alkan, Dec 09 2015
Formula
a(n) = A042963(n+1) - 1. [Corrected by Jianing Song, Oct 06 2018]
From Michael Somos, Jan 12 2000: (Start)
G.f.: x*(1 + 3*x)/((1 + x)*(1 - x)^2).
a(n) = a(n-1) + 2 + (-1)^n. (End)
a(n) = 4*n - a(n-1) - 3 with a(0) = 0. - Vincenzo Librandi, Nov 17 2010
a(n) = floor((4/3)*floor(3*n/2)). - Clark Kimberling, Jul 04 2012
a(n) = n + 2*floor(n/2) = 2*n - (n mod 2). - Bruno Berselli, Apr 30 2016
E.g.f.: 2*exp(x)*x - sinh(x). - Stefano Spezia, Sep 09 2019
Sum_{n>=1} (-1)^(n+1)/a(n) = Pi/8 + 3*log(2)/4. - Amiram Eldar, Dec 05 2021
Comments