proposed
approved
proposed
approved
editing
proposed
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]
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]
proposed
editing
editing
proposed
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
a(n+10) = a(n) for n in Z; a(-n) = a(n) for n in Z. - Rémi Guillaume, Aug 28 2024
proposed
editing
editing
proposed
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
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 [mj] := {n integer| P_k(n) = mj}. 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. 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. Than c := min, p := max - min + 1 and q := p^m*sum_{i = 1..m} (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 = 606836 for this sequence. - _Hieronymus Fischer_, Jan 04 2013
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 there are infinitely many choices.). - M. F. Hasler, Jan 13 2013
a(n) = n( mod 5) if (-1)^floor(n/5) = +1 else (5-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.
a(n) = (2/5)*cos(Pi*n) - cos(4/5*Pi*n/5) - (1/5)*cos(3/5*Pi*n/5) + (2/5)*5^(1/2)* cos(3*Pi*n/5) - cos(2*Pi*n/5) - (1/5)*cos(1/5*Pi*n/5) - (2/5)*5^(1/2)*cos(1/5*Pi*n) - cos(2/5*Pi*n) + 2. - Leonid Bedratyuk, May 13 2012
a(n+10) = a(n); a(-n) = a(n). - Rémi Guillaume, Aug 28 2024
a(12) = 12( mod 5) = 2 because since 12\5 = floor(12/5) = 2 is even; the sign is +1.
a(7) = (5-7)( mod 5) = 3 because since 7\5 = floor(7/5) = 1 is odd; the sign is -1.
approved
editing
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
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 [m] := {n integer| P_k(n) = m}. 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., 7 + 12 = 19 == 1 Modd 5 is not equivalent to 3 + 2 = 5 == 0 Modd 5; . 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 Than c := min, p := max - min + 1 and q := p^m * Sum_sum_{i = 1..m} (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 = 606836 for this sequence. - Hieronymus Fischer, Jan 04 2013
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 There are infinitely many choices.). - M. F. Hasler, Jan 13 2013
a(n) = n (mod 5) if (-1)^floor(n/5) = +1 else (5-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.
a(n) = (2/5)*cos(Pi*n) - cos(4/5*Pi*n/5) - (1/5)*cos(3/5*Pi*n/5) + (2/5)*5^(1/2)* cos(3/5*Pi*n/5) - (1/5)*cos(1/5*Pi*n/5) - (2/5)*5^(1/2)*cos(1/5*Pi*n/5) - cos(2/5*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(12) = 12 (mod 5) = 2 since because 12\5 = floor(12/5)=2 is even; the sign is +1.
a(7) = (5-7) (mod 5) = 3 since because 7\5 = floor(7/5)=1 is odd; the sign is -1.
From Rémi Guillaume, Aug 08 2024: (Start)
12 (Modd 5) := 12 (mod 10) = 2, the smallest positive representative of the class 2 (Modd 5) = {+-2,+-8,+-12,+-18,...}.
7 (Modd 5) := -7 (mod 10) = 3, the smallest positive representative of the class 3 (Modd 5) = {+-3,+-7,+-13,+-17,...}. (End)
proposed
approved
editing
proposed