Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Revision History for A203571

(Bold, blue-underlined text is an addition; faded, red-underlined text is a deletion.)

Showing entries 1-10 | older changes
Period length 10: [0, 1, 2, 3, 4, 0, 4, 3, 2, 1] repeated.
(history; published version)
#69 by N. J. A. Sloane at Fri Aug 30 06:27:09 EDT 2024
STATUS

proposed

approved

#68 by Michel Marcus at Thu Aug 29 08:58:46 EDT 2024
STATUS

editing

proposed

Discussion
Thu Aug 29
09:38
Rémi Guillaume: 606836 is 5 times too small. The general formula:
a(n) = floor((q/(p^m-1))*p^n) mod p, gives:
a(n) = floor((3034180/(5^10-1))*5^n) mod 5
 = floor((3034180/9765624)*5^n) mod 5
 = floor((758545/2441406)*5^n) mod 5
 = floor((151709/2441406)*5^(n+1)) mod 5:
this is Hieronymus Fischer's last FORMULA (this FORMULA works).
But if Editors find the COMMENTS long enough, they can remove:
«[Corrected by Rémi Guillaume, ...]».
17:04
Michel Marcus: isn't it due to the change you did of: i = 1..m to i=0..(m-1)  ??
18:35
Rémi Guillaume: .
The change of i=1..m to i=0..(m-1) is necessary to fix the false FORMULA:
a(n) = floor((606836/(5^10-1))*5^n) mod 5, to the correct FORMULA:
a(n) = floor((3034180/(5^10-1))*5^n) mod 5. Examples:
a(0) = floor((606836/(5^10-1))*5^0) mod 5 = 0 mod 5 = 0 «alright», but:
a(0) = floor((3034180/(5^10-1))*5^0) mod 5 = 0 mod 5 = 0;
a(1) ≠ floor((606836/(5^10-1))*5^1) mod 5 = 0 mod 5 = 0,
a(1) = floor((3034180/(5^10-1))*5^1) mod 5 = 1 mod 5 = 1;
a(2) ≠ floor((606836/(5^10-1))*5^2) mod 5 = 1 mod 5 = 1,
a(2) = floor((3034180/(5^10-1))*5^2) mod 5 = 7 mod 5 = 2.
#67 by Michel Marcus at Thu Aug 29 08:49:49 EDT 2024
COMMENTS

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]

STATUS

proposed

editing

Discussion
Thu Aug 29
08:58
Michel Marcus: Are you sure your "correction" is really necessary ?  606836  did not work ?
#66 by Rémi Guillaume at Thu Aug 29 07:21:32 EDT 2024
STATUS

editing

proposed

Discussion
Thu Aug 29
08:49
Michel Marcus: New line = new block
#65 by Rémi Guillaume at Thu Aug 29 07:11:04 EDT 2024
DATA

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

FORMULA

a(n+10) = a(n) for n in Z; a(-n) = a(n) for n in Z. - Rémi Guillaume, Aug 28 2024

#64 by Michel Marcus at Thu Aug 29 02:49:39 EDT 2024
STATUS

proposed

editing

Discussion
Thu Aug 29
06:56
Rémi Guillaume: ● My intention was not to create a new block, just to start a new line; but the two spaces I've added just before «Let D be the array representing [...]» are not displayed.
● I've corrected (& edited) «q := p^m * Sum_{i=1..m} (D(i) - min)/p^i»
to «q := p^m * Sum_{i=0..(m-1)} (D(i) - min)/p^i»,
and «q = 606836 for this sequence» to «q = 3034180 for this sequence».
#63 by Rémi Guillaume at Wed Aug 28 14:45:33 EDT 2024
STATUS

editing

proposed

Discussion
Thu Aug 29
02:31
Michel Marcus: No to your comment edit : you created a new block , and you say corrected but we can't see what
02:31
Michel Marcus: Like NJAS did, I am tempted to revert your changes
#62 by Rémi Guillaume at Wed Aug 28 13:43:15 EDT 2024
DATA

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

COMMENTS

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

FORMULA

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

EXAMPLE

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.

STATUS

approved

editing

Discussion
Wed Aug 28
14:36
Rémi Guillaume: ·
● I've added two spaces just before «Let D be the array representing [...]», but they're not displayed.
● The FORMULAS:
«a(n) = n mod 5 if (-1)^floor(n/5) = +1 else -n mod 5, n >= 0.» should be:
«a(n) = n mod 10 if (-1)^floor(n/5) = +1 else -n mod 10, n >= 0.»; shouldn't they? See Wolfdieter Lang's example, very recently removed from A206549:
«9 Modd 5 := -9 mod 10 = 1, the smallest positive representative of the class 1 (Modd 5) = {+-1,+-9,+-11,+-19,...}.».
● Editors should feel free to remove "my" FORMULAS,
«a(n+10) = a(n); a(-n) = a(n).», if they find them trivial.
#61 by N. J. A. Sloane at Wed Aug 28 11:48:38 EDT 2024
DATA

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

COMMENTS

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

FORMULA

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

EXAMPLE

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)

STATUS

proposed

approved

#60 by Michel Marcus at Thu Aug 08 23:02:39 EDT 2024
STATUS

editing

proposed

Discussion
Fri Aug 09
01:56
Rémi Guillaume: @Michel Marcus: Thank you for your edit & your answer.
BTW: «a(n) = (2/5)*cos(Pi*n) - ...» could be reduced; couldn't it?
Reply to your answer: -6 mod 10 = 4, ..., -9 mod 10 = 1;
you've forgotten to remove the first «5». :-)
BTW: the very first formula, «n (mod 5)», should be «n mod 10»; shouldn't it?
Sat Aug 10
16:45
Rémi Guillaume: The Style Sheet (& Wikipedia) says:
«a == b (mod c) means that a-b is a multiple of c»;
«a mod c = b means that the remainder when a is divided by c is b».
So, certain couples of parentheses should be added to or removed from the present (A203571's) page, including from the examples that I've copied-pasted-adapted; shouldn't they?
Tue Aug 13
08:35
Rémi Guillaume: Is there a specific reason for not reducing-sorting:
(2/5)*cos(Pi*n) - ..., please? I think this would become:
-((2sqrt(5)+1)/5)*cos(Pi*n/5) - cos(2*Pi*n/5)
 + ((2sqrt(5)-1)/5)*cos(3*Pi*n/5) - cos(4*Pi*n/5)
 + (2/5)*cos(Pi*n) + 2.
Sun Aug 18
09:36
Rémi Guillaume: Here, (a(n)) starts with a(0) = 0, not a(1) = 0;
so (D(n)) should also start with D(0) = 0, not D(1) = 0;
so the formula for q should be:
q = 5^10 * Sum_{i=0..9} (D(i))/(5^i), not 5^10 * Sum_{i=1..10} (D(i))/(5^i);
so q should be 606836*5 = 3034180, not 606836. (Shouldn't they?)
Indeed, a(n) = floor((q/(p^m-1))*p^n) mod p gives:
a(n) = floor((3034180/(5^10-1))*5^n) mod 5,
 not floor((606836/(5^10-1))*5^n) mod 5. Examples:
a(0) = floor((3034180/(5^10-1))*5^0) mod 5 = 0 mod 5 = 0,
and floor((606836/(5^10-1))*5^0) mod 5 = 0 mod 5 = 0 «alright»; but:
a(1) = floor((3034180/(5^10-1))*5^1) mod 5 = 1 mod 5 = 1,
 not floor((606836/(5^10-1))*5^1) mod 5 = 0 mod 5 = 0;
a(2) = floor((3034180/(5^10-1))*5^2) mod 5 = 7 mod 5 = 2,
 not floor((606836/(5^10-1))*5^2) mod 5 = 1 mod 5 = 1.
Wed Aug 28
11:48
N. J. A. Sloane: This discuaaion has become incomprehensible.  I am going to revert these changes.  Please resubmit your comments, but next time keep the Pink Box discussion to a minimum.