cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A307087 a(n) is the number of steps it takes for the sequence f(0)=f(1)=n, f(x)=(a*b) mod (a+b+1), where a=f(x-1) and b=f(x-2), to reach a cycle.

This page as a plain text file.
%I A307087 #25 Aug 16 2019 16:21:30
%S A307087 0,0,4,3,0,6,6,1,13,3,2,8,3,3,5,3,0,23,3,4,11,3,0,9,11,5,9,3,10,13,13,
%T A307087 2,5,3,9,4,7,6,23,3,34,23,8,2,12,3,22,9,8,7,16,3,1,19,60,12,27,3,7,15,
%U A307087 22,4,25,3,30,12,10,11,22,3,6,12,3,8,19,3,10
%N A307087 a(n) is the number of steps it takes for the sequence f(0)=f(1)=n, f(x)=(a*b) mod (a+b+1), where a=f(x-1) and b=f(x-2), to reach a cycle.
%C A307087 Abmod sequences are defined as follows:
%C A307087 Abmod(x,y,0) = x,
%C A307087 Abmod(x,y,1) = y,
%C A307087 Abmod(x,y,k) = (a*b) mod (a+b+1), where a and b are the 2 previous terms (a = Abmod(x,y,k-1), b = Abmod(x,y,k-2)).
%C A307087 It seems that a(n)=3 if n=6k+3 for nonnegative integer k.
%C A307087 Conjecture: for every n, a(n) is finite (that is, the sequence ends up in a cycle).
%H A307087 Alex Costea, <a href="/A307087/b307087.txt">Table of n, a(n) for n = 0..10000</a>
%e A307087 For a(8), the sequence f is 8, 8, 13, 16, 28, 43, 52, 28, 79, 52, 16, 4, 1, and then 4, 4, 7 repeated, thus a(8) is 13.
%t A307087 cyclePos[s_] := Module[{sp = SequencePosition[s[[1 ;; -3]], s[[-2 ;; -1]]]}, If[Length[sp] == 0, 0, sp[[1, 1]]]]; a[n_] := Module[{f, g}, g[a_, b_] := Mod[a*b, a + b + 1]; f[0] = f[1] = n; f[k_] := f[k] = g[f[k - 1], f[k - 2]]; s = {}; m = 0; While[Length[s] < 4 || cyclePos[s] == 0, AppendTo[s, f[m]]; m++]; cyclePos[s] - 1]; Array[a, 100, 0] (* _Amiram Eldar_, Jul 06 2019 *)
%K A307087 nonn
%O A307087 0,3
%A A307087 _Alex Costea_, Mar 23 2019