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.

A077814 a(n) = #{0<=k<=n: mod(k*n,4)=2}.

This page as a plain text file.
%I A077814 #30 Apr 07 2025 14:14:42
%S A077814 0,0,1,1,0,1,3,2,0,2,5,3,0,3,7,4,0,4,9,5,0,5,11,6,0,6,13,7,0,7,15,8,0,
%T A077814 8,17,9,0,9,19,10,0,10,21,11,0,11,23,12,0,12,25,13,0,13,27,14,0,14,29,
%U A077814 15,0,15,31,16,0,16,33,17,0,17,35,18,0,18,37,19,0,19,39,20,0,20,41,21,0
%N A077814 a(n) = #{0<=k<=n: mod(k*n,4)=2}.
%C A077814 Coefficients in the unique expansion of e/4 = Sum_{n>=1} a(n)/n!, where a(n) satisfies 0<=a(n)<n-1.
%H A077814 <a href="/index/Rec#order_06">Index entries for linear recurrences with constant coefficients</a>, signature (2,-3,4,-3,2,-1).
%F A077814 a(n)=0 if n=4k, a(n)=k if n=4k+1, a(n)=2k+1 if n=4k+2 and a(n)=k+1 if n=4k+3.
%F A077814 a(n) = floor(n!*e/4) - n*floor((n-1)!*e/4). - _Benoit Cloitre_, Dec 07 2002
%F A077814 a(n) = Sum_{k=0..n} if(mod(k*n, 4)=2, 1, 0). - _Paul Barry_, Sep 10 2003
%F A077814 O.g.f.: x^2*(1-x+x^2)/((x-1)^2*(1+x^2)^2). - _R. J. Mathar_, Jun 13 2008
%F A077814 From _Wesley Ivan Hurt_, May 30 2015: (Start)
%F A077814 a(n) = 2*a(n-1)-3*a(n-2)+4*a(n-3)-3*a(n-4)+2*a(n-5)-a(n-6), n>6.
%F A077814 a(n) = (-1)^((1-2*n-(-1)^n)/4)*((-1)^n-2*n*(-1)^((2*n+3+(-1)^n)/4)+n*(-1)^((1+(-1)^n)/2)+n*(-1)^((2*n+1+(-1)^n)/2)-1)/8. (End)
%e A077814 a(6) = #{1, 3, 5} = 3.
%t A077814 a = Table[0, {i, 1, 50}]; x = Exp[1]/4; For[n = 2, n <= 51, n++, { an = 0; While [(x >= (1/n!)) && (an < (n - 1)), {an++, x = x - (1/n!)} ]}; a[[n - 1]] = an;]; a
%t A077814 LinearRecurrence[{2,-3,4,-3,2,-1},{0,0,1,1,0,1},90] (* _Harvey P. Dale_, Apr 07 2025 *)
%Y A077814 Cf. A009947, A087509, A087620.
%K A077814 nonn,easy
%O A077814 0,7
%A A077814 _John W. Layman_, Dec 03 2002
%E A077814 More terms from _Benoit Cloitre_, Dec 07 2002