login
A336884
a(n) = A002144(n) - A336883(n) where A002144(n) is the n-th Pythagorean prime.
2
3, 8, 4, 17, 6, 32, 30, 50, 46, 55, 75, 10, 76, 98, 100, 105, 28, 93, 19, 112, 14, 107, 89, 177, 241, 82, 60, 228, 155, 25, 203, 148, 136, 311, 269, 115, 334, 20, 143, 392, 179, 67, 109, 413, 208, 235, 52, 118, 86, 553, 516, 476, 35, 194, 154, 504, 106, 58, 26, 566, 613, 353, 670, 722
OFFSET
1,1
COMMENTS
For more information see A336883.
LINKS
Hiroyuki Hara, Table of n, a(n) for n = 1..4783 [reformatted and restored by Georg Fischer, Oct 16 2020]
FORMULA
a(n) == (A002144(n) - 2)!/((A002144(n) - 1)/2)! == -((A002144(n) - 1)/2)! == -A336883(n) == A002144(n) - A336883(n) mod A002144(n).
EXAMPLE
p(1)=5: (5-2)!=2*3=A336883(1)*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==A336883(2)*a(2)==1 mod 13. 13=5+8.
a(n)=4: A336883(n)=(k*4+1)/(4-k)=(3*4+1)/(4-3)=13, k=3. p(n)=13+4=17.
a(n)=17: A336883(n)=(k*17+1)/(17-k)=(7*17+1)/(17-7)=12, k=7. p(n)=12+17=29.
MATHEMATICA
v = Select[Prime[Range[1000]], Mod[#, 4] == 1&];
v - Mod[((v-1)/2)!, v] (* Jean-François Alcover, Oct 24 2020, after PARI *)
PROG
(PARI) my(v=select(p->p%4==1, primes(100))); apply(x->x - (((x-1)/2)! % x), v) \\ Michel Marcus, Aug 07 2020
(Python) n_start=5
n_end=n_start+100000
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, n-r)
k = k + 1
# modified by Georg Fischer, Oct 16 2020
CROSSREFS
Cf. A336883, A002144 (Pythagorean primes), A206549, A209874, A256011, A186814, A282538.
Sequence in context: A127438 A303217 A106292 * A072247 A051359 A322470
KEYWORD
nonn
AUTHOR
Hiroyuki Hara, Aug 06 2020
STATUS
approved