A337212 Modulo 3 Pisano period of 'n-bonacci' series.
1, 8, 13, 26, 104, 728, 364, 80, 91, 8744, 3851, 3280, 59048, 4782968, 7174453, 3438578, 16139240, 5373368, 5235412, 1678822106, 86049704, 387420488, 47071589413, 140633637386, 2952400, 728, 757, 9526168288, 7312949144072, 49566102697280, 24477226494760
Offset: 1
Keywords
Examples
For n = 3, the remainders modulo 3 of the tribonacci series are 0, 1, 1, 2, 1, 1, 1, 0, 2, 0, 2, 1, 0, (these repeat indefinitely), so the Pisano period of the 'tribonacci' sequence is 13.
Crossrefs
Cf. A001175 (period of Fibonacci numbers mod n).
Programs
-
PARI
a(n) = {my(v=w=concat(0, vector(n-1, i, 1))); for(k=1, oo, v=concat(v[2..n], vecsum(v)%3); if(v==w, return(k))); } \\ Jinyuan Wang, Aug 20 2020
-
Python
def A337212(n): x, y, k, r, m = (3**n-3)//2, (3**n-3)//2, (n-1)%3, 3**(n-1), 0 while True: m += 1 a, b = divmod(x,3) x, k = a+k*r, (k+k-b)%3 if y == x: return m # Chai Wah Wu, Sep 14 2020
Formula
Conjecture: a(3^k-1)=a(3^k)-3^k-2=3^(2k)-1, a(3^k)=3^k(3^k+1)+1 for k>0. - Chai Wah Wu, Sep 15 2020
Extensions
a(20)-a(22) from Jinyuan Wang, Aug 20 2020
a(23) from Chai Wah Wu, Sep 14 2020
a(24)-a(28) from Chai Wah Wu, Sep 15 2020
a(29)-a(31) from Chai Wah Wu, Sep 21 2020
Comments