A082784 Characteristic function of multiples of 7.
1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0
Offset: 0
Examples
a(14) = a(2*7) = 1; a(41) = a(5*7+6) = 0.
Links
- Index entries for characteristic functions.
- Index entries for linear recurrences with constant coefficients, signature (0,0,0,0,0,0,1).
Crossrefs
Programs
-
Haskell
a082784 = a000007 . (`mod` 7) a082784_list = cycle [1,0,0,0,0,0,0] -- Reinhard Zumkeller, Oct 27 2012
-
Magma
[Binomial(n-1,6) mod 7 : n in [0..100]]; // Wesley Ivan Hurt, Oct 07 2014
-
Maple
A082784:=n->0^(n mod 7): seq(A082784(n), n=0..100); # Wesley Ivan Hurt, Oct 07 2014
-
Mathematica
Table[Mod[Binomial[n - 1, 6], 7], {n, 0, 100}] (* Wesley Ivan Hurt, Oct 07 2014 *) Table[Boole[Divisible[n, 7]], {n, 0, 100}] (* Amiram Eldar, Oct 31 2023 *)
-
PARI
a(n)=!(n%7) \\ Charles R Greathouse IV, Dec 03 2012
Formula
a(n) = 0^(n mod 7).
a(0)=1, a(n)=0 for 1<=n<7, a(n+7)=a(n).
a(n) = 1 - (n^6 mod 7). - Paolo P. Lava, Oct 02 2006
a(n) = floor(n/7)-floor((n-1)/7). - Tani Akinari, Oct 26 2012
a(n) = C(n-1,6) mod 7. - Wesley Ivan Hurt, Oct 07 2014
From Wesley Ivan Hurt, Jul 11 2016: (Start)
G.f.: 1/(1-x^7).
a(n) = a(n-7) for n>6.
a(n) = (gcd(n,7) - 1)/6. (End)
Extensions
Wrong formula and keyword mult removed by Amiram Eldar, Oct 31 2023
Comments