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.

Showing 1-3 of 3 results.

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.

Original entry on oeis.org

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

Views

Author

Marian Kraus, Apr 02 2015

Keywords

Comments

There may be one or more such triples, but 23 is the only prime up to 100000 having precisely two such triples. For the number of triples for each prime, see A256572.
Together with 5, supersequence of A191065. - Arkadiusz Wesolowski, Nov 24 2021

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).
		

Crossrefs

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.
    

A254678 Primes p with the property that there are four consecutive integers less than p whose product is 1 mod p.

Original entry on oeis.org

7, 17, 23, 31, 41, 47, 73, 89, 97, 103, 127, 137, 151, 167, 199, 223, 233, 239, 241, 257, 271, 281, 311, 313, 353, 359, 367, 383, 409, 431, 433, 439, 449, 479, 487, 503, 521, 577, 593, 601, 607, 647, 673, 719, 727, 743, 751, 761, 769, 839, 857, 881, 887, 911, 929, 937, 953, 967, 977, 983
Offset: 1

Views

Author

Marian Kraus, Apr 02 2015

Keywords

Examples

			p=7: 2*3*4*5=120 == 1 mod 7;
p=17: 2*3*4*5=120 == 1 mod 17 AND 12*13*14*15=32760 == 1 mod 17; for p=13: no triple == 1 mod 13;
p=23: 5*6*7*8 == 1 mod 23 AND 15*16*17*18== 1 mod 23 AND 19*20*21*22 == 1 mod 23; and so on. For the number of quadruples for a prime, see A256580.
		

Crossrefs

Programs

  • Mathematica
    fsiQ[n_]:=AnyTrue[Times@@@Partition[Range[n-1],4,1],Mod[#,n]==1&]; Select[ Prime[Range[200]],fsiQ] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Jul 02 2019 *)
  • PARI
    lista(nn) = forprime(p=2, nn, if (sum(x=1, p-4, ((x*(x+1)*(x+2)*(x+3)) % p) == 1) > 0, print1(p, ", "))); \\ Michel Marcus, Apr 03 2015
  • R
    library(numbers)
    IP <- vector()
    t <- vector()
    S <- vector()
    IP <- c(Primes(1000))
    for (j in 1:(length(IP))){
       for (i in 2:(IP[j]-4)){
           t[i-1] <- as.vector(mod((i*(i+1)*(i+2)*(i+3)),IP[j]))
           Z[j] <- sum(which(t==1))
           S[j] <- length(which(t==1))
       }
    }
    IP[S!=0]
    #Carefully increase Primes(1000). It takes several hours for 100000.
    

Formula

x*(x+1)*(x+2)*(x+3) == 1 mod p, p is prime, 1 <= x <= p-4.

A256592 Let p = prime(n); a(n) = number of pairs (x,i) with i >= 2 and 2 <= x <= p-i such that x*(x+1)*(x+2)*...*(x+i-1) == 1 mod p.

Original entry on oeis.org

0, 0, 1, 2, 6, 3, 8, 7, 13, 15, 13, 11, 13, 22, 18, 25, 36, 31, 34, 53, 42, 38, 38, 40, 55, 47, 41, 37, 77, 59, 62, 67, 66, 63, 55, 84, 74, 78, 90, 74, 90, 92, 85, 108, 100, 117, 98, 104, 136, 114, 118, 118, 141, 112, 118, 115, 122, 138, 132, 129, 115, 152
Offset: 1

Views

Author

Marian Kraus, Apr 03 2015

Keywords

Examples

			prime(1)=2: There is no such product
=> a(1)=0;
prime(2)=3: There is no such product
=> a(2)=0;
prime(3)=5: 2*3=6==1 mod 5
=> i=1, x=2; a(3)=1;
prime(4)=7: 4*5*6==1 mod 7; 2*3*4*5==1 mod 7
=> a(3)=2;
prime(5)=11: 3*4==1 mod 11; 7*8==1 mod 11; 5*6*7==1 mod 11; 3*4*5*6*7==1 mod 11; 6*7*8*9*10==1 mod 11; 2*3*4*5*6*7*8*9==1 mod 11
=> x in {3,7,5,3,6,2}
=> a(5)=6.
		

Crossrefs

Programs

  • Mathematica
    f[n_] := Block[{r = Range[2, Prime[n] - 1]}, Sum[Length@ Select[Times @@@ Partition[r, k, 1], Mod[#, Prime@ n] == 1 &], {k, 2, Prime@ n}]]; Array[f, 72] (* Michael De Vlieger, Apr 03 2015 *)
  • R
    library(numbers)
    p <- vector()
    n <- vector()
    NumTup <- vector()
    p <- Primes(m)
    n <- length(p)
    m <- 17 #all primes will be checked up to this number
    Piprod <- matrix(0,m,m) #Matrix with zeros
    #loop: every ordered combination of products
    for (i in 2:m)
    for (j in 2:m)
      Piprod[j,i] <- ifelse(i
    				
Showing 1-3 of 3 results.