login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A211605 a(n) is the nearest integer to x(n), where x(1) = 1, x(2) = 2, x(n) = operation (n-2 mod 4) applied to the pair (x(n-1), x(n-2)), where operation 1 is addition, operation 2 is multiplication, operation 3 is subtraction and operation 0 is division. 1
1, 2, 3, 6, 3, 1, 4, 2, -2, -1, -3, 3, 6, 2, 8, 15, 8, 1, 8, 4, -4, -1, -5, 5, 10, 2, 12, 24, 12, 1, 13, 6, -6, -1, -7, 7, 15, 2, 17, 33, 17, 1, 17, 9, -9, -1, -10, 10, 19, 2, 21, 42, 21, 1, 22, 11, -11, -1, -12, 12, 24, 2, 26, 51, 26, 1, 26, 13, -13, -1, -14 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,2

COMMENTS

This sequence generated by operations [+ * - /] which is slowest increasing among total 24 permutation operations sequences.

The total 24 sequences can be grouped as 6 patterns of as following:

1: [+ - * /], [- * / +], [* / + -], [/ + - *]

2: [+ - / *], [- / * +], [/ * + -], [* + - /]

3: [+ * - /], [* - / +], [- / + *], [/ + * -]

4: [+ * / -], [* / - +], [/ - + *], [- + * /]

5: [+ / - *], [/ - * +], [- * + /], [* + / -]

6: [+ / * -], [/ * - +], [* - + /], [- + / *]

LINKS

Alois P. Heinz, Table of n, a(n) for n = 1..1000

FORMULA

G.f.: -(-x^56 +x^55 +x^54 +x^53 -x^52 -2*x^50 +2*x^49 +3*x^48 +3*x^47 -4*x^46 +x^43 -3*x^41 +2*x^40 +4*x^39 +3*x^38 +3*x^37 +5*x^36 +2*x^35 -3*x^34 +x^31 -2*x^29 +x^28 +5*x^27 +2*x^26 +3*x^25 +4*x^24 +2*x^23 -3*x^22 +x^19 -2*x^17 +x^16 +4*x^15 +2*x^14 +4*x^13 +5*x^12 +3*x^11 -4*x^10 +x^7 -x^6 -2*x^5 +x^4 +5*x^3 +3*x^2 +2*x +1)*x / (-x^57 +x^54 -x^51 +x^48 +x^9 -x^6 +x^3 -1). - Alois P. Heinz, Feb 16 2013

EXAMPLE

x(3) = x(2) + x(1) = 2 + 1   = 3,       a(3) = 3,

x(4) = x(3) * x(2) = 3 * 2   = 6,       a(4) = 6,

x(5) = x(4) - x(3) = 6 - 3   = 3,       a(5) = 3,

x(6) = x(5) / x(4) = 3 / 6   = 0.5,     a(6) = 1,

x(7) = x(6) + x(5) = 0.5 + 3 = 3.5,     a(7) = 4,...

MAPLE

x:= proc(n) option remember; `if`(n<3, n,

       [(x, y)->x/y, (x, y)->x+y, (x, y)->x*y, (x, y)->x-y]

       [1+irem(n-2, 4)](x(n-1), x(n-2)))

    end:

a:= n-> round(x(n)):

seq(a(n), n=1..100);   # Alois P. Heinz, Feb 16 2013

PROG

(Small Basic)

a[1]=1

a[2]=2

For n=3 To 100

  nn = math.Remainder(n, 4)

  If nn = 3 Then ' operation +

    a[n]=a[n-1]+a[n-2]

  Else

  EndIf

  If nn = 0 Then ' operation *

    a[n]=a[n-1]*a[n-2]

  Else

  EndIf

  If nn=1 Then ' operation -

    a[n]=a[n-1]-a[n-2]

  Else

  EndIf

  If nn=2 Then ' operation  /

    a[n]=a[n-1]/a[n-2]

  Else

EndIf

EndFor

For j = 1 to 100

  TextWindow.Write(j+" ")

  TextWindow.Write(math.Round(a[j]))

  TextWindow.WriteLine(" ")

EndFor

CROSSREFS

Sequence in context: A214630 A093396 A189971 * A316610 A322229 A245886

Adjacent sequences:  A211602 A211603 A211604 * A211606 A211607 A211608

KEYWORD

sign,easy

AUTHOR

Kival Ngaokrajang, Feb 10 2013

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.

License Agreements, Terms of Use, Privacy Policy. .

Last modified July 5 01:22 EDT 2020. Contains 335457 sequences. (Running on oeis4.)