OFFSET
1,1
COMMENTS
If b(k)=0 we get b(k+1)=0, b(k+2)=0, and the sequence ends because 0 mod 0 is undefined. If [b(k-2),b(k-1),b(k)] has appeared before, the sequence has entered a cycle.
a(n)=3 unless n==2 (mod 3).
Can a(n)=0?
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
FORMULA
a(26-6*(-1)^k+132*k)=5. Conjecture: the only other n for which a(n)=5 are 14 and 32. - Robert Israel, Aug 21 2019
EXAMPLE
a(14)=5 because b(3)=(14*15*16) mod (14+15+16)=30, b(4)=(15*16*30) mod (15+16+30)=2, and b(5)=(16*30*2) mod (16+30+2)=0.
a(8)=-17 because (b(15),b(16),b(17))=(21,18,18)=(b(11),b(12),b(13)).
MAPLE
f:= proc(m) local a, b, c, t, n, s, S;
a:= m; b:= m+1; c:= m+2;
S:= {[m, m+1, m+2]};
for n from 3 to 10^6 do
t:= (a*b*c) mod (a+b+c);
if t = 0 then return n fi;
a:= b; b:= c; c:= t;
s:= [a, b, c];
if member(s, S) then return -n fi;
S:= S union {s};
od;
FAIL
end proc:
map(f, [$1..100]);
CROSSREFS
KEYWORD
sign
AUTHOR
J. M. Bergot and Robert Israel, Aug 20 2019
STATUS
approved