login
a(n) = L(1,p)-L(-1,p)-L(0,p) where p is the n-th odd prime and L(j,p) is the number of i with 0<=i<A001175(p) for which the Legendre symbol (A000045(i)/p)=j.
2

%I #28 Apr 30 2026 16:45:56

%S -2,-4,-2,0,-4,12,-2,-2,0,0,-4,8,-2,-2,-4,-2,-4,-2,0,28,-2,-2,20,-20,

%T -2,-2,-2,-4,4,-2,0,-20,4,-4,-2,-4,-2,-2,-4,-2,-2,0,44,-4,6,8,-2,-2,0,

%U 12,-2,-32,0,-68,-2,-4,0,-4,0,-2,-4,-2,0,44,-4,10,60,-2,0,52,-2,-2,-4,-2,-2,-4,-4,-4,4,-2,-4,0

%N a(n) = L(1,p)-L(-1,p)-L(0,p) where p is the n-th odd prime and L(j,p) is the number of i with 0<=i<A001175(p) for which the Legendre symbol (A000045(i)/p)=j.

%H Jason D. Andoyo, <a href="/A395295/b395295.txt">Table of n, a(n) for n = 1..9591</a>

%H Jason D. Andoyo, <a href="https://doi.org/10.62072/acm.2026.09011">(a,b)-Fibonacci-Legendre Cordial Graphs and k-Pisano-Legendre Primes</a>, Annals of Communications in Mathematics, 9(1), Article no. 11.

%o (Python)

%o from sympy import legendre_symbol, primerange

%o def kval(p,in1,in2):

%o L, a, b, in1, in2 = [], in1, in2, in1%p, in2%p

%o while True:

%o L.append(legendre_symbol(a, p))

%o a, b = b, (a + b)%p

%o if (a, b) == (in1, in2): break

%o return L.count(1) - L.count(-1) - L.count(0)

%o print([kval(p,0,1) for p in primerange(3,500)])

%o (PARI) fibmod(n, m) = ((Mod([1, 1; 1, 0], m))^n)[1, 2];

%o isok(k, n) = (fibmod(k,n) == 0) && (fibmod(k+1,n) == 1);

%o pp(n) = my(k=1); while(!isok(k, n), k++); k; \\ A001175

%o L(k,p) = sum(i=0, pp(p)-1, kronecker(fibonacci(i), p) == k);

%o a(n) = my(p=prime(n+1)); L(1,p)-L(-1,p)-L(0,p); \\ _Michel Marcus_, Apr 20 2026

%Y Cf. A394870, A000045, A001175, A000040, A065091.

%K sign

%O 1,1

%A _Jason D. Andoyo_, Apr 18 2026