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.

Previous Showing 21-30 of 36 results. Next

A283300 Primes p such that p^2 divides Bell(p) - 2.

Original entry on oeis.org

2, 5, 11, 109, 509, 4099, 2951209
Offset: 1

Views

Author

Amiram Eldar, Mar 04 2017

Keywords

Comments

A special case of Touchard's congruence is Bell(p) == 2 (mod p) for all primes p, where Bell(n) are the Bell numbers (A000110). These primes are for Touchard's congruence as Wieferich primes (A001220) are for Fermat's little theorem and Wilson primes (A007540) are for Wilson's theorem.

Examples

			For n=3, a(3)=11, Bell(11)=678570, Bell(11) - 2 = 11^2 * 61688.
		

References

  • J. Touchard, "Propriétés arithmétiques de certains nombres récurrents", Ann. Soc. Sci. Bruxelles A 53 (1933), pp. 21-31.

Crossrefs

Cf. A000110 (Bell numbers).

Programs

  • Mathematica
    Select[Prime[Range[1000]], Divisible[BellB[#]-2, #^2] &]

Extensions

a(7) from Hiroaki Yamanouchi, Aug 30 2018

A301316 a(n) = ((n-1)! + 1) mod n^2.

Original entry on oeis.org

0, 2, 3, 7, 0, 13, 35, 49, 64, 81, 11, 1, 0, 57, 1, 1, 85, 1, 38, 1, 1, 133, 184, 1, 1, 521, 1, 1, 522, 1, 589, 1, 1, 885, 1, 1, 259, 381, 1, 1, 656, 1, 559, 1, 1, 553, 282, 1, 1, 1, 1, 1, 1802, 1, 1, 1, 1, 2553, 1593, 1, 3416, 993, 1, 1, 1, 1, 804
Offset: 1

Views

Author

Stanislav Sykora, Mar 18 2018

Keywords

Comments

By definition, when n > 1, a(n) = 0 then n is a Wilson prime (A007540).
For a(n) to equal 1, (n-1)! must be divisible by n^2 which is the prevailing case for large n. For example, all n which are a product of more than two distinct primes belong to this category. So do all proper powers of primes except 2^2, 2^3, and 3^2. Obviously, when a(n) = 1, then also A055976(n) = 1.
The cases of a(n) > 1 include, for example, all primes other than Wilson's and all numbers of the form n=2*p, where p is a prime.

Examples

			From _Muniru A Asiru_, Mar 20 2018: (Start)
((1-1)! + 1) mod 1^2 = (0! +1) mod 1 = 2 mod 1 = 0.
((2-1)! + 1) mod 2^2 = (1! +1) mod 4 = 2 mod 4 = 2.
((3-1)! + 1) mod 3^2 = (2! +1) mod 9 = 3 mod 9 = 3.
((4-1)! + 1) mod 4^2 = (3! +1) mod 16 = 7 mod 16 = 7.
((5-1)! + 1) mod 5^2 = (4! +1) mod 25 = 25 mod 25 = 0.
... (End)
		

Crossrefs

Programs

  • GAP
    List([1..60],n->(Factorial(n-1)+1) mod n^2); # Muniru A Asiru, Mar 20 2018
  • Maple
    seq((factorial(n-1)+1) mod n^2,n=1..60); # Muniru A Asiru, Mar 20 2018
  • Mathematica
    Array[Mod[(# - 1)! + 1, #^2] &, 67] (* Michael De Vlieger, Apr 21 2018 *)
  • PARI
    a(n) = ((n-1)! + 1) % n^2; \\ Michel Marcus, Mar 18 2018
    

Formula

a(n) = ((n-1)! + 1) mod n^2. - Jon E. Schoenfield, Mar 18 2018
a(n) = A038507(n-1) mod A000290(n). - Michel Marcus, Mar 20 2018

A338558 Absolute value q such that tau(p) == q (mod p), where p = prime(n) and tau(i) = A000594(i).

Original entry on oeis.org

0, 0, 0, 0, 1, 5, 7, 7, 1, 5, 10, 6, 11, 12, 20, 24, 14, 12, 3, 19, 6, 37, 20, 33, 20, 27, 50, 34, 36, 29, 18, 64, 4, 2, 66, 32, 3, 64, 61, 51, 60, 84, 95, 83, 63, 97, 42, 28, 61, 67, 32, 10, 29, 73, 37, 92, 16, 120, 31, 107, 120, 141, 145, 39, 12, 74, 150
Offset: 1

Views

Author

Felix Fröhlich, Dec 21 2020

Keywords

Comments

These are essentially the values that can be used to define "near-misses" in a search of terms for A007659, similar to how "near-Wieferich primes", "near-Wilson primes" and "near-Wall-Sun-Sun primes" are defined in searches for Wieferich primes (A001220), Wilson primes (A007540) and Wall-Sun-Sun (Fibonacci-Wieferich) primes.

Crossrefs

A-values: A258367 (near-Wieferich), A250406 (near-Wilson), A244801 and A241014 (near-Wall-Sun-Sun), A260209 and A260210 (near-Wolstenholme).

Programs

  • Mathematica
    a[n_] := Module[{p = Prime[n]}, Min[Abs[Mod[RamanujanTau[p], {-p, p}]]]]; Array[a, 100] (* Amiram Eldar, Jan 10 2025 *)
  • PARI
    a(n) = my(p=prime(n)); abs(centerlift(Mod(ramanujantau(p), p)))

Formula

a(n) = 0 iff prime(n) is a term of A007659.

A377266 Primes p with the property that there exist nonnegative integers m,n such that m!*n! is congruent to either +1 or -1 mod p^2, with m + n = p - 1.

Original entry on oeis.org

2, 3, 5, 7, 11, 13, 17, 31, 47, 53, 59, 61, 71, 107, 137, 149, 173, 227, 251, 277, 313, 347, 349, 359, 367, 373, 409, 419, 443, 463, 467, 479, 491, 499, 521, 523, 541, 563, 577, 599, 607, 613, 617, 631, 643, 647, 677, 683, 739, 751, 757, 809, 811, 821, 823, 827, 829
Offset: 1

Views

Author

Richard Peterson, Oct 22 2024

Keywords

Comments

The generalization of Wilson's Theorem that x!*(p-1-x)! is either +1 or -1 mod p when p is prime is known. This is investigated here for cases of p such that there is an x with x!*(p-1-x)! congruent to either +1 or -1 mod p^2.

Examples

			0!*4! + 1 = 5^2 and 4+0 = 5-1, so 5 is in the sequence.
1!*9! - 1 = 11^2*2999 and 1+9 = 10-1, so 11 is in the sequence.
0!*12! + 1 = 13^2*2834329 and 0+12 = 13-1, so 13 is in the sequence.
10!*6! + 1 = 17^2*83*108923 and 10+6=17-1, so 17 is in the sequence.
19!*39!-1 is divisible by 59^2 and 19+39=59-1, so 59 is in the sequence.
		

Crossrefs

A007540 is a subsequence.

Programs

  • Maple
    filter:= proc(p) local m,n,A,v;
      A:= Array(0..p);
      A[0]:= 1:
      for n from 1 to p do A[n]:= n*A[n-1] mod p^2 od:
      for m from 0 to (p-1)/2 do
        v:= A[m] * A[p-1-m] mod p^2;
        if v = 1 or v = p^2-1 then return true fi;
      od;
      false
    end proc:
    select(filter, [seq(ithprime(i),i=1..150)]); # Robert Israel, Dec 30 2024
  • PARI
    isok(p)={if(isprime(p), for(m=0, p\2, my(t=(m!*(p-1-m)!%p^2)); if(t==1||t==p^2-1, return(1)))); 0} \\ Andrew Howroyd, Oct 22 2024

Extensions

a(14) onwards from Andrew Howroyd, Oct 22 2024

A383578 Let p = prime(n), then a(n) is the p-smooth part of (p-1)!+1.

Original entry on oeis.org

2, 3, 25, 7, 11, 169, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293
Offset: 1

Views

Author

Mike Jones, Apr 30 2025

Keywords

Comments

If x is an integer > 1 and p is a prime divisor of x, then a tower of x subordinate to p is an integer t such that there exists a prime divisor q of x such that q <= p, and t is the highest power of q that is a divisor of x.
If (p-1)!+1 = Product_{k} q_k^(e_k), then a(n) = Product_{k<=n} q_k^(e_k). - Sean A. Irvine, May 05 2025
Let p = prime(n). If m=p. Conjecture: a(n) = p^2 if n = 3, 6 or 103 and a(n) = p otherwise. - Chai Wah Wu, May 11 2025

Examples

			a(6) = 169 because the prime factorization of ((13 - 1)! + 1) is 13^2*2834329, and 13^2 = 169.
		

Crossrefs

Programs

  • PARI
    a(n) = my(p=prime(n), x=(p-1)! + 1, f=factor((p-1)! + 1, nextprime(p+1))); for (i=1, #f~, if (f[i, 1] <= p, f[1, 1] = 1)); x/factorback(f); \\ Michel Marcus, Apr 30 2025
    
  • Python
    from sympy import prime, factorial
    def A383578(n):
        p, c = prime(n), 1
        f = factorial(p-1)+1
        a, b = divmod(f,p)
        while not b:
            c *= p
            f = a
            a, b = divmod(f,p)
        return c # Chai Wah Wu, May 12 2025

Formula

a(n) = ((prime(n) - 1)! + 1) / A383257(n).

Extensions

More terms from Michel Marcus, Apr 30 2025

A134295 a(n) = Sum_{k=1..n} ((n-k)!*(k-1)! - (-1)^k).

Original entry on oeis.org

2, 2, 6, 16, 65, 312, 1813, 12288, 95617, 840960, 8254081, 89441280, 1060369921, 13649610240, 189550368001, 2824077312000, 44927447040001, 760034451456000, 13622700994560001, 257872110354432000, 5140559166898176001
Offset: 1

Views

Author

Alexander Adamchuk, Oct 17 2007

Keywords

Comments

According to the Generalized Wilson-Lagrange Theorem, a prime p divides (p-k)!*(k-1)! - (-1)^k for all integers k > 0. p divides a(p) for prime p. Quotients a(p)/p are listed in A134296(n) = {1, 2, 13, 259, 750371, 81566917, 2642791002353, 716984262871579, 102688143363690674087, ...}. p^2 divides a(p) for prime p = {7, 71}.

Crossrefs

Cf. A007540, A007619 (Wilson quotients: ((p-1)!+1)/p).
Cf. A134296 (quotients a(p)/p).

Programs

  • Mathematica
    Table[ Sum[ (n-k)!*(k-1)! - (-1)^k, {k,1,n} ], {n,1,30} ]

Formula

a(n) = Sum_{k=1..n} ((n-k)!*(k-1)! - (-1)^k).

A134296 Quotients A134295(p)/p = (1/p) * Sum_{k=1..p} ((p-k)!*(k-1)! - (-1)^k), where p = prime(n).

Original entry on oeis.org

1, 2, 13, 259, 750371, 81566917, 2642791002353, 716984262871579, 102688143363690674087, 21841112114495269555043222069, 17727866746681961093761724283871
Offset: 1

Views

Author

Alexander Adamchuk, Oct 17 2007

Keywords

Comments

A134295(n) = Sum_{k=1..n} ((n-k)!*(k-1)! - (-1)^k) = {2, 2, 6, 16, 65, 312, 1813, 12288, 95617, 840960, 8254081, ...}. According to the Generalized Wilson-Lagrange Theorem, a prime p divides (p-k)!*(k-1)! - (-1)^k for all integers k > 0. a(n) = A134295(p)/p for p = prime(n). a(n) is prime for n = {2, 3, 7, 9, 37, ...}. Corresponding prime terms in a(n) are {2, 13, 2642791002353, 102688143363690674087, ...}.

Crossrefs

Cf. A007540, A007619 (Wilson quotients: ((p-1)!+1)/p).
Cf. A134295 (Sum_{k=1..n} ((n-k)!*(k-1)! - (-1)^k)).

Programs

  • Mathematica
    Table[ (Sum[ (Prime[n]-k)!*(k-1)! - (-1)^k, {k,1,Prime[n]} ]) / Prime[n], {n,1,20} ]

Formula

a(n) = (1/p) * Sum_{k=1..p} ((p-k)!*(k-1)! - (-1)^k) where p = prime(n).

A259230 a(n) = smallest k such that (A115091(n)-k)! == -1 (mod A115091(n)^2).

Original entry on oeis.org

1, 6, 1, 24, 64, 1, 384
Offset: 1

Views

Author

Felix Fröhlich, Nov 08 2015

Keywords

Comments

The values of m in A115091.
A115091(n) is in A007540 iff a(n) = 1.

Examples

			a(2) = 6, because 6 is the smallest k such that (A115091(2)-k)! == -1 (mod A115091(2)^2), which yields the congruence (11-6)! == -1 (mod 11^2).
		

Crossrefs

Programs

  • Mathematica
    t = Select[Prime@ Range@ 120, AnyTrue[Range@ #, Function[m, Divisible[m! + 1, #^2]]] &]; Table[k = 1; While[Mod[(t[[n]] - k)!, t[[n]]^2] != t[[n]]^2 - 1, k++]; k, {n, 7}] (* Michael De Vlieger, Nov 10 2015, Version 10 *)
  • PARI
    forprime(p=1, , for(k=1, p-1, if(Mod((p-k)!, p^2)==-1, print1(k, ", "); break({1}))))

A275741 Sum of Wilson and Lerch remainders of n-th prime.

Original entry on oeis.org

1, 3, 10, 6, 6, 17, 15, 11, 25, 38, 9, 37, 47, 39, 86, 58, 107, 50, 101, 36, 98, 45, 123, 92, 170, 57, 80, 72, 158, 194, 194, 67, 78, 133, 120, 302, 144, 158, 128, 97, 91, 303, 76, 191, 139, 178, 302, 117, 242, 179, 335, 390, 362, 197, 290, 314, 327, 227, 429
Offset: 2

Views

Author

Felix Fröhlich, Aug 07 2016

Keywords

Comments

a(n) = 0 if and only if prime(n) is in both A007540 and A197632, i.e., prime(n) is simultaneously a Wilson prime and a Lerch prime.
For n > 2, a(n) = 0 if and only if A027641(3*p-3) / A027642(3*p-3)-1 + 1/p == 0 (mod p^2), where p = prime(n) (cf. Dobson, 2016, theorem 2).
René Gy (see links) has shown that a number is simultaneously a Lerch prime and a Wilson prime if and only if it satisfies the congruence (p - 1)! + 1 == 0 (mod p^3). - John Blythe Dobson, Feb 23 2018

Crossrefs

Programs

  • Mathematica
    a[n_] := Module[{p = Prime[n]}, Mod[((p-1)!+1)/p, p] + Mod[(Sum[(k^(p-1)-1)/p, {k, 1, p-1}] - ((p-1)!+1)/p)/p, p]];
    Table[a[n], {n, 2, 60}] (* Jean-François Alcover, Feb 15 2019 *)
  • PARI
    a002068(n) = my(p=prime(n)); ((p-1)!+1)/p % p
    a197631(n) = my(p=prime(n), m=p-1); sum(k=1, m, k^m, -p-m!)/p^2 % p
    a(n) = a002068(n) + a197631(n)

Formula

a(n) = A002068(n) + A197631(n).

A283149 Largest k such that (p-1)! == -1 (mod p^k), where p = prime(n).

Original entry on oeis.org

1, 1, 2, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1
Offset: 1

Views

Author

Felix Fröhlich, Mar 01 2017

Keywords

Comments

a(n) > 1 iff A002068(n) = 0, i.e., iff p is a Wilson prime (A007540).
Is a(n) < 3 for all n?

Crossrefs

Programs

  • Maple
    f:= proc(n) local p;
      p:= ithprime(n);
      padic:-ordp((p-1)!+1,p)
    end proc:
    map(f, [$1..200]); # Robert Israel, Apr 29 2021
  • Mathematica
    Table[With[{p = Prime@ n}, SelectFirst[Reverse@ Range@ 10, Mod[(p - 1)!, #] == # - 1 &[p^#] &]], {n, 105}] (* Michael De Vlieger, Aug 20 2017 *)
  • PARI
    a(n) = my(p=prime(n), k=1); while(Mod((p-1)!, p^k)==-1, k++); k-1

Extensions

More terms from Antti Karttunen, Aug 20 2017
Previous Showing 21-30 of 36 results. Next