The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation. Hints (Greetings from The On-Line Encyclopedia of Integer Sequences!)
 A203571 Period length 10: [0, 1, 2, 3, 4, 0, 4, 3, 2, 1] repeated. 43
 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 (list; graph; refs; listen; history; text; internal format)
 OFFSET 0,3 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 , , ..., [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 case the class [k] should be replaced by the class , 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 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 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 LINKS Index entries for linear recurrences with constant coefficients, signature (0,0,0,0,0,0,0,0,0,1). 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. 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/5*Pi*n) - 1/5*cos(3/5*Pi*n) + 2/5*5^(1/2)* cos(3/5*Pi*n) - 1/5*cos(1/5*Pi*n) - 2/5*5^(1/2)*cos(1/5*Pi*n) - cos(2/5*Pi*n) + 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) = ((-abs(n-(10*ceiling(n/10)-5)+(10*ceiling(n/10)-5))(ceiling((n+5)/10)-floor((n+5)/10)) mod 10. - Wesley Ivan Hurt, Mar 26 2014 EXAMPLE a(12) = 12(mod 5) = 2 because 12\5 = floor(12/5)=2 is even; the sign is +1. a(7) = (5-7)(mod 5) = 3 because 7\5 = floor(7/5)=1 is odd; the sign is -1. MATHEMATICA A203571[n_] := {0, 1, 2, 3, 4, 0, 4, 3, 2, 1}[[Mod[n, 10] + 1]]; Table[A203571[n], {n, 0, 59}] (* Jean-François Alcover, Jul 05 2013 *) PROG (PARI) A203571(n)=[0, 1, 2, 3, 4, 0, 4, 3, 2, 1][n%10+1]  \\  M. F. Hasler, Jan 13 2013 (PARI) A203571(n)=151709*5^(n%10+1)\2441406%5  \\ M. F. Hasler, Jan 13 2013 CROSSREFS Cf. A193682. Sequence in context: A011025 A286248 A286247 * A199511 A049279 A126013 Adjacent sequences:  A203568 A203569 A203570 * A203572 A203573 A203574 KEYWORD nonn,easy AUTHOR Wolfdieter Lang, Jan 11 2012 STATUS approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

Last modified October 1 00:42 EDT 2020. Contains 337440 sequences. (Running on oeis4.)