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.

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.

This page as a plain text file.
%I A256592 #8 Apr 04 2015 09:10:15
%S A256592 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,
%T A256592 47,41,37,77,59,62,67,66,63,55,84,74,78,90,74,90,92,85,108,100,117,98,
%U A256592 104,136,114,118,118,141,112,118,115,122,138,132,129,115,152
%N 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.
%e A256592 prime(1)=2: There is no such product
%e A256592 => a(1)=0;
%e A256592 prime(2)=3: There is no such product
%e A256592 => a(2)=0;
%e A256592 prime(3)=5: 2*3=6==1 mod 5
%e A256592 => i=1, x=2; a(3)=1;
%e A256592 prime(4)=7: 4*5*6==1 mod 7; 2*3*4*5==1 mod 7
%e A256592 => a(3)=2;
%e A256592 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
%e A256592 => x in {3,7,5,3,6,2}
%e A256592 => a(5)=6.
%t A256592 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 *)
%o A256592 (R)
%o A256592 library(numbers)
%o A256592 p <- vector()
%o A256592 n <- vector()
%o A256592 NumTup <- vector()
%o A256592 p <- Primes(m)
%o A256592 n <- length(p)
%o A256592 m <- 17 #all primes will be checked up to this number
%o A256592 Piprod <- matrix(0,m,m) #Matrix with zeros
%o A256592 #loop: every ordered combination of products
%o A256592 for (i in 2:m)
%o A256592 for (j in 2:m)
%o A256592   Piprod[j,i] <- ifelse(i<j,prod(i:j),0)
%o A256592 #loop: checks, if entry is congruent 1
%o A256592 #counts the "1"s in the matrix for each prime
%o A256592 for (i in 1:n)
%o A256592 NumTup[i] <- sum(mod(Piprod[,1:(p[i]-1)],p[i])==1)
%o A256592 NumTup #vector of the counts of each prime
%Y A256592 Cf. A256567, A256580.
%K A256592 nonn
%O A256592 1,4
%A A256592 _Marian Kraus_, Apr 03 2015