login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A163210
Swinging Wilson quotients ((p-1)$ +(-1)^floor((p+2)/2))/p, p prime. Here '$' denotes the swinging factorial function (A056040).
7
1, 1, 1, 3, 23, 71, 757, 2559, 30671, 1383331, 5003791, 245273927, 3362110459, 12517624987, 175179377183, 9356953451851, 509614686432899, 1938763632210843, 107752663194272623
OFFSET
1,4
LINKS
M. E. Bassett, S. Majid, Finite noncommutative geometries related to F_p[x], arXiv:1603.00426 [math.QA], 2016.
Peter Luschny, Swinging Primes.
EXAMPLE
The 5th prime is 11, (11-1)$ = 252, the remainder term is (-1)^floor((11+2)/2)=1. So the quotient (252+1)/11 = 23 is the 5th member of the sequence.
MAPLE
swing := proc(n) option remember; if n = 0 then 1 elif irem(n, 2) = 1 then swing(n-1)*n else 4*swing(n-1)/n fi end:
WQ := proc(f, r, n) map(p->(f(p-1)+r(p))/p, select(isprime, [$1..n])) end:
A163210 := n -> WQ(swing, p->(-1)^iquo(p+2, 2), n);
MATHEMATICA
sf[n_] := n!/Quotient[n, 2]!^2; a[n_] := (p = Prime[n]; (sf[p - 1] + (-1)^Floor[(p + 2)/2])/p); Table[a[n], {n, 1, 19}] (* Jean-François Alcover, Jun 28 2013 *)
a[p_] := (Binomial[p-1, (p-1)/2] - (-1)^((p-1)/2)) / p
Join[{1, 1}, a[Prime[Range[3, 20]]]] (* Peter Luschny, May 13 2017 *)
PROG
(PARI) a(n, p=prime(n)) = ((p-1)!/((p-1)\2)!^2 - (-1)^(p\2))/p \\ David A. Corneth, May 13 2017
CROSSREFS
KEYWORD
nonn
AUTHOR
Peter Luschny, Jul 24 2009
STATUS
approved