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.

User: Hiroyuki Hara

Hiroyuki Hara's wiki page.

Hiroyuki Hara has authored 2 sequences.

A336884 a(n) = A002144(n) - A336883(n) where A002144(n) is the n-th Pythagorean prime.

Original entry on oeis.org

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

Author

Hiroyuki Hara, Aug 06 2020

Keywords

Comments

For more information see A336883.

Examples

			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.
		

Crossrefs

Cf. A336883, A002144 (Pythagorean primes), A206549, A209874, A256011, A186814, A282538.

Programs

  • Mathematica
    v = Select[Prime[Range[1000]], Mod[#, 4] == 1&];
    v - Mod[((v-1)/2)!, v] (* Jean-François Alcover, Oct 24 2020, after PARI *)
  • 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

Formula

a(n) == (A002144(n) - 2)!/((A002144(n) - 1)/2)! == -((A002144(n) - 1)/2)! == -A336883(n) == A002144(n) - A336883(n) mod A002144(n).

A336883 a(n) = ((A002144(n) - 1)/2)! (mod A002144(n)) where A002144(n) is the n-th Pythagorean prime.

Original entry on oeis.org

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

Author

Hiroyuki Hara, Aug 06 2020

Keywords

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

Examples

			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.
		

Crossrefs

Cf. A336884, A002144 (Pythagorean primes), A206549, A209874, A256011, A186814, A282538.

Programs

  • Mathematica
    Map[Mod[((# - 1)/2)!, #] &, Select[4 Range[192] + 1, PrimeQ]] (* Michael De Vlieger, Oct 15 2020 *)
  • 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