login
This site is supported by donations to The OEIS Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A087509 a(n) = #{k=0..n, mod(kn,3) = 2}. 4
0, 0, 1, 0, 1, 2, 0, 2, 3, 0, 3, 4, 0, 4, 5, 0, 5, 6, 0, 6, 7, 0, 7, 8, 0, 8, 9, 0, 9, 10, 0, 10, 11, 0, 11, 12, 0, 12, 13, 0, 13, 14, 0, 14, 15, 0, 15, 16, 0, 16, 17, 0, 17, 18, 0, 18, 19, 0, 19, 20, 0, 20, 21, 0, 21, 22, 0, 22, 23, 0, 23, 24, 0, 24, 25, 0, 25, 26, 0, 26, 27, 0, 27, 28, 0, 28 (list; graph; refs; listen; history; text; internal format)
OFFSET

0,6

COMMENTS

a(n) = A000027(n) - A087507(n) - A087508(n).

LINKS

Table of n, a(n) for n=0..85.

Index entries for linear recurrences with constant coefficients, signature (0,0,2,0,0,-1).

FORMULA

a(n) = Sum_{k=0..n} if (mod(kn, 3) = 2, 1, 0);

a(n) = n-2(floor(n/3)+1)(1-cos(2*Pi*n/3))/3-floor(n/3)(5+4*cos(2*Pi*n/3))/3.

G.f.: x^2*(x^2+1) / ((x-1)^2*(x^2+x+1)^2). - Colin Barker, Mar 31 2013

a(n) = 2*sin(n*Pi/3)*(sqrt(3)*cos(n*Pi)+2*n*sin(n*Pi/3))/9. - Wesley Ivan Hurt, Sep 24 2017

EXAMPLE

a(8) = #{1,4,7} = 3.

PROG

(PARIĀ° a(n) = sum(k=0, n, (k*n % 3)==2); \\ Michel Marcus, Sep 25 2017

CROSSREFS

Sequence in context: A281260 A182406 A160706 * A274097 A265400 A181871

Adjacent sequences:  A087506 A087507 A087508 * A087510 A087511 A087512

KEYWORD

easy,nonn

AUTHOR

Paul Barry, Sep 11 2003

STATUS

approved

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

License Agreements, Terms of Use, Privacy Policy. .

Last modified November 12 22:10 EST 2019. Contains 329079 sequences. (Running on oeis4.)