A256567 Primes p with the property that there are three consecutive integers (x,x+1,x+2) with 1 < x <= p-3 whose product is 1 modulo p.
7, 11, 17, 19, 23, 37, 43, 53, 59, 61, 67, 79, 83, 89, 97, 101, 103, 107, 109, 113, 137, 149, 157, 167, 173, 181, 191, 199, 211, 223, 227, 229, 241, 251, 263, 271, 281, 283, 293, 307, 313, 317, 337, 347, 359, 367, 373, 379, 383, 389, 401, 419, 421, 431, 433, 449
Offset: 1
Keywords
Examples
For p=7: 4*5*6=120==1 (mod 7), so 7 is a term. For p=11: 5*6*7=210==1 (mod 11), so 11 is a term. For p=17: 4*5*6=120==1 (mod 17), so 17 is a term. 13 is not a term because there is no such triple with product == 1 (mod 13).
Links
- Marian Kraus, Table of n, a(n) for n = 1..6390
Programs
-
PARI
isok(p) = {if (isprime(p), for (x=1, p-3, if (Mod(x*(x+1)*(x+2), p) == 1, return (1));););} \\ Michel Marcus, Oct 05 2021
-
R
library(numbers) IP <- vector() t <- vector() S <- vector() IP <- c(Primes(1000)) # Build a vector of all primes < 1000. for (j in 1:(length(IP))){ for (i in 3:(IP[j]-2)) t[i-1] <- as.vector(mod(((i-1)*i*(i+1)),IP[j])) S[j] <- length(which(t==1)) } IP[S!=0] #The loop checks for every triple for every prime, what it is modulo that prime. "IP[S!=0]" lists the primes that have at least one triple. For all p<10000 it takes a few minutes. For all p<100000 a few hours.
Comments