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

%I

%S 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,

%T 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,

%U 22,11,-11,-1,-12,12,24,2,26,51,26,1,26,13,-13,-1,-14

%N 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.

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

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

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

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

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

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

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

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

%H Alois P. Heinz, <a href="/A211605/b211605.txt">Table of n, a(n) for n = 1..1000</a>

%F 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

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

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

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

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

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

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

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

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

%p end:

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

%p seq(a(n), n=1..100); # _Alois P. Heinz_, Feb 16 2013

%o (Small Basic)

%o a[1]=1

%o a[2]=2

%o For n=3 To 100

%o nn = math.Remainder(n,4)

%o If nn = 3 Then ' operation +

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

%o Else

%o EndIf

%o If nn = 0 Then ' operation *

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

%o Else

%o EndIf

%o If nn=1 Then ' operation -

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

%o Else

%o EndIf

%o If nn=2 Then ' operation /

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

%o Else

%o EndIf

%o EndFor

%o For j = 1 to 100

%o TextWindow.Write(j+" ")

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

%o TextWindow.WriteLine(" ")

%o EndFor

%K sign,easy

%O 1,2

%A _Kival Ngaokrajang_, Feb 10 2013

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 August 12 05:33 EDT 2020. Contains 336438 sequences. (Running on oeis4.)