OFFSET
1,9
COMMENTS
Is 23 the only prime with two triples?
LINKS
Marian Kraus, Table of n, a(n) for n = 1..9592
FORMULA
|T| where T={x|x*(x+1)*(x+2)==1 (mod p), p is prime, 1<x<=p-3}.
EXAMPLE
For p=7: 4*5*6==1 (mod 7); T={4}, |T|=1.
For p=23: 2*3*4==1 (mod 23) and 9*10*11==1 (mod 23); T={2,9}, |T|=2.
For p=59: 3*4*5==1 (mod 59), 12*13*14==1 (mod 59), and 41*42*43==1 (mod 59); T={3,12,41}, |T|=3.
PROG
(R)
library(numbers); IP <- vector(); t <- vector(); S <- vector(); IP <- c(Primes(1000)); LIP <- length(IP); for (j in 1:LIP){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))}; S
#Needs a lot of memory. For Primes(100000), this takes a few hours.
(PARI) a(n) = {my(p = prime(n)); sum(x=2, p-3, (x*(x+1)*(x+2)) % p == 1); } \\ Michel Marcus, Apr 03 2015
CROSSREFS
KEYWORD
nonn
AUTHOR
Marian Kraus, Apr 02 2015
STATUS
approved