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-4 of 4 results.

A071710 Highly Wilsonian primes: smallest primes p such that w(p)=n where w(n) denote the number of nonnegative integers k such that k! = +1 or -1 (mod n).

Original entry on oeis.org

2, 3, 5, 7, 17, 67, 137, 23, 61, 71, 401, 1907, 661, 12227, 29873, 96731, 99721, 154243, 480209, 3408707, 1738901, 27341387
Offset: 2

Views

Author

Benoit Cloitre, Jun 03 2002

Keywords

Comments

Obviously w(n) is at least 2 because 0! = 1! = +1 (mod n) for every n. Also, if p is a prime, then w(p) is at least 4 because (p-2)! = +1 and (p-1)! = -1 (mod p) by Wilson's Theorem.
The smallest prime(k) such that A238444(k) = n-2. - Vladimir Shevelev, Feb 28 2014
The sequence w(n) is 1, 2, 3, 2, 4, 2, 5, 2, 2, 2, 5, 2, 4,... (offset 1) = 1 +A049046(n) +A238532(n) for n>2. - R. J. Mathar, Apr 02 2014

Programs

  • Mathematica
    w[n_] := Block[{c = k = m = 1}, While[k < n, m = Mod[m *= k, n]; If[m == 1 || m + 1 == n, c++ ]; k++ ]; c]
  • PARI
    wilsonian(p)={ local(s,t,pMinusOne); pMinusOne=p-1; s=4; t=24; for(k=5,p-3, t=(t*k)%p; if(t==1 || t==pMinusOne, s=s+1) ); s } \\ Charles R Greathouse IV, Jan 24 2007

Extensions

2 more terms from Charles R Greathouse IV, Jan 24 2007
a(23) from Igor Naverniouk (igor(AT)cs.utoronto.ca), May 09 2007

A049044 Least k > 0 such that A049045(n) | A003422(k-1).

Original entry on oeis.org

1, 2, 3, 4, 6, 4, 6, 6, 5, 7, 6, 7, 12, 5, 22, 7, 16, 7, 55, 12, 54, 42, 22, 6, 16, 24, 25, 86, 55, 97, 133, 54, 42, 6, 64, 94, 72, 58, 24, 49, 69, 19, 25, 78, 86, 14, 208, 167, 138, 80, 97, 59, 133, 63, 142, 41, 110, 64, 22, 94, 286, 72, 39, 58, 84, 215, 80, 14, 49, 305, 69
Offset: 1

Views

Author

Keywords

Crossrefs

A238532 Number of distinct factorial numbers congruent to -1 (mod n).

Original entry on oeis.org

0, 1, 1, 0, 1, 0, 2, 0, 0, 0, 2, 0, 1, 0, 0, 0, 1, 0, 2, 0, 0, 0, 3, 0, 1, 0, 0, 0, 2, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 2, 0, 0, 0, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 4, 0, 4, 0, 0, 0, 0, 0, 3, 0, 0, 0, 7, 0, 1, 0, 0, 0, 0, 0, 4, 0, 0, 0, 4, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 3, 0, 0, 0, 1, 0, 2, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0
Offset: 1

Views

Author

R. J. Mathar, Apr 02 2014

Keywords

Comments

Number of solutions to k! == -1 (mod n), k>=1.
Counts the frequency of the value n-1 in the n-th row of triangle A062169.
Values 1..9 occur for the first time at n = 2, 7, 23, 59, 227, 401, 71, 3643, 62939, which are all prime numbers (see also A230315). Sequence A256519 gives composite k for which a(k) > 0. - Antti Karttunen, May 24 2021

Examples

			There are two 6's in the 7th row of A062169. Therefore a(7)=2.
		

Crossrefs

Programs

  • Maple
    A238532 := proc(n)
        local a,k ;
        a := 0 ;
        for k from 1 to n-1 do
            if modp(k!,n) = modp(-1,n) then
                a := a+1 ;
            end if;
        end do:
        a ;
    end proc: # R. J. Mathar, Apr 02 2014
  • PARI
    A238532(n) = { my(m=1,s=0); for(k=1,oo,m *= k; if(!(m%n),return(s), if(1+(m%n)==n, s++))); }; \\ Antti Karttunen, May 24 2021
    
  • PARI
    A238532(n) = { my(m=Mod(1,n),s=0,x); for(k=1,oo, m *= Mod(k,n); x = lift(m); if(!x,return(s), if(x==(n-1), s++))); }; \\ (Much faster than above program) - Antti Karttunen, May 24 2021

A049050 Least p with exactly n distinct factorial numbers == 1 (mod p).

Original entry on oeis.org

2, 5, 29, 17, 23, 199, 619, 3313, 4093, 3011, 355799, 52163, 12087071, 3408707, 26927543
Offset: 1

Views

Author

Keywords

Crossrefs

Extensions

a(13)-a(15) from Giovanni Resta, Jun 28 2019
Showing 1-4 of 4 results.