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-7 of 7 results.

A000012 The simplest sequence of positive numbers: the all 1's sequence.

Original entry on oeis.org

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

Views

Author

N. J. A. Sloane, May 16 1994

Keywords

Comments

Number of ways of writing n as a product of primes.
Number of ways of writing n as a sum of distinct powers of 2.
Continued fraction for golden ratio A001622.
Partial sums of A000007 (characteristic function of 0). - Jeremy Gardiner, Sep 08 2002
An example of an infinite sequence of positive integers whose distinct pairwise concatenations are all primes! - Don Reble, Apr 17 2005
Binomial transform of A000007; inverse binomial transform of A000079. - Philippe Deléham, Jul 07 2005
A063524(a(n)) = 1. - Reinhard Zumkeller, Oct 11 2008
For n >= 0, let M(n) be the matrix with first row = (n n+1) and 2nd row = (n+1 n+2). Then a(n) = absolute value of det(M(n)). - K.V.Iyer, Apr 11 2009
The partial sums give the natural numbers (A000027). - Daniel Forgues, May 08 2009
From Enrique Pérez Herrero, Sep 04 2009: (Start)
a(n) is also tau_1(n) where tau_2(n) is A000005.
a(n) is a completely multiplicative arithmetical function.
a(n) is both squarefree and a perfect square. See A005117 and A000290. (End)
Also smallest divisor of n. - Juri-Stepan Gerasimov, Sep 07 2009
Also decimal expansion of 1/9. - Enrique Pérez Herrero, Sep 18 2009; corrected by Klaus Brockhaus, Apr 02 2010
a(n) is also the number of complete graphs on n nodes. - Pablo Chavez (pchavez(AT)cmu.edu), Sep 15 2009
Totally multiplicative sequence with a(p) = 1 for prime p. Totally multiplicative sequence with a(p) = a(p-1) for prime p. - Jaroslav Krizek, Oct 18 2009
n-th prime minus phi(prime(n)); number of divisors of n-th prime minus number of perfect partitions of n-th prime; the number of perfect partitions of n-th prime number; the number of perfect partitions of n-th noncomposite number. - Juri-Stepan Gerasimov, Oct 26 2009
For all n>0, the sequence of limit values for a(n) = n!*Sum_{k>=n} k/(k+1)!. Also, a(n) = n^0. - Harlan J. Brothers, Nov 01 2009
a(n) is also the number of 0-regular graphs on n vertices. - Jason Kimberley, Nov 07 2009
Differences between consecutive n. - Juri-Stepan Gerasimov, Dec 05 2009
From Matthew Vandermast, Oct 31 2010: (Start)
1) When sequence is read as a regular triangular array, T(n,k) is the coefficient of the k-th power in the expansion of (x^(n+1)-1)/(x-1).
2) Sequence can also be read as a uninomial array with rows of length 1, analogous to arrays of binomial, trinomial, etc., coefficients. In a q-nomial array, T(n,k) is the coefficient of the k-th power in the expansion of ((x^q -1)/(x-1))^n, and row n has a sum of q^n and a length of (q-1)*n + 1. (End)
The number of maximal self-avoiding walks from the NW to SW corners of a 2 X n grid.
When considered as a rectangular array, A000012 is a member of the chain of accumulation arrays that includes the multiplication table A003991 of the positive integers. The chain is ... < A185906 < A000007 < A000012 < A003991 < A098358 < A185904 < A185905 < ... (See A144112 for the definition of accumulation array.) - Clark Kimberling, Feb 06 2011
a(n) = A007310(n+1) (Modd 3) := A193680(A007310(n+1)), n>=0. For general Modd n (not to be confused with mod n) see a comment on A203571. The nonnegative members of the three residue classes Modd 3, called [0], [1], and [2], are shown in the array A088520, if there the third row is taken as class [0] after inclusion of 0. - Wolfdieter Lang, Feb 09 2012
Let M = Pascal's triangle without 1's (A014410) and V = a variant of the Bernoulli numbers A027641 but starting [1/2, 1/6, 0, -1/30, ...]. Then M*V = [1, 1, 1, 1, ...]. - Gary W. Adamson, Mar 05 2012
As a lower triangular array, T is an example of the fundamental generalized factorial matrices of A133314. Multiplying each n-th diagonal by t^n gives M(t) = I/(I-t*S) = I + t*S + (t*S)^2 + ... where S is the shift operator A129184, and T = M(1). The inverse of M(t) is obtained by multiplying the first subdiagonal of T by -t and the other subdiagonals by zero, so A167374 is the inverse of T. Multiplying by t^n/n! gives exp(t*S) with inverse exp(-t*S). - Tom Copeland, Nov 10 2012
The original definition of the meter was one ten-millionth of the distance from the Earth's equator to the North Pole. According to that historical definition, the length of one degree of latitude, that is, 60 nautical miles, would be exactly 111111.111... meters. - Jean-François Alcover, Jun 02 2013
Deficiency of 2^n. - Omar E. Pol, Jan 30 2014
Consider n >= 1 nonintersecting spheres each with surface area S. Define point p on sphere S_i to be a "public point" if and only if there exists a point q on sphere S_j, j != i, such that line segment pq INTERSECT S_i = {p} and pq INTERSECT S_j = {q}; otherwise, p is a "private point". The total surface area composed of exactly all private points on all n spheres is a(n)*S = S. ("The Private Planets Problem" in Zeitz.) - Rick L. Shepherd, May 29 2014
For n>0, digital roots of centered 9-gonal numbers (A060544). - Colin Barker, Jan 30 2015
Product of nonzero digits in base-2 representation of n. - Franklin T. Adams-Watters, May 16 2016
Alternating row sums of triangle A104684. - Wolfdieter Lang, Sep 11 2016
A fixed point of the run length transform. - Chai Wah Wu, Oct 21 2016
Length of period of continued fraction for sqrt(A002522) or sqrt(A002496). - A.H.M. Smeets, Oct 10 2017
a(n) is also the determinant of the (n+1) X (n+1) matrix M defined by M(i,j) = binomial(i,j) for 0 <= i,j <= n, since M is a lower triangular matrix with main diagonal all 1's. - Jianing Song, Jul 17 2018
a(n) is also the determinant of the symmetric n X n matrix M defined by M(i,j) = min(i,j) for 1 <= i,j <= n (see Xavier Merlin reference). - Bernard Schott, Dec 05 2018
a(n) is also the determinant of the symmetric n X n matrix M defined by M(i,j) = tau(gcd(i,j)) for 1 <= i,j <= n (see De Koninck & Mercier reference). - Bernard Schott, Dec 08 2020

Examples

			1 + 1/(1 + 1/(1 + 1/(1 + 1/(1 + ...)))) = A001622.
1/9 = 0.11111111111111...
From _Wolfdieter Lang_, Feb 09 2012: (Start)
Modd 7 for nonnegative odd numbers not divisible by 3:
A007310: 1, 5, 7, 11, 13, 17, 19, 23, 25, 29, 31, 35, 37, ...
Modd 3:  1, 1, 1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1, ...
(End)
		

References

  • John H. Conway and Richard K. Guy, The Book of Numbers, New York: Springer-Verlag, 1996. See p. 186.
  • J.-M. De Koninck & A. Mercier, 1001 Problèmes en Théorie Classique des Nombres, Problème 692 pp. 90 and 297, Ellipses, Paris, 2004.
  • Xavier Merlin, Méthodix Algèbre, Exercice 1-a), page 153, Ellipses, Paris, 1995.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
  • James J. Tattersall, Elementary Number Theory in Nine Chapters, Cambridge University Press, 1999, pages 277, 284.
  • S. Wolfram, A New Kind of Science, Wolfram Media, 2002; p. 55.
  • Paul Zeitz, The Art and Craft of Mathematical Problem Solving, The Great Courses, The Teaching Company, 2010 (DVDs and Course Guidebook, Lecture 6: "Pictures, Recasting, and Points of View", pp. 32-34).

Crossrefs

Programs

  • Haskell
    a000012 = const 1
    a000012_list = repeat 1 -- Reinhard Zumkeller, May 07 2012
    
  • Magma
    [1 : n in [0..100]];
    
  • Maple
    seq(1, i=0..150);
  • Mathematica
    Array[1 &, 50] (* Joseph Biberstine (jrbibers(AT)indiana.edu), Dec 26 2006 *)
  • Maxima
    makelist(1, n, 1, 30); /* Martin Ettl, Nov 07 2012 */
    
  • PARI
    {a(n) = 1};
    
  • Python
    print([1 for n in range(90)]) # Michael S. Branicky, Apr 04 2022

Formula

a(n) = 1.
G.f.: 1/(1-x).
E.g.f.: exp(x).
G.f.: Product_{k>=0} (1 + x^(2^k)). - Zak Seidov, Apr 06 2007
Completely multiplicative with a(p^e) = 1.
Regarded as a square array by antidiagonals, g.f. 1/((1-x)(1-y)), e.g.f. Sum T(n,m) x^n/n! y^m/m! = e^{x+y}, e.g.f. Sum T(n,m) x^n y^m/m! = e^y/(1-x). Regarded as a triangular array, g.f. 1/((1-x)(1-xy)), e.g.f. Sum T(n,m) x^n y^m/m! = e^{xy}/(1-x). - Franklin T. Adams-Watters, Feb 06 2006
Dirichlet g.f.: zeta(s). - Ilya Gutkovskiy, Aug 31 2016
a(n) = Sum_{l=1..n} (-1)^(l+1)*2*cos(Pi*l/(2*n+1)) = 1 identically in n >= 1 (for n=0 one has 0 from the undefined sum). From the Jolley reference, (429) p. 80. Interpretation: consider the n segments between x=0 and the n positive zeros of the Chebyshev polynomials S(2*n, x) (see A049310). Then the sum of the lengths of every other segment starting with the one ending in the largest zero (going from the right to the left) is 1. - Wolfdieter Lang, Sep 01 2016
As a lower triangular matrix, T = M*T^(-1)*M = M*A167374*M, where M(n,k) = (-1)^n A130595(n,k). Note that M = M^(-1). Cf. A118800 and A097805. - Tom Copeland, Nov 15 2016

A203571 Period length 10: [0, 1, 2, 3, 4, 0, 4, 3, 2, 1] repeated.

Original entry on oeis.org

0, 1, 2, 3, 4, 0, 4, 3, 2, 1, 0, 1, 2, 3, 4, 0, 4, 3, 2, 1, 0, 1, 2, 3, 4, 0, 4, 3, 2, 1, 0, 1, 2, 3, 4, 0, 4, 3, 2, 1, 0, 1, 2, 3, 4, 0, 4, 3, 2, 1, 0, 1, 2, 3, 4, 0, 4, 3, 2, 1, 0, 1, 2, 3, 4, 0, 4, 3, 2, 1, 0, 1, 2, 3, 4, 0, 4, 3, 2, 1, 0, 1, 2, 3, 4, 0, 4, 3, 2, 1, 0, 1, 2, 3, 4, 0, 4, 3, 2, 1, 0
Offset: 0

Views

Author

Wolfdieter Lang, Jan 11 2012

Keywords

Comments

This sequence can be continued periodically for negative values of n.
This is the fifth sequence of a k-family of sequences P_k, k>=1, which starts with A000007(n+1), n >= 0 (the 0-sequence), A000035, A193680, A193682, for k = 1, ..., 4, respectively.
In general, the sequence P_k, k >= 1 (periodically continued for negative values of n), is used to define the k equivalence classes [0], [1], ..., [k-1], with [j] := {n integer| P_k(n) = j}. Two integers are equivalent if and only if they are mapped by P_k to the same value. For P_5, P_6 and P_7 see the arrays (not the triangles) A090298, A092260 and A113807, respectively. In each of these cases the class [k] should be replaced by the class [0], and also negative n-values are allowed. Multiplication can be done class-wise. E.g., k = 5: P_5(n) = a(n), 7*12 == 3*2 = 6 == 4; a(7*12) = a(a(7)*a(12)) = a(3*2) = 4. This kind of multiplication could be called multiplication Modd n, in order to distinguish it from multiplication mod n. Addition cannot be done class-wise. E.g., k = 5: 7 + 12 = 19 == 1 is not equivalent to 3 + 2 = 5 == 0; a(7+12) = 1 is not equal to a(a(7) + a(12)) = a(3+2) = 0.
Periodic sequences of this type can be also calculated by a(n) = c + floor(q/(p^m-1)*p^n) mod p, where c is a constant, q is the number representing the periodic digit pattern and m is the period length. c, p and q can be calculated as follows: Let D be the array representing the number pattern to be repeated, m = size of D, max = maximum value of elements in D, min = minimum value of elements in D. Then c := min, p := max - min + 1 and q := p^m * Sum_{i=0..(m-1)} (D(i) - min)/p^i. Example: D = (0, 1, 2, 3, 4, 0, 4, 3, 2, 1), c = 0, m = 10, p = 5 and q = 3034180 for this sequence. - Hieronymus Fischer, Jan 04 2013 [Corrected by Rémi Guillaume, Aug 28 2024]
For periodic sequences with terms < 10 one can use the well-known fact that ab..z/99..9 = 0.ab..zab..zab..z... (infinite periodic decimal fraction), this leads to one of the given formulas. For the general case it is sufficient to shift the terms to nonnegative values and to switch to a sufficiently large basis instead of 10 (there are infinitely many choices). - M. F. Hasler, Jan 13 2013

Examples

			a(12) = 12 mod 5 = 2 since 12\5 = floor(12/5) = 2 is even; the sign is +1.
a(7) = -7 mod 5 = 3 since 7\5 = floor(7/5) = 1 is odd; the sign is -1.
		

Crossrefs

Programs

Formula

a(n) = n mod 5 if (-1)^floor(n/5) = +1 else -n mod 5, n >= 0. (-1)^floor(n/5) is the sign corresponding to the parity of the quotient floor(n/5). This quotient is sometimes denoted by n\5.
O.g.f.: x*(1+2*x+3*x^2+4*x^3+4*x^5+3*x^6+2*x^7+x^8)/(1-x^10) = -x*(1 +2*x +3*x^2 +4*x^3 +4*x^5 +3*x^6 +2*x^7 +x^8) / ( (x-1) *(1+x) *(x^4+x^3+x^2+x+1) *(x^4-x^3+x^2-x+1) ).
a(n) = (2/5)*cos(Pi*n) - cos(4*Pi*n/5) - (1/5)*cos(3*Pi*n/5) + (2/5)*5^(1/2)*cos(3*Pi*n/5) - cos(2*Pi*n/5) - (1/5)*cos(Pi*n/5) - (2/5)*5^(1/2)*cos(Pi*n/5) + 2. - Leonid Bedratyuk, May 13 2012
a(n) = floor(123404321/9999999999*10^(n+1)) mod 10. - Hieronymus Fischer, Jan 04 2013
a(n) = floor(151709/2441406*5^(n+1)) mod 5. - Hieronymus Fischer, Jan 04 2013
a(n) = (5-abs(n-(10*ceiling(n/10)-5)))*(ceiling((n+5)/10)-floor((n+5)/10)). - Wesley Ivan Hurt, Mar 26 2014 [corrected by Jason Yuen, Feb 17 2025]
a(n+10) = a(n) for n in Z; a(-n) = a(n) for n in Z. - Rémi Guillaume, Aug 28 2024

A193682 Period 8: repeat [0, 1, 2, 3, 0, 3, 2, 1].

Original entry on oeis.org

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

Views

Author

Wolfdieter Lang, Sep 30 2011

Keywords

Comments

This sequence can be continued periodically for negative values of n.
See a comment on A203571 where a k-family of 2k-periodic sequences P_k has been defined. The present sequence is P_4. - Wolfdieter Lang, Feb 02 2012

Examples

			a(10) = 10(mod 4) = 2 because 10\4 = floor(10/4)=2 is even; the parity is +1.
a(7) = (4-7)(mod 4) = 1 because 7\4 = floor(7/4)=1 is odd; the parity is -1.
		

Crossrefs

Cf. A193680 (mod 3 case).
Cf: A203571.

Programs

Formula

a(n) = n mod 4 if (-1)^floor(n/4)=+1, otherwise (4-n) mod 4, n >= 0. (-1)^floor(n/4) is the parity of the quotient floor(n/4). This quotient is sometimes denoted by n\4.
O.g.f.: x*(1+2*x+3*x^2+3*x^4+2*x^5+x^6)/( (1-x)*(1+x)*(1+x^2)*(1+x^4)).
a(n) = floor(410107/33333333*10^(n+1)) mod 10. - Hieronymus Fischer, Jan 04 2013
a(n) = floor(2323/21845*4^(n+1)) mod 4. - Hieronymus Fischer, Jan 04 2013

A204453 Period length 14: [0, 1, 2, 3, 4, 5, 6, 0, 6, 5, 4, 3, 2, 1] repeated.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 0, 6, 5, 4, 3, 2, 1, 0, 1, 2, 3, 4, 5, 6, 0, 6, 5, 4, 3, 2, 1, 0, 1, 2, 3, 4, 5, 6, 0, 6, 5, 4, 3, 2, 1, 0, 1, 2, 3, 4, 5, 6, 0, 6, 5, 4, 3, 2, 1, 0, 1, 2, 3, 4, 5, 6, 0, 6, 5, 4, 3, 2, 1, 0, 1, 2, 3, 4, 5, 6, 0, 6, 5, 4, 3, 2, 1, 0, 1, 2, 3, 4, 5
Offset: 0

Views

Author

Wolfdieter Lang, Jan 17 2012

Keywords

Comments

This sequence can be continued periodically for negative values of n, and then a(-n) = a(n).
This is the seventh sequence of a k-family of sequences P_k, k>=1, which starts with A000007(n+1), n>=0, (the 0-sequence), A000035, A193680, A193682, A203572, A for k=1..6, respectively.
See a comment on A203571 for the general case of the P_k sequences. For a(n)=P_7(n) the nonnegative members of the equivalence classes [0], [1],...,[6], defined by p==q iff P_7(p)=P_7(q), are found in the array A113807 if there the last class [7], starting with 7, is replaced by 0,7,14,..., to become the first class [0] (nonnegative part).

Examples

			a(16) = 16(mod 7) = 2 because 16\7 = floor(16/7)=2 is even; the sign is +1.
a(9) = (7-9)(mod 7) = 5 because 9\7 = floor(9/7)=1 is odd; the sign is -1.
		

Crossrefs

Cf. A203572 (k=6), A113807, A010876.

Formula

a(n) = n(mod 7) if (-1)^floor(n/7)=+1 else (7-n)(mod 7), n>=0. (-1)^floor(n/7) is the sign corresponding to the parity of the quotient floor(n/7). This quotient is sometimes denoted by n\7.
O.g.f.: x*(1+2*x+3*x^2+4*x^3+5*x^4+6*x^5+6*x^7+5*x^8+4*x^9+ 3*x^10+2*x^11+x^12)/(1-x^14).
a(n) = (7*m*(m^4-21*m^3+175*m^2-735*m+1624)*((-1)^floor(n/7)-1)-10908*(-1)^floor(n/7)+12348)*m/1440 where m = n-7*floor(n/7). - Luce ETIENNE, Oct 13 2017

A186809 Period 6 sequence [0, 1, 2, 0, -2, -1, ...].

Original entry on oeis.org

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

Views

Author

Michael Somos, Feb 26 2011

Keywords

Comments

For n > 0: a(n) = A262565(n+1) - A262565(n). - Reinhard Zumkeller, Oct 19 2015

Examples

			G.f. = x + 2*x^2 - 2*x^4 - x^5 + x^7 + 2*x^8 - 2*x^10 - x^11 + x^13 + ...
		

Crossrefs

Cf. A193680.
Cf. A262565.

Programs

  • Haskell
    a186809 n = a186809_list !! (n-1)
    a186809_list = cycle [0, 1, 2, 0, -2, -1]
    -- Reinhard Zumkeller, Oct 19 2015
  • Magma
    [(((n+1) mod 3)-1)*(((n+1) mod 2)+1)*(-1)^(n+1) : n in [0..100]]; // Wesley Ivan Hurt, Aug 31 2014
    
  • Maple
    A186809:=n->(((n+1) mod 3)-1)*(((n+1) mod 2)+1)*(-1)^(n+1): seq(A186809(n), n=0..100); # Wesley Ivan Hurt, Aug 31 2014
  • Mathematica
    Table[(Mod[n + 1, 3] - 1) (Mod[n + 1, 2] + 1) (-1)^(n + 1), {n, 0, 100}] (* Wesley Ivan Hurt, Aug 31 2014 *)
    PadRight[{},120,{0,1,2,0,-2,-1}] (* Harvey P. Dale, Nov 18 2020 *)
  • PARI
    {a(n) = [0, 1, 2, 0, -2, -1][n%6 + 1]};
    

Formula

Euler transform of length 6 sequence [2, -3, 0, 0, 0, 1].
a(n) is multiplicative with a(2^e) = -2 * (-1)^e if e>0. a(3^e) = 0^e, a(p^e) = 1 if p == 1 (mod 6), a(p^e) = (-1)^n if p == 5 (mod 6).
G.f.: x * (1 + x)^2 / (1 + x^2 + x^4). a(n+3) = a(-n) = -a(n). a(n) = n if |n| < 3.
a(n) = (mod(n+1, 3) - 1) * (mod(n+1, 2) + 1) * (-1)^(n+1). - Wesley Ivan Hurt, Aug 31 2014
|a(n)| = A193680(n). - Wesley Ivan Hurt, Aug 31 2014

A203572 Period length 12: 0, 1, 2, 3, 4, 5, 0, 5, 4, 3, 2, 1 repeated.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 0, 5, 4, 3, 2, 1, 0, 1, 2, 3, 4, 5, 0, 5, 4, 3, 2, 1, 0, 1, 2, 3, 4, 5, 0, 5, 4, 3, 2, 1, 0, 1, 2, 3, 4, 5, 0, 5, 4, 3, 2, 1, 0, 1, 2, 3, 4, 5, 0, 5, 4, 3, 2, 1, 0
Offset: 0

Views

Author

Wolfdieter Lang, Jan 12 2012

Keywords

Comments

This sequence can be continued periodically for negative values of n.
This is the sixth sequence of a k-family of sequences P_k, k>=1, which starts with A000007(n+1), n>=0, (the 0-sequence), A000035, A193680, A193682, A203571 for k=1,...,5, respectively.
See a comment on A203571 for the general case of the P_k sequences. For a(n)=P_6(n) the nonnegative members of the equivalence classes [0], [1],...,[5], defined by p==q iff P_6(p)=P_6(q), are found in the array A092260 if there class [6], starting with 6, is replaced by 0,6,12,..., which is class [0] (nonnegative part).

Examples

			a(14) = 14(mod 6) = 2 because 14\6 = floor(14/6)=2 is even; the sign is +1.
a(8) = (6-8)(mod 6) = 4 because 8\6 = floor(8/6)=1 is odd; the sign is -1.
		

Crossrefs

Cf. A203571.

Programs

  • Mathematica
    PadRight[{},120,{0,1,2,3,4,5,0,5,4,3,2,1}] (* Harvey P. Dale, Nov 28 2015 *)

Formula

a(n) = n(mod 6) if (-1)^floor(n/6)=+1 else (6-n)(mod 6), n>=0. (-1)^floor(n/6) is the sign corresponding to the parity of the quotient floor(n/6). This quotient is sometimes denoted by n\6.
O.g.f.: x*(1+2*x+3*x^2+4*x^3+5*x^4+5*x^6+4*x^7+3*x^8+2*x^9+ x^10)/(1-x^12).

A337938 Irregular triangle read by rows: T(n, k) gives the primitive period of the sequence {k (Modd n)}_{k >= 0}, for n >= 1.

Original entry on oeis.org

0, 0, 1, 0, 1, 2, 0, 2, 1, 0, 1, 2, 3, 0, 3, 2, 1, 0, 1, 2, 3, 4, 0, 4, 3, 2, 1, 0, 1, 2, 3, 4, 5, 0, 5, 4, 3, 2, 1, 0, 1, 2, 3, 4, 5, 6, 0, 6, 5, 4, 3, 2, 1, 0, 1, 2, 3, 4, 5, 6, 7, 0, 7, 6, 5, 4, 3, 2, 1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 0, 8, 7, 6, 5, 4, 3, 2, 1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 9, 8, 7, 6, 5, 4, 3, 2, 1
Offset: 1

Views

Author

Wolfdieter Lang, Oct 25 2020

Keywords

Comments

The length of row n is 1 for n = 1, 2 for n = 2, and 2*n for n >= 3.
The modified modular equivalence relation Modd n is defined, for integer k and positive integer n, by k (Modd n) = k (mod n) if floor(k/n) is even, and -k (mod n) if floor(k/n) is odd. The smallest nonnegative complete residue system modulo n, namely RS(n) = {0, 1, ..., n-1}, is used. See the W. Lang link, Definition 4, eq. (69), p. 25 - 26.
In order to have row length 2*n for all n >= 1 one could use for n = 1 and 2 the imprimitive periods 0, 0 and 0, 1, 0, 1, respectively.
The name Modd n derives from the fact that the multiplicative (but not additive ) group Modd n has the smallest positive reduced residue system with only odd numbers, named RRSodd(n), as elements (for n = 0 RRS(n) = {0}, but here it is taken as {1}). This group is isomorphic to the Galois group G(rho(n)) = Gal(Q(rho(n))/Q), with rho(n) = 2*cos(pi/n). See the W. Lang link.

Examples

			The irregular triangle begins:
n \ k 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 ..
1:    0
2:    0 1
3:    0 1 2 0 2 1
4:    0 1 2 3 0 3 2 1
5:    0 1 2 3 4 0 4 3 2 1
6:    0 1 2 3 4 5 0 5 4 3  2  1
7:    0 1 2 3 4 5 6 0 6 5  4  3  2  1
8:    0 1 2 3 4 5 6 7 0 7  6  5  4  3  2  1
9:    0 1 2 3 4 5 6 7 8 0  8  7  6  5  4  3  2  1
10   :0 1 2 3 4 5 6 7 8 9  0  9  8  7  6  5  4  3  2  1
...
T(1, 0) = 0 because {k (Modd 1)}_{k >= 0} is the 0 sequence A000007:  0 (Modd 1) =  0 (mod 1) = 0, 1 (Modd 1) = -1 (mod 1) = 0,  2 (Modd 1) = 2 (mod 1) = 0, ... .
T(7, 6) = 6 because floor(6/7) = 0, which is even, hence 6 (Modd 7) = 6 (mod 7) = 6.
T(7, 8) = 6 because  floor(8/7) = 1, which is odd, hence  8 (Modd 7) = -8 (mod 7) = 6.
		

Crossrefs

Cf. Periodic sequences for n = 1, 2, ..., 7: A000007, A000035, A193680, A193682, A203571, A203572.
Cf. A002262 (for mod n), A053616 (as a triangle, for mod* n).

Formula

T(n,k) = k (Modd n), for n >= 1, and k = 0 for n = 1, k = 0, 1 for n = 2, and k = 0, 1, ..., 2*n - 1, for n >= 3. For k (Modd n) see the comment above.
Showing 1-7 of 7 results.