A271901 Length of period of Narayana sequence A000930 modulo n-th prime.
7, 8, 31, 57, 60, 168, 288, 381, 528, 840, 930, 342, 1723, 1848, 46, 468, 3541, 1240, 33, 5113, 2664, 6240, 3444, 7920, 3169, 10303, 10713, 11557, 11991, 991, 2016, 130, 6256, 1610, 148, 22800, 24807, 26733, 4648, 172, 10680, 32760, 36673, 37443, 2156, 3960, 481, 12432, 226, 26220, 54523, 8160, 9680, 63000
Offset: 1
Links
- Chai Wah Wu, Table of n, a(n) for n = 1..10000
- H. T. Engstrom, On sequences defined by linear recurrence relations Trans. Am. Math. Soc. 33 (1) (1931) 210-218.
- K. Kirthi, Narayana Sequences for Cryptographic Applications, arXiv preprint arXiv:1509.05745 [math.NT], 2015.
- M. B. Nathanson, Linear recurrences and uniform distribution, Proc. Amer. Math. Soc. 48 (1975), 289-291.
- D. D. Wall, Fibonacci series modulo m, Amer. Math. Monthly, 67 (1960), 525-532.
Programs
-
Mathematica
a[n_] := Module[{p = Prime[n], a = 1, b = 1, c = 2, k = 1}, While[a != 1 || b != 1 || c != 1, {a, b, c} = {b, c, Mod[a + c, p]}; k++]; k]; Array[a, 100] (* Jean-François Alcover, Jul 22 2018, after Charles R Greathouse IV *)
-
PARI
a(n,p=prime(n))=my(a=1,b=1,c=2,k=1); while(a!=1 || b!=1 || c!=1, [a,b,c]=[b,c,(a+c)%p]; k++); k \\ Charles R Greathouse IV, Feb 26 2017
-
Python
from sympy import prime def A271901(n): p = prime(n) i, a, b, c = 1, 1, 1, 2 % p while a != 1 or b != 1 or c != 1: i += 1 a, b, c = b, c, (a+c) % p return i # Chai Wah Wu, Feb 26 2017
Formula
a(n) = A271953(prime(n)). - Joerg Arndt, Apr 17 2016
Extensions
a(1) corrected by Altug Alkan, Apr 17 2016
Terms a(24) and beyond from Joerg Arndt, Apr 17 2016