login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
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. 0
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 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,4
LINKS
EXAMPLE
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.
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 *)
PROG
(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<j, prod(i:j), 0)
#loop: checks, if entry is congruent 1
#counts the "1"s in the matrix for each prime
for (i in 1:n)
NumTup[i] <- sum(mod(Piprod[, 1:(p[i]-1)], p[i])==1)
NumTup #vector of the counts of each prime
CROSSREFS
Sequence in context: A156816 A021383 A296456 * A256965 A191708 A368038
KEYWORD
nonn
AUTHOR
Marian Kraus, Apr 03 2015
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 23 20:33 EDT 2024. Contains 371916 sequences. (Running on oeis4.)