cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A256572 Number of triples (x,x+1,x+2) with 1 < x <= p-3 of consecutive integers less than p whose product is 1 modulo p, where p = prime(n).

Original entry on oeis.org

0, 0, 0, 1, 1, 0, 1, 1, 2, 0, 0, 1, 0, 1, 0, 1, 3, 1, 1, 0, 0, 1, 1, 1, 1, 3, 1, 1, 1, 1, 0, 0, 1, 0, 1, 0, 1, 0, 3, 3, 0, 1, 1, 0, 0, 1, 3, 3, 1, 1, 0, 0, 1, 1, 0, 1, 0, 3, 0, 1, 1, 1, 3, 0, 1, 3, 0, 1, 3, 0, 0, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 0, 0, 3, 1, 0, 3, 1, 1, 0, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 1, 1, 0, 0, 3, 3, 0, 3, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 1, 0, 3, 1, 1, 3, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 3, 0, 3, 0, 1, 3, 1, 3, 0, 0, 0, 3, 1, 3, 0, 1, 1, 1, 0, 1, 1, 0, 1, 0, 1, 1, 1, 3, 3
Offset: 1

Views

Author

Marian Kraus, Apr 02 2015

Keywords

Comments

Is 23 the only prime with two triples?

Examples

			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.
		

Crossrefs

Cf. A256567.

Programs

  • PARI
    a(n) = {my(p = prime(n)); sum(x=2, p-3, (x*(x+1)*(x+2)) % p == 1);} \\ Michel Marcus, Apr 03 2015
  • 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.
    

Formula

|T| where T={x|x*(x+1)*(x+2)==1 (mod p), p is prime, 1