A271953 a(n) is the period of A000930 modulo n.
1, 7, 8, 14, 31, 56, 57, 28, 24, 217, 60, 56, 168, 399, 248, 56, 288, 168, 381, 434, 456, 420, 528, 56, 155, 168, 72, 798, 840, 1736, 930, 112, 120, 2016, 1767, 168, 342, 2667, 168, 868, 1723, 3192, 1848, 420, 744, 3696, 46, 56, 399, 1085, 288, 168, 468, 504, 1860, 1596, 3048, 840, 3541, 1736, 1240, 6510
Offset: 1
Keywords
Links
- Joerg Arndt, Table of n, a(n) for n = 1..1000
- 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
minlen = 100; maxlen = 2*10^4; per[lst_] := FindTransientRepeat[lst, 2] // Last // Length; a[n_] := Module[{p0=0, len=minlen}, While[p0 = Mod[LinearRecurrence[{1, 0, 1}, {1, 1, 1}, len], n] // per; p0<=1 && len<=maxlen, len = 2 len]; p0]; Table[an = a[n]; Print["a(", n, ") = ", an]; an, {n, 1, 100}] (* Jean-François Alcover, Jul 21 2018 *)
-
PARI
per(n, S, R) = { \\ S[]: leading terms, R[]: recurrence if ( n==1, return( 1 ) ); my ( r = #R ); if ( r != #S , error("Mismatch in length of S[] and R[]") ); S = vector(#S, j, Mod(S[j], n) ); R = vector(#S, j, Mod(R[j], n) ); my( T = S ); my( j = 0 ); until ( 0, \\ forever j += 1; my( t = sum(i=1, r, R[i] * T[r+1-i] ) ); \\ next term for (k=1, r-1, T[k] = T[k+1] ); T[r] = t; if ( T == S , return(j) ); ); } \\vector(66, n, per(n, [0,1], [1,1]) ) \\ A001175 \\vector(66, n, per(prime(n), [0,1], [1,1]) ) \\ A060305 vector(66, n, per(n, [0,0,1], [1,0,1]) ) \\ A271953 \\vector(66, n, per(prime(n), [0,0,1], [1,0,1]) ) \\ A271901 \\vector(66, n, per(n, [0,0,1], [0,1,1]) ) \\ A104217 /* Joerg Arndt, Apr 17 2016 */
Formula
Let the prime factorization of n be p1^e1*...*pk^ek. Then a(n) = lcm(a(p1^e1), ..., a(pk^ek)) [Engstrom]. - N. J. A. Sloane, Feb 18 2017