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.

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