cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A079978 Characteristic function of multiples of three.

Original entry on oeis.org

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

Views

Author

Vladimir Baltic, Feb 17 2003

Keywords

Comments

Period 3: repeat [1, 0, 0].
a(n)=1 if n=3k, a(n)=0 otherwise.
Decimal expansion of 1/999.
Number of permutations satisfying -k <= p(i)-i <= r and p(i)-i not in I, i=1..n, with k=1, r=2, I={0,1}.
a(n) is also the number of partitions of n with every part being three (a(0)=1 because the empty partition has no parts). Hence a(n) is also the number of 2-regular graphs on n vertices with each component having girth 3. - Jason Kimberley, Oct 02 2011
Euler transformation of A185013. - Jason Kimberley, Oct 02 2011
If b(0)=0 and for n > 0, b(n)=a(n), then starting at n=0, b(n) is the number of incongruent equilateral triangles formed from the vertices of a regular n-gon. The number of incongruent isosceles triangles (strictly two equal sides) is A174257(n) and the number of incongruent scalene triangles is A069905(n-3) for n > 2, otherwise 0. The total number of incongruent triangles is A069905(n). - Frank M Jackson, Nov 19 2022

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.

Crossrefs

Essentially the same as A022003.
Partial sums are given by A002264(n+3).
Characteristic function of multiples of g: A000007 (g=0), A000012 (g=1), A059841 (g=2), this sequence (g=3), A121262 (g=4), A079998 (g=5), A079979 (g=6), A082784 (g=7). - Jason Kimberley, Oct 14 2011
Cf. A007908, A011655 (bit flipped).

Programs

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) == A007908(n+1) (mod 3), n >= 0. See A011655 (bit flipped). - Wolfdieter Lang, Jun 12 2017
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