login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A077814 a(n) = #{0<=k<=n: mod(kn,4)=2}. 3
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, 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, 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 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,7
COMMENTS
Coefficients in the unique expansion of e/4 = Sum[a(n)/n!, n>=1], where a(n) satisfies 0<=a(n)<n-1.
LINKS
FORMULA
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.
a(n) = floor(n!*e/4) - n*floor((n-1)!*e/4). - Benoit Cloitre, Dec 07 2002
a(n) = Sum_{k=0..n} if (mod(nk, 4)=2, 1, 0)}. E.g. a(6) = #{1, 3, 5} = 3. - Paul Barry, Sep 10 2003
O.g.f.: x^2*(1-x+x^2)/((x-1)^2*(1+x^2)^2). - R. J. Mathar, Jun 13 2008
From Wesley Ivan Hurt, May 30 2015: (Start)
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.
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)
EXAMPLE
sum(i=1,10,a(i)/i!)=0.6795703813... exp(1)/4=0.679570457...
MATHEMATICA
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
CROSSREFS
Sequence in context: A122861 A326045 A277097 * A131728 A075115 A273528
KEYWORD
nonn,easy
AUTHOR
John W. Layman, Dec 03 2002
EXTENSIONS
More terms from Benoit Cloitre, Dec 07 2002
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 19 09:23 EDT 2024. Contains 371782 sequences. (Running on oeis4.)