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

A254924 a(n) = (A060371(n) - A094998(n))/A056604(n) for n > 1, with a(1)=1.

Original entry on oeis.org

1, 0, 0, 1, 130, 1329, 1707670, 27502484, 209927657739, 130904517147542068, 3673771932850374193, 69623451054783204822486486, 3724616892817543661693877073170, 149157913707716515940392007441860, 12429106799179771738076359013310638297
Offset: 1

Views

Author

Bruno Berselli, Feb 12 2015 - proposed by Umberto Cerruti (Department of Mathematics "Giuseppe Peano", University of Turin, Italy)

Keywords

Comments

Let theta(p) be the smallest nonnegative solution z to the system of congruences z == 0 (mod p), z == 1 (mod v(p-1)), where p is a prime and v(p-1) = lcm(1,...,p-1). Theta(p) is unique mod lcm(p, v(p-1)), therefore it is unique mod v(p). Since both (p-1)!+1 and theta(p) are solutions to these congruences, ((p-1)!+1 - theta(p))/v(p) is always an integer. The sequence lists the values of this ratio (assuming theta(2)=0 and p=prime(n)).

Examples

			For n=5, a(5) = (A060371(5) - A094998(5))/A056604(5) = (3628801 - 25201)/27720 = 130.
		

Crossrefs

Programs

  • Magma
    [(Factorial(p-1)+1-Modinv(p,Lcm([1..p-1]))*p)/Lcm([1..p]): p in PrimesUpTo(50)];
  • Maple
    with(numtheory): P:=proc(q)  local a,j,k,ok,n;  print(1); a:=[1];
    for n from 3 to q do k:=0; a:=[op(a),n]; if isprime(n) then ok:=0;  while ok=0 do ok:=1;
    k:=k+1; for j from 2 to n-1 do if not (k*n mod j)=1 then ok:=0; break; fi; od; od;
    print((((n-1)!+1)-k*n)/lcm(op(a))); fi; od; end: P(100); # Paolo P. Lava, Feb 16 2015
  • Mathematica
    r[k_] := LCM @@ Range[k]; s[k_] := PowerMod[k, -1, r[k - 1]] k; w[k_] := ((k - 1)! + 1 - s[k])/r[k]; Table[w[Prime[n]], {n, 1, 20}]

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

Original entry on oeis.org

1, 1, 1, 103, 329891, 2834329, 1230752346353, 336967037143579, 48869596859895986087, 10513391193507374500051862069, 8556543864909388988268015483871, 10053873697024357228864849950022572972973, 19900372762143847179161250477954046201756097561, 32674560877973951128910293168477013254334511627907
Offset: 1

Views

Author

Mike Jones, Apr 29 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) and k = (p-1)!+1. If mChai Wah Wu, May 11 2025

Examples

			a(6) = 2834329 because ((13 - 1)! + 1)/w = (12! + 1)/w = (13^2*2834329)/w = 2834329, where w is the product of the towers of ((13 - 1)! + 1) subordinate to 13, w equaling 13^2.
		

Crossrefs

Programs

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

Extensions

More terms from Michel Marcus, Apr 30 2025

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

A049563 a(n) = ((prime(n)-1)! + 1) mod (prime(n) + 2).

Original entry on oeis.org

2, 3, 4, 1, 7, 1, 10, 1, 1, 16, 1, 1, 22, 1, 1, 1, 31, 1, 1, 37, 1, 1, 1, 1, 1, 52, 1, 55, 1, 1, 1, 1, 70, 1, 76, 1, 1, 1, 1, 1, 91, 1, 97, 1, 100, 1, 1, 1, 115, 1, 1, 121, 1, 1, 1, 1, 136, 1, 1, 142, 1, 1, 1, 157, 1, 1, 1, 1, 175, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 211, 1, 217, 1, 1, 1, 1, 1
Offset: 1

Views

Author

Keywords

Comments

Residue of (prime(n)-1)!+1 modulo prime(n)+2.

Examples

			a(3) = 4 since prime(3) = 5, and 4! + 1 = 25 gives residue 4 when divided by prime(3) + 2 = 7.
		

Crossrefs

Programs

  • Magma
    [(Factorial(p-1)+1) mod (p+2): p in PrimesUpTo(500)]; // Bruno Berselli, Apr 10 2015
    
  • Mathematica
    Table[Mod[(Prime[k] - 1)! + 1, Prime[k] + 2], {k, 1, 200}]
  • PARI
    a(n) = ((prime(n)-1)! + 1) % (prime(n) + 2); \\ Michel Marcus, May 28 2018
  • Sage
    [Mod(factorial(p-1)+1,p+2) for p in primes(500)] # Bruno Berselli, Apr 10 2015
    

Formula

a(n) = A060371(n) mod A052147(n). - Amiram Eldar, Mar 13 2025

A062411 a(n) = (-1)^(p-1)*(p-1)! + 1 where p = prime(n).

Original entry on oeis.org

0, 3, 25, 721, 3628801, 479001601, 20922789888001, 6402373705728001, 1124000727777607680001, 304888344611713860501504000001, 265252859812191058636308480000001
Offset: 1

Views

Author

Jason Earls, Jul 09 2001

Keywords

Comments

Apart from the first term, the same as A060371. - R. J. Mathar, Oct 02 2008

References

  • D. M. Burton, Elementary Number Theory, Allyn and Bacon, Inc. Boston, MA, 1976, p. 164.

Programs

  • PARI
    for(n=1,13,print((-1)^(prime(n)-1)*(prime(n)-1)!+1))
Showing 1-5 of 5 results.