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-2 of 2 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}]

A255010 a(n) = A099795(n)^-1 mod prime(n).

Original entry on oeis.org

1, 2, 3, 2, 1, 10, 7, 15, 20, 1, 14, 19, 11, 23, 6, 11, 45, 42, 37, 34, 10, 29, 76, 77, 14, 71, 12, 88, 40, 22, 30, 75, 115, 59, 110, 14, 113, 154, 13, 154, 142, 40, 50, 25, 71, 16, 11, 18, 91, 174, 138, 35, 115, 38, 27, 195, 206, 113, 75, 119, 181, 111, 203
Offset: 1

Views

Author

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

Keywords

Comments

By the definition, a(n)*A099795(n) == 1 (mod prime(n)).
a(n) is 1 with the primes 2, 11, 29, 787, 15773 (see A178629).

Crossrefs

Programs

  • Magma
    [Modinv(Lcm([1..p-1]),p): p in PrimesUpTo(400)];
    
  • Maple
    with(numtheory): P:=proc(q)  local a, n;  a:=[];
    for n from 1 to q do a:=[op(a),n]; if isprime(n+1) then print(lcm(op(a))^(-1) mod (n+1)); fi;
    od; end: P(10^3); # Paolo P. Lava, Feb 16 2015
  • Mathematica
    r[k_] := LCM @@ Range[k]; t[k_] := PowerMod[r[k - 1], -1, k]; Table[t[Prime[n]], {n, 1, 70}]
  • PARI
    a(n) = lift(1/Mod(lcm(vector(prime(n)-1, k, k)), prime(n))); \\ Michel Marcus, Feb 13 2015
  • Sage
    [inverse_mod(lcm([1..p-1]),p) for p in primes(400)]
    

Formula

a(n) = A254939(n)/A099795(n).
Showing 1-2 of 2 results.