OFFSET
0,3
COMMENTS
More precisely:
a(n) = a(n-1)/n if a(n-1)/n is integer and not already in the sequence. Else:
a(n) = a(n-1)-n if a(n-1)-n is positive and not already in the sequence. Else:
a(n) = a(n-1)+n if a(n-1)+n is not already in the sequence. Else:
a(n) = a(n-1)*n if a(n-1)*n is not already in the sequence. Else STOP.
In other words, divide if you can, else subtract, else add, else multiply.
By a(1000) there are 3 division steps, 928 subtraction steps, 59 addition steps and 10 multiplication steps. It is unlikely that every number belongs to the sequence since there are many "holes". It is an open question if there are any repetitions after a multiplication step. Can anybody expand the series?
At a(2500000000) = 2285684529311288243, there have been 44 divisions, 2499821613 subtractions, 178253 additions, and 90 multiplications. The largest value seen was a(1926305697) = 3555357710450807490. No multiplication step has produced a duplicate term. - Benjamin Chaffin, Sep 22 2016
LINKS
EXAMPLE
a(24) = 432 because:
- a(23) = 18,
- 18/24 is not an integer,
- 18 - 24 is negative,
- 18 + 24 = 42 is already in the sequence,
- 18 * 24 = 432 is not already in the sequence.
MATHEMATICA
f[s_List] := Block[{l = s[[-1]], n = Length@ s}, If[ IntegerQ[l/n] && !MemberQ[s, l/n], Append[s, l/n], If[l > n && !MemberQ[s, l - n], Append[s, l - n], If[ !MemberQ[s, l + n], Append[s, l + n], Append[s, l*n]]]]]; Nest[f, {0}, 62] (* Robert G. Wilson v, Sep 10 2016 *)
PROG
(Python)
from itertools import count, islice
def A113880(): # generator of terms
aset, an = {0, 1}, 1
yield from [0, 1]
for n in count(2):
q, r = divmod(an, n)
if r == 0 and q not in aset: an = q
elif (d:=an-n) > 0 and d not in aset: an = d
elif (s:=an+n) not in aset: an = s
elif (m:=an*n) not in aset: an = m
else: return
yield an
aset.add(an)
print(list(islice(A113880(), 63))) # Michael S. Branicky, May 26 2023
CROSSREFS
KEYWORD
nonn
AUTHOR
Sergio Pimentel, Jan 27 2006
EXTENSIONS
a(0) = 0 prepended by Robert G. Wilson v, Sep 10 2016
STATUS
approved