OFFSET
1,1
COMMENTS
a(26) is not an integer, so we terminate the sequence. This is the longest integer-only sequence of this type.
LINKS
Puzzling StackExchange, What is the next number in the series: 21, 21, 23, 20, 5, 25, 31, 24,?.
EXAMPLE
a(1) = 27846
a(2) = a(1)/1 = 27846
a(3) = a(2)+2 = 27848
a(4) = a(3)-3 = 27845
a(5) = a(4)*4 = 111380
a(6) = a(5)/5 = 22276
MATHEMATICA
With[{f = {Times, Divide, Plus, Subtract}}, NestWhile[Append[#1, Apply[f[[#3]], {#1[[-1]], #2}]] & @@ {#1, #2, 1 + Mod[#2, 4]} & @@ {#1, Length[#]} &, {27846}, FreeQ[#, Rational] &, 1, Infinity, -1]] (* Michael De Vlieger, Oct 01 2019 *)
CROSSREFS
KEYWORD
nonn,fini
AUTHOR
Dmitry Kamenetsky, Oct 01 2019
STATUS
approved
