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.

Showing 1-5 of 5 results.

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

A300069 Period 6: repeat [0, 0, 0, 1, 2, 1].

Original entry on oeis.org

0, 0, 0, 1, 2, 1, 0, 0, 0, 1, 2, 1, 0, 0, 0, 1, 2, 1, 0, 0, 0, 1, 2, 1, 0, 0, 0, 1, 2, 1, 0, 0, 0, 1, 2, 1, 0, 0, 0, 1, 2, 1, 0, 0, 0, 1, 2, 1, 0, 0, 0, 1, 2, 1, 0, 0, 0, 1, 2, 1, 0, 0, 0, 1, 2, 1, 0, 0, 0, 1, 2, 1, 0, 0, 0, 1, 2, 1, 0, 0, 0, 1, 2, 1
Offset: 0

Views

Author

Wolfdieter Lang, Feb 24 2018

Keywords

Comments

Underlying A174257(n+1), n >= 0.

Crossrefs

Programs

  • Mathematica
    PadRight[{}, 102, {0, 0, 0, 1, 2, 1}] (* or *)
    CoefficientList[Series[x^3*(1 + x)^2/(1 - x^6), {x, 0, 102}], x] (* Michael De Vlieger, Feb 25 2018 *)
  • PARI
    a(n) = my(v=[0, 0, 1, 2, 1]); v[if(n%6==0, 1, n%6)] \\ Felix Fröhlich, Feb 24 2018
    
  • PARI
    concat(vector(3), Vec(x^3*(1 + x)^2/(1 - x^6) + O(x^40))) \\ Felix Fröhlich, Feb 25 2018

Formula

a(n) = floor((n (mod 6))/3) + floor((n + 1 (mod 6))/5), n >= 0.
G.f.: x^3*(1 + x)^2/(1 - x^6) = -x^3*(1+x)/(x-1)/(1+x+x^2)/(1-x+x^2).
a(n) = (4 - 3*cos(n*Pi/3) - cos(2*n*Pi/3) - 3*sqrt(3)*sin(n*Pi/3) + sqrt(3)*sin(2*n*Pi/3))/6. - Wesley Ivan Hurt, Oct 04 2018

A174256 Number of 3 X 3 reduced magic squares with distinct values and maximum value 2n; also, with magic sum 3n.

Original entry on oeis.org

0, 0, 0, 8, 16, 8, 24, 24, 24, 32, 40, 32, 48, 48, 48, 56, 64, 56, 72, 72, 72, 80, 88, 80, 96, 96, 96, 104, 112, 104, 120, 120, 120, 128, 136, 128, 144, 144, 144, 152, 160, 152, 168, 168, 168, 176, 184, 176, 192, 192, 192, 200, 208, 200, 216, 216, 216, 224, 232, 224
Offset: 1

Views

Author

Thomas Zaslavsky, Mar 14 2010

Keywords

Comments

In a reduced magic square the row, column, and two diagonal sums must all be equal (the "magic sum") and the minimum entry is 0. The maximum entry is necessarily even and = (2/3)*(magic sum).
a(n) is a quasipolynomial with period 6.
The second differences of A108576 are a(n/2) for even n and 0 for odd n. The first differences of A108578 are a(n).

Crossrefs

Programs

  • Mathematica
    Take[CoefficientList[Series[(8x^8 (2x^2+1))/((x^4-1)(x^6-1)),{x,0,120}],x],{1,-1,2}] (* Harvey P. Dale, Aug 07 2017 *)

Formula

a(n) = 8*A174257(n).
G.f.: 8*x^4 * (2*x+1) / ((x^2-1) * (x^3-1)). [amended by Georg Fischer, Apr 17 2020]
a(n) = 2*(6*n - 13 - 8*cos(2*n*Pi/3) - 3*cos(n*Pi))/3. - Wesley Ivan Hurt, Oct 04 2018

A300076 A sequence based on the period 6 sequence A300075.

Original entry on oeis.org

0, 1, 1, 2, 2, 2, 3, 4, 4, 5, 5, 5, 6, 7, 7, 8, 8, 8, 9, 10, 10, 11, 11, 11, 12, 13, 13, 14, 14, 14, 15, 16, 16, 17, 17, 17, 18, 19, 19, 20, 20, 20, 21, 22, 22, 23, 23, 23, 24, 25, 25, 26, 26, 26, 27, 28, 28, 29, 29, 29, 30, 31, 31, 32, 32, 32, 33, 34, 34, 35, 35, 35, 36, 37, 37, 38, 38, 38, 39, 40, 40, 41, 41, 41, 42, 43, 43, 44, 44, 44
Offset: 0

Views

Author

Wolfdieter Lang, Mar 03 2018

Keywords

Comments

If 1 is added to each entry and the offset is set to 1 then the resulting sequence can be used to obtain integers in the quadratic number field Q(sqrt(3)) for the two components of the vertices V0_{-k}, as well as V3_{-k}, for k >= 1, of a k-family of ascending regular hexagons. Their centers 0{-k} form part of a discrete hexagon spiral.

Crossrefs

Formula

a(n) = A300075(n) + 3*floor(n/6), n >= 0.
a(n) = A300293(n-1) + 1, n >= 1.
G.f.: x*(1 + x^2 + x^5)/((1 - x^6)*(1 - x)) = G(x) + 3*x^6/((1-x)*(1-x^6)), with the g.f. G(x) of A300075.

A300293 A sequence based on the period 6 sequence A151899.

Original entry on oeis.org

0, 0, 1, 1, 1, 2, 3, 3, 4, 4, 4, 5, 6, 6, 7, 7, 7, 8, 9, 9, 10, 10, 10, 11, 12, 12, 13, 13, 13, 14, 15, 15, 16, 16, 16, 17, 18, 18, 19, 19, 19, 20, 21, 21, 22, 22, 22, 23, 24, 24, 25, 25, 25, 26, 27, 27, 28, 28, 28, 29, 30, 30, 31, 31, 31, 32, 33, 33, 34, 34, 34, 35, 36, 36, 37, 37, 37, 38, 39, 39, 40, 40, 40, 41, 42, 42, 43, 43, 43, 44
Offset: 0

Views

Author

Wolfdieter Lang, Mar 05 2018

Keywords

Comments

a(k-1) + 2 =: v2(k), k >= 1, is used to obtain for 2^(v2(k))*V_{-k}(2) as well as 2^(v2(k))*V_{-k}(5) integer coordinates in the quadratic number field Q(sqrt(3)), where V_{-k}(j), j = 0..5, are the vertices of a k-family of regular hexagons H_{-k} whose centers O_{-k} form part of a discrete spiral. See the linked paper, Lemma 6, eqs. (47) and (48), and the Table 19. - Wolfdieter Lang, Mar 30 2018

Crossrefs

Programs

  • Mathematica
    LinearRecurrence[{1,0,0,0,0,1,-1},{0,0,1,1,1,2,3},100] (* Harvey P. Dale, Dec 29 2024 *)
  • PARI
    a151899(n) = [0, 0, 1, 1, 1, 2][n%6+1]
    a(n) = a151899(n) + 3*floor(n/6) \\ Felix Fröhlich, Mar 30 2018

Formula

a(n) = A151899(n) + 3*floor(n/6), n >= 0.
a(n) = A300076(n+1) - 1.
G.f.: x^2*(1 + x^3 + x^4)/((1 - x^6)*(1 - x)) = G(x) + 3*x^6/((1-x)*(1-x^6)), with the g.f. G(x) of A151899.
a(n) = a(n-1) + a(n-6) - a(n-7). - Wesley Ivan Hurt, Jun 19 2025
Showing 1-5 of 5 results.