OFFSET
1,1
COMMENTS
P(p, 7) == 7 (mod p) for all primes p. This is a special case of Schur congruences (see A330203 for references). This sequence consists of the composite numbers for which the congruence holds.
EXAMPLE
6 is in the sequence since it is composite and P(6, 7) = 1651609 == 7 (mod 6).
MATHEMATICA
Select[Range[2000], CompositeQ[#] && Divisible[LegendreP[#, 7] - 7, #] &]
PROG
(PARI) isok(k) = Mod(subst(pollegendre(k), x, 7), k) == 7;
forcomposite (k=1, 10000, if (isok(k), print1(k, ", "))); \\ Michel Marcus, Dec 06 2019
(Sage)
a, b = 1, 7
for n in range(2, 10000):
a, b = b, ((14*n-7)*b - (n-1)*a)//n
if (b%n == 7%n) and (not Integer(n).is_prime()): print(n) # Robin Visser, Aug 18 2023
CROSSREFS
KEYWORD
nonn,more
AUTHOR
Amiram Eldar, Dec 05 2019
EXTENSIONS
a(35)-a(36) from Robin Visser, Aug 18 2023
STATUS
approved