# Fibonacci-Like Sequence With Mod

Neil Fernandez primeness at borve.demon.co.uk
Thu Jun 24 00:52:37 CEST 2004

```In message <014FDB37.73E59D8C.009AB482 at netscape.net>, Franklin T. Adams-
Watters <franktaw at netscape.net> writes

>Leroy Quet <qq-quet at mindspring.com> wrote:
>
>>Let a(0) = a(1) = 1;
>>
>>Let, for 2 <= m,
>>
>>a(m) = a(m-1) + a(m-2) (mod m),

<snip>

>I looked at sequences of this type several years ago.

<snip>

>My second choice would be to start with a(0) = 0 and a(1) = 1, which gives:
>
>0,1,1,2,3,0,3,3,6,0,6,6,0,6,6,12,2,14,16,11,7,18,3,21,0,21,21,15,8,23,1,
>24,25,16,7,23,30,16,8,24,32,15,5,20,25,0,25,25,2,27,29,5,34,39,19,3,22,25,
>47,13,0,13,13,26,39,0,39,39,10,49,59,37,24,61,11,72,7,2,9,11,20,31,51,82
>
>This sequence is in the OEIS, as A079777.  The other two are not.

I changed the base to m^2 to get the sequence defined by

a(0)= 0
a(1)= 1
for m>=2, a(m) = a(m-1) + a(m-2) (mod m^2)

which gives

1,2,3,5,8,13,21,34,55,89,0,89,89,178,11,189,200,28,228,256,0,256,256,
512,92,604,696,459,255,714,969,594,407,1001,112,1113,1225,817,442,1259,
1701,1111,876,1987,747,525,1272,1797,569,2366,231,2597,2828,2400,2092

The sequence b(m), listing values of m for which a(m)=0 runs

12,22

Is this sequence finite? If b(3) exists, it is greater than 1 million.

Mathematica script:
a = 0; b = 1; i = 2; Do[c = Mod[a + b, i^2]; If[c == 0, Print[i]];
a = b; b = c; i++, {1000000}]

Neil

--
Neil Fernandez

```