A281746 Nonnegative numbers k such that k == 0 (mod 3) or k == 0 (mod 5).
0, 3, 5, 6, 9, 10, 12, 15, 18, 20, 21, 24, 25, 27, 30, 33, 35, 36, 39, 40, 42, 45, 48, 50, 51, 54, 55, 57, 60, 63, 65, 66, 69, 70, 72, 75, 78, 80, 81, 84, 85, 87, 90, 93, 95, 96, 99, 100, 102, 105, 108, 110, 111, 114, 115, 117, 120, 123, 125, 126, 129, 130, 132, 135
Offset: 1
Links
- Colin Barker, Table of n, a(n) for n = 1..1000
- Project Euler, Problem 1: Multiples of 3 or 5.
- Rosetta Code, FizzBuzz.
- Index entries for linear recurrences with constant coefficients, signature (1,0,0,0,0,0,1,-1).
Crossrefs
Programs
-
Mathematica
Select[Range[0, 200], MemberQ[Mod[#, {3, 5}], 0]&] (* or *) LinearRecurrence[{1, 0, 0, 0, 0, 0, 1, -1}, {0, 3, 5, 6, 9, 10, 12, 15}, 80] (* Harvey P. Dale, Apr 01 2018 *) Union[3Range[0, 33], 5Range[20]] (* Alonso del Arte, Sep 03 2018 *) CoefficientList[Series[-(3*x^7 + 2*x^6 + x^5 + 3*x^4 + x^3 + 2*x^2 + 3*x) / (-x^8 + x^7 + x - 1) , {x, 0, 80}], x] (* Stefano Spezia, Sep 16 2018 *)
-
PARI
concat(0, Vec(x^2*(3 + 2*x + x^2 + 3*x^3 + x^4 + 2*x^5 + 3*x^6) / ((1 - x)^2*(1 + x + x^2 + x^3 + x^4 + x^5 + x^6)) + O(x^100))) \\ Colin Barker, Feb 07 2017
Formula
G.f.: -(3*x^8 + 2*x^7 + x^6 + 3*x^5 + x^4 + 2*x^3 + 3*x^2) / (-x^8 + x^7 + x - 1).
a(n) = a(n-1) + a(n-7) - a(n-8) for n > 8. - Colin Barker, Feb 07 2017
a(n) = 15n/7 + O(1). - Charles R Greathouse IV, Jan 13 2025
Comments