%I #20 Jul 21 2024 03:46:08
%S 0,1,2,1,2,5,1,1,8,9,10,5,5,1,11,1,16,17,18,1,8,21,1,1,7,25,26,1,12,
%T 11,1,1,32,33,29,17,31,37,14,1,1,29,42,21,26,1,1,1,1,49,16,1,30,53,21,
%U 1,56,57,58,41,50,1,8,1,8,65,66,33,47,29,1,1,72,73
%N a(n) = A000129(A214028(n)+1) mod n.
%C A214028(n) is the smallest k > 0 such that n divides A000129(k).
%C Let M = [{2, 1}, {1, 0}], I = [{1, 0}, {0, 1}] is the 2 X 2 identity matrix, then A214028(n) is the smallest k > 0 such that M^k == r*I (mod n) for some r such that 0 <= r < n, and a(n) gives the value r.
%C A214027(n) is the multiplicative order of a(n) modulo n, which can only take value 1, 2 or 4.
%H Amiram Eldar, <a href="/A308947/b308947.txt">Table of n, a(n) for n = 1..10000</a>
%F Also a(n) = A000129(A214028(n)-1) mod n.
%F a(2^e) = 1; a(p^e) = a(p)^(p^(e-1)) mod p^e for odd primes p.
%F For odd primes p, a(p^e) = 1 if and only if A214028(p) == 2 (mod 4); a(p^e) = p^e - 1 if and only if 4 divides A214028(p).
%e For n = 7, {A000129(n) mod 7 : n > 0} = {1, 2, 5, 5, 1, 0, 1, ...}, so a(7) = 1. Also, A214028(7) = 6, and M^6 mod 7 = [{1, 0}, {0, 1}], so a(7) = 1.
%t a[n_] := For[k = 1, True, k++, If[Divisible[Fibonacci[k, 2], n], Return[ Mod[ Fibonacci[k+1, 2], n]]]];
%t Array[a, 100] (* _Jean-François Alcover_, Jul 05 2019 *)
%o (PARI) a(n) = my(M=[2, 1; 1, 0]); for(k=1, 4*n/3, if((Mod(M,n)^k)[2,1]==0, return(lift((Mod(M,n)^k)[1,1]))))
%Y Cf. A000129, A214027, A214028.
%Y Similar sequences: A217036, A308948.
%K nonn
%O 1,3
%A _Jianing Song_, Jul 02 2019