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”).

A336883
a(n) = ((A002144(n) - 1)/2)! (mod A002144(n)) where A002144(n) is the n-th Pythagorean prime.
2
2, 5, 13, 12, 31, 9, 23, 11, 27, 34, 22, 91, 33, 15, 37, 44, 129, 80, 162, 81, 183, 122, 144, 64, 16, 187, 217, 53, 138, 288, 114, 189, 213, 42, 104, 274, 63, 381, 266, 29, 254, 382, 348, 48, 301, 286, 489, 439, 483, 24, 77, 125, 578, 423, 487, 149, 555, 615, 651, 135, 96, 380, 87, 39, 707
OFFSET
1,1
COMMENTS
Let p(n) = A002144(n) be the n-th Pythagorean prime.
Pythagorean prime p can be divided into a pair of integers (a,b) such as p =a+b and a*b==1 mod p. And (p-2)!==1 mod p because of Wilson's Theorem (p-1)!==-1 mod p. It can be divided into two parts (a,b) such as {2*3*4*...*((p(n)-1)/2)==a(n) mod p(n)} and {((p(n)-1)/2+1)*...*(p(n)-4)*(p(n)-3)*(p(n)-2)==-a(n)==(p(n)-a(n)) mod p(n)}. The pair numbers make a(n)+(p(n)-a(n))=p(n) and a(n)*(p(n)-a(n))==1 mod p(n). The left integer of the pair numbers is a(n). The right integer (p(n)-a(n)) is A336884(n).
The set of selecting odd numbers from {a(n)} and A336884 is A206549. The set of selecting even numbers from {a(n)} and A336884 is A209874 except for the number 1. A256011 never appears in {a(n)} or A336884. It is related to nonexistence of numbers that the largest prime factor of n^2+1 is greater than n.
The odd number of the difference |a(n)-A336884(n)|=|a(n)-(p(n)-a(n))|=|2*a(n)-p(n)| is A186814(n). A282538 never appears in the set of the difference |a(n)-A336884(n)|.
If p(n) is unknown, p(n) can be derived from a(n) using following equation. From a*b==1 mod p, a*b=k*p+1. With p=a+b, it can transform to b(n)=(k*a(n)+1)/(a(n)-k), k is an odd integer parameter when the fraction makes an integer. If there are many k's, select the minimum k in those. Then a(n)+b(n)=p(n). b(n) is A336884(n).
LINKS
Hiroyuki Hara, Table of n, a(n) for n = 1..4783 [reformatted and restored by Georg Fischer, Oct 15 2020]
EXAMPLE
p(1)=5: (5-2)!=2*3=a(1)*(5-a(1))==1 mod 5. 5=2+3.
p(2)=13: (13-2)!=(2*3*4*5*6)*(7*8*9*10*11)=(2*3*4*5*6)*((p-6)*(p-5)*(p-4)*(p-3)*(p-2))==5*(-5)==5*(13-5)=5*8==a(2)*(13-a(2))==1 mod 13. 13=5+8.
a(n)=13: b(n)=(k*13+1)/(13-k)=(3*13+1)/(13-3)=4, k=3. p(n)=13+4=17.
a(n)=12: b(n)=(k*12+1)/(12-k)=(7*12+1)/(12-7)=17, k=7. p(n)=12+17=29.
MATHEMATICA
Map[Mod[((# - 1)/2)!, #] &, Select[4 Range[192] + 1, PrimeQ]] (* Michael De Vlieger, Oct 15 2020 *)
PROG
(PARI) my(v=select(p->p%4==1, primes(100))); apply(x->(((x-1)/2)! % x), v) \\ Michel Marcus, Aug 07 2020
(Python) n_start=5
n_end=n_start+10000
k = 1
for n in range(n_start, n_end, 4):
c=(n-1)//2
r=1
for i in range(2, c+1):
r=r*i % n
if r==0:
break
if (n-r)*r % n ==1:
print(k, r)
k = k + 1
# modified by Georg Fischer, Oct 16 2020
CROSSREFS
Cf. A336884, A002144 (Pythagorean primes), A206549, A209874, A256011, A186814, A282538.
Sequence in context: A173620 A319920 A166134 * A067365 A189993 A112838
KEYWORD
nonn
AUTHOR
Hiroyuki Hara, Aug 06 2020
STATUS
approved