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

 

Logo


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

0,5

COMMENTS

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

LINKS

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

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

FORMULA

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

G.f.: x*(1 + x)/(1 - x^3)^2. - Arkadiusz Wesolowski, May 28 2013

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

EXAMPLE

a(4) = 2 because k=1 and k=4 satisfy the equation.

MATHEMATICA

LinearRecurrence[{0, 0, 2, 0, 0, -1}, {0, 1, 1, 0, 2, 2}, 100] (* Vincenzo Librandi, Sep 22 2015 *)

PROG

(PARI) concat(0, Vec((1 + x)/(1 - x^3)^2+O(x^99))) \\ Charles R Greathouse IV, Oct 24 2014

(PARI) a(n) = sum(k=0, n, Mod(k*n, 3)==1); \\ Michel Marcus, Sep 27 2017

(MAGMA) I:=[0, 1, 1, 0, 2, 2]; [n le 6 select I[n] else 2*Self(n-3) - Self(n-6): n in [1..100]]; // Vincenzo Librandi, Sep 22 2015

CROSSREFS

Cf. A000027, A087507, A087509.

Sequence in context: A271707 A127899 A128615 * A095731 A048142 A071426

Adjacent sequences:  A087505 A087506 A087507 * A087509 A087510 A087511

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 22 13:47 EST 2019. Contains 329393 sequences. (Running on oeis4.)