A079978 Characteristic function of multiples of three.
1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0
Offset: 0
References
- D. H. Lehmer, Permutations with strongly restricted displacements. Combinatorial theory and its applications, II (Proc. Colloq., Balatonfured, 1969), pp. 755-770. North-Holland, Amsterdam, 1970.
Links
- Vladimir Baltic, On the number of certain types of strongly restricted permutations, Applicable Analysis and Discrete Mathematics Vol. 4, No 1 (2010), 119-135.
- N. Gogin and A. Mylläri, Padovan-like sequences and Bell polynomials, Proceedings of Applications of Computer Algebra ACA, 2013.
- Clark Kimberling, A Combinatorial Classification of Triangle Centers on the Line at Infinity, J. Int. Seq., Vol. 22 (2019), Article 19.5.4.
- Index entries for characteristic functions
- Index entries for linear recurrences with constant coefficients, signature (0,0,1).
Crossrefs
Programs
-
Haskell
a079978 = fromEnum . (== 0) . (`mod` 3) a079978_list = cycle [1,0,0] -- Reinhard Zumkeller, Aug 28 2012, Nov 26 2011
-
Magma
&cat[[1,0,0]^^30]; // Vincenzo Librandi, Dec 26 2015
-
Maple
seq(op([1, 0, 0]), n=0..50); # Wesley Ivan Hurt, Jun 30 2016
-
Mathematica
Table[Boole[IntegerQ[n/3]], {n, 0, 127}] (* Michael De Vlieger, Jan 03 2015, after Alonso del Arte at A121262 *)
-
PARI
a(n)=!(n%3) \\ Jaume Oliver Lafont, Mar 01 2009
Formula
a(n) = a(n-3) for n > 2.
G.f.: 1/(1-x^3) = 1/( (1-x)*(1+x+x^2)).
a(n) = (1 + e^(i*Pi*A002487(n)))/2, i=sqrt(-1). - Paul Barry, Jan 14 2005
Additive with a(p^e) = 1 if p = 3, 0 otherwise.
a(n) = ((n+1) mod 3) mod 2. Also: a(n) = (1/2)*(1 + (-1)^(n + floor((n+1)/3))). - Hieronymus Fischer, May 29 2007
a(n) = 1 - A011655(n). - Reinhard Zumkeller, Nov 30 2009
a(n) = (1 + (-1)^(2*n/3) + (-1)^(-2*n/3))/3. - Jaume Oliver Lafont, May 13 2010
For the general case: the characteristic function of numbers that are multiples of m is a(n) = floor(n/m) - floor((n-1)/m), m,n > 0. - Boris Putievskiy, May 08 2013
a(n) = floor( ((n-1) mod 3)/2 ). - Wesley Ivan Hurt, Jun 29 2013
a(n) = 2^(n mod 3) mod 2. - Olivier Gérard, Jul 04 2013
a(n) = (w^(2*n) + w^n + 1)/3, w = (-1 + i*sqrt(3))/2 (w is a primitive 3rd root of unity). - Bogart B. Strauss, Jul 20 2013
E.g.f.: (exp(x) + 2*exp(-x/2)*cos(sqrt(3)*x/2))/3. - Geoffrey Critzer, Nov 03 2014
a(n) = (sin(Pi*(n+1)/3)^2)*(2/3) + sin(Pi*(n+1)*2/3)/sqrt(3). - Mikael Aaltonen, Jan 03 2015
a(n) = (2*n^2 + 1) mod 3. The characteristic function of numbers that are multiples of 2k+1 is (2*k*n^(2*k) + 1) mod (2k+1). Example: A058331(n) mod 3 for k=1, A211412(n) mod 5 for k=2, ... - Eric Desbiaux, Dec 25 2015
a(n) = floor(2*(n-1)/3) - 2*floor((n-1)/3). - Wesley Ivan Hurt, Jul 25 2016
a(n) = 1/3 + (2/3)*cos((2/3)*n*Pi). - Ridouane Oudra, Jan 22 2021
a(n) = A000217(n+1) mod 3. - Christopher Adams, Jan 05 2025
Extensions
Name simplified by Ralf Stephan, Nov 22 2010
Name changed by Jason Kimberley, Oct 14 2011
Comments