(Translated by https://www.hiragana.jp/)
A087620 - OEIS
login
#{0<=k<=n: k*n is divisible by 4}.
2

%I #19 Sep 08 2022 08:45:11

%S 1,1,2,1,5,2,4,2,9,3,6,3,13,4,8,4,17,5,10,5,21,6,12,6,25,7,14,7,29,8,

%T 16,8,33,9,18,9,37,10,20,10,41,11,22,11,45,12,24,12,49,13,26,13,53,14,

%U 28,14,57,15,30,15,61,16,32,16,65,17,34,17,69,18,36,18,73,19,38,19,77,20

%N #{0<=k<=n: k*n is divisible by 4}.

%C With the similar remainder 1, 2 and 3 sequences provides a four-fold partition of A000027.

%H Colin Barker, <a href="/A087620/b087620.txt">Table of n, a(n) for n = 0..1000</a>

%H <a href="/index/Rec#order_08">Index entries for linear recurrences with constant coefficients</a>, signature (0,0,0,2,0,0,0,-1).

%F a(n) = Sum_{k=0..n} if (k*n mod 4 = 0, 1, 0).

%F From _Colin Barker_, May 03 2015: (Start)

%F a(n) = (6+4*n+i^n*(-i+n)+(-i)^n*(i+n)+2*(-1)^n*(1+n))/8 where i=sqrt(-1).

%F a(n) = 2*a(n-4)-a(n-8) for n>7.

%F G.f.: (3*x^4+x^3+2*x^2+x+1) / ((x-1)^2*(x+1)^2*(x^2+1)^2).

%F (End)

%t CoefficientList[Series[(3 x^4 + x^3 + 2 x^2 + x + 1)/((x - 1)^2 (x + 1)^2 (x^2 + 1)^2), {x, 0, 80}], x] (* _Vincenzo Librandi_, May 03 2015 *)

%o (PARI) Vec((3*x^4+x^3+2*x^2+x+1)/((x-1)^2*(x+1)^2*(x^2+1)^2) + O(x^100)) \\ _Colin Barker_, May 03 2015

%o (Magma) I:=[1,1,2,1,5,2,4,2]; [n le 8 select I[n] else 2*Self(n-4)-Self(n-8): n in [1..80]]; // _Vincenzo Librandi_, May 03 2015

%Y Cf. A026741, A077814, A087507.

%K easy,nonn

%O 0,3

%A _Paul Barry_, Sep 13 2003