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!)
 A190582 Generalized McCarthy function: a(n) = n - s if n > c; otherwise, a(n) = a(a(n+t)) with d = t - s > 0, with parameters t=15, s=9, c=21. 0
 16, 17, 18, 13, 14, 15, 16, 17, 18, 13, 14, 15, 16, 17, 18, 13, 14, 15, 16, 17, 18, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40 (list; graph; refs; listen; history; text; internal format)
 OFFSET 1,1 COMMENTS The parameters t=11, s=10, c=100 give the McCarthy 91-Function A103847. LINKS FORMULA The sequence begins with a(1) = d*floor((c+d-1)/d) + 1 - s;   if n <= c and c > d then a(n) = a(n-d);   if n <= c <= d then a(n) = a(1) + n - 1;   if n > c then a(n) = n - s. EXAMPLE For t=9, s=5, d=t-s=4, and   c=1: (0,-3,-2,-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, ...)   c=2: (0, 1,-2,-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, ...)   c=3: (0, 1, 2,-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, ...)   c=4: (0, 1, 2, 4, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, ...)   c=5: (4, 1, 2, 3, 4, 1, 2, 3, 4, 5, 6, 7, 8, 9, ...)   c=6: (4, 5, 2, 3, 4, 5, 2, 3, 4, 5, 6, 7, 8, 9, ...)   c=7: (4, 5, 6, 3, 4, 5, 6, 3, 4, 5, 6, 7, 8, 9, ...)   c=8: (4, 5, 6, 7, 4, 5, 6, 7, 4, 5, 6, 7, 8, 9, ...)   c=9: (8, 5, 6, 7, 8, 5, 6, 7, 8, 5, 6, 7, 8, 9, ...) MAPLE d=t-s: a[1]:=d*(iquo(c+d-1, d))+1-s: if (c <= d) then   for j from 2 to c do     a[j]:=a[1]+j-1:   end do: end if: if (c > d) then   k:=(c-1) mod d +1:   for j from 2 to k do     a[j]:=a[1]+j-1:   end do:   for j from (k+1) to d do     a[j]:=a[1]+j-d-1:   end do:   for j from (d+1) to c do     a[j]:=a[j-d]:   end do: end if: for n from (c+1) to 50 do   a[n]:=n-s: end do: CROSSREFS Cf. A103847 (McCarthy 91-function). Sequence in context: A070575 A004505 A262460 * A004457 A248501 A115420 Adjacent sequences:  A190579 A190580 A190581 * A190583 A190584 A190585 KEYWORD nonn AUTHOR Paul Weisenhorn, May 13 2011 EXTENSIONS Name corrected by Paul Weisenhorn, Aug 12 2018 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 June 2 14:21 EDT 2020. Contains 334787 sequences. (Running on oeis4.)