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.

Showing 1-6 of 6 results.

A027862 Primes of the form j^2 + (j+1)^2.

Original entry on oeis.org

5, 13, 41, 61, 113, 181, 313, 421, 613, 761, 1013, 1201, 1301, 1741, 1861, 2113, 2381, 2521, 3121, 3613, 4513, 5101, 7321, 8581, 9661, 9941, 10513, 12641, 13613, 14281, 14621, 15313, 16381, 19013, 19801, 20201, 21013, 21841, 23981, 24421, 26681
Offset: 1

Views

Author

Keywords

Comments

Also, primes of the form 4*k+1 which are the hypotenuse of one and only one right triangle with integral legs. - Cino Hilliard, Mar 16 2003
Centered square primes (i.e., prime terms of centered squares A001844). - Lekraj Beedassy, Jan 21 2005
Primes of the form 2*k*(k-1)+1. - Juri-Stepan Gerasimov, Apr 27 2010
Equivalently, primes of the form (m^2+1)/2 (take m=2*j+1). These primes a(n) have nontrivial solutions of x^2 == 1 (Modd a(n)) given by x=x(n)=A002731(n). For Modd n see a comment on A203571. See also A206549 for such solutions for primes of the form 4*k+1, given in A002144.
E.g., a(3)=41, A002731(3)=9, 9^2=81, floor(81/41)=1 (odd),
-81 = -2*41 + 1 == 1 (mod 2*41), hence 9^2 == 1 (Modd 41). - Wolfdieter Lang, Feb 24 2012
Also primes of the form 4*k+1 that are the smallest side length of one and only one integer Soddyian triangle (see A230812). - Frank M Jackson, Mar 13 2014
Also, primes of the form (m^2+1)/2. - Zak Seidov, May 01 2014
Note that ((2n+1)^2 + 1)/2 = n^2 + (n+1)^2. - Thomas Ordowski, May 25 2015
Primes p such that 2p-1 is a square. - Thomas Ordowski, Aug 27 2016
Primes in the main diagonal of A000027 when represented as an array read by antidiagonals. - Clark Kimberling, Mar 12 2023
The diophantine equation x^2 + ... + (x + r)^2 = p may be rewritten to A*x^2 + B*x + C = p, where A = (r + 1), B = r*(r + 1), C = r*(r + 1)*(2*r + 1)/6. If gcd(A, B, C) > 1 no solution for a prime p exists. The gcd(A, B, C) = 1 holds only for r = 1, 2, 5 (gcd is the greatest common divisor). For r = 1 we have x^2 + (x + 1)^2 = p, thus for x from A027861 we calculate primes p from A027862. For r = 2 we have x^2 + (x + 1)^2 + (x + 2)^2 = p, thus for x from A027863 we calculate primes p from A027864. For r = 5 we have x^2 + ... + (x + 5)^2 = p, thus for x from A027866 we calculate primes p from A027867. - Ctibor O. Zizka, Oct 04 2023

Examples

			13 is in the sequence because it is prime and 13 = 2^2 + 3^2. - _Michael B. Porter_, Aug 27 2016
		

References

  • D. M. Burton, Elementary Number Theory, Allyn and Bacon Inc. Boston, MA, 1976, p. 271.
  • Morris Kline, Mathematical Thought from Ancient to Modern Times, 1972. pp. 275.

Crossrefs

Primes p such that A079887(p) = 1.
Cf. A002731 (m values), A027861 (j values), A091277 (prime indices).
Subsequence of A002144 (p=4k+1).
Cf. A001844 (centered squares), A027863, A027864, A027866, A027867, A203571, A206549, A230812.

Programs

  • Magma
    [ a: n in [0..150] | IsPrime(a) where a is n^2+(n+1)^2 ]; // Vincenzo Librandi, Dec 18 2010
  • Mathematica
    Select[Table[n^2+(n+1)^2,{n,200}],PrimeQ] (* Harvey P. Dale, Aug 22 2012 *)
    Select[Total/@Partition[Range[200]^2,2,1],PrimeQ] (* Harvey P. Dale, Apr 20 2016 *)
  • PARI
    je=[]; for(n=1,500, if(isprime(n^2+(n+1)^2),je=concat(je,n^2+(n+1)^2))); je
    
  • PARI
    fermat(n) = { for(x=1,n, y=2*x*(x+1)+1; if(isprime(y),print1(y" ")) ) }
    

Formula

a(n) = ((A002731(n)^2 - 1)/2) + 1. - Torlach Rush, Mar 14 2014
a(n) = (A002731(n)^2 + 1)/2. - Zak Seidov, May 01 2014

Extensions

More terms from Cino Hilliard, Mar 16 2003

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

Views

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

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

Views

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

A209389 Product of positive odd integers smaller than n and relatively prime to n, taken Modd n. A209388(n) (Modd n).

Original entry on oeis.org

0, 1, 1, 3, 3, 5, 1, 7, 1, 9, 1, 1, 5, 13, 11, 15, 13, 17, 1, 1, 13, 21, 1, 1, 7, 25, 1, 1, 17, 1, 1, 31, 23, 33, 29, 1, 31, 37, 25, 1, 9, 1, 1, 1, 19, 45, 1, 1, 1, 49, 35, 1, 23, 53, 21, 1, 37, 57, 1, 1, 11, 61, 55, 63, 1, 1, 1, 1, 47, 1
Offset: 1

Views

Author

Wolfdieter Lang, Mar 10 2012

Keywords

Comments

For Modd n (not to be confused with mod n) see a comment on A203571.
See A209388 for the number of elements of the reduced residue class Modd n, called delta(n).
a(prime(n)) = (prime(n)-2)!! Modd prime(n) = 1 if n=1 or (prime(n)-1)/2 is odd, and = r(prime(n)) if (prime(n)-1)/2 is even. Here r(prime(n)) is the smallest positive nontrivial solution of x^2==1 (Modd prime(n)), which exists only for primes of the form 4*k+1 given in A002144. For r(prime(n)) see A206549. This is the analog of Wilson's theorem for Modd prime(n).
For (prime(n)-2)!! see A207332. [Wolfdieter Lang, Mar 28 2012]

Examples

			a(1) = 1 (Modd 1) = -1 (mod 1) = 0, because floor(1/1)=1 is odd. a(4)= 1*3 (Modd 4) = 3, a(15) = 1*7*11*13 (Modd 15) = 1001 (Modd 15) = 1001 (mod 15) because floor(1001/15) = 66 is even, hence a(15) = 11.
		

Crossrefs

Cf. A209388, A160377 (mod n analog).

Formula

a(n) = A209388(n) (Modd n), n>=1.

A212353 a(n) is the smallest positive solutions of the congruence x^2 + (x+1)^2 == 0 (mod prime), where prime = A002144(n) (Pythagorean primes).

Original entry on oeis.org

1, 2, 6, 8, 15, 4, 11, 5, 13, 27, 37, 45, 16, 7, 18, 52, 64, 46, 9, 40, 91, 53, 44, 88, 120, 93, 108, 26, 77, 12, 101, 94, 106, 155, 134, 57, 31, 190, 71, 14, 89, 33, 54, 206, 150, 117, 244, 219, 241, 276, 38, 62, 17, 211, 243, 74, 277, 307, 325, 67, 306, 176, 43
Offset: 1

Views

Author

Wolfdieter Lang, May 10 2012

Keywords

Comments

The companion sequence is A212354.
There are at most two incongruent solutions of this congruence due to the degree. The fact that there are precisely two such solutions for each prime of the form 4*k+1 (see A002144) is due to the reduction of this problem to one of quadratic residues, namely to X^2 == -1 (mod 2p), with p a prime (see the Nagell reference, given in A210848, pp. 132-3, especially theorem 77), adapted to the quadratic form f(x) = 2*x^2 + 2*x + 1, with discriminant D=-4. This congruence with composite modulus has exactly two incongruent solutions because X^2 == -1 (mod 2) has only the solution +1 modulo 2 (odd numbers), and X^2 == -1 (mod p) has (at least one) solution if the Legendre symbol (-1/p) = +1 (i.e., if -1 is a quadratic residue modulo p). Now (-1/p) = (-1)^(p-1)/2 (see, e.g., the Niven-Zuckerman-Montgomery reference given in A001844, Theorem 3.2 (1), p. 132). Hence there is a solution modulo p iff p == 1 (mod 4). Call the smallest positive one X0, with 0 < X0 < p-1. Then one also has the incongruent solution X1 := p-X0. This implies that there are precisely two incongruent solution of the original congruence modulo 2*p for each 1 (mod 4) prime (see, e.g., Nagell's book, pp. 83-4, Theorem 46). If u is a solution for p = A002144(n) (the existence of u has just been proved) then also the companion v := p-1-u satisfies this congruence, and v is incongruent to u modulo p.
Note that x^2 + (x+1)^2 = 4*T(x) + 1, with the triangular numbers A000217.
The primes with x^2 +(x+1)^2 = prime (necessarily from A002144) are found under A027862. The corresponding x values are found under A027861. These x values explain the positions n' where a(n') is smaller than a(n'-1) (for n'>=6): determine k with x=A027861(k), and then n' from A027862(k) = A002144(n'). Note that a(n') = x for such values n'. E.g., n'=6 with a(6)=4: x=4=A027861(3), p=41=A027862(3) = A002144(6). These values n' are n' = 1, 2, 6, 8, 14, 19, 30, ...
All positive solutions of this congruence are provided by the two sequences with entries u(n,k) = a(n) + k*A002144(n) and v(n,k) = A212354(n) + k*A002144(n), n >= 1, k >= 0. For the cases p = 5, 13 and 17 see A047219, A212160 and A212161, respectively, where the even-indexed numbers are the u(n,k) and the odd-indexed ones the v(n,k) (bisection).
2*a(n) + 1 = A206549(n), the smallest positive nontrivial solution of X^2 == +1 (Modd A002144(n)). For the next larger solution 2*A212354(n) + 1 >= p, hence it does not belong to the restricted residue system Modd A002144(n).

Examples

			n=1: a(1)=1 because 1^2 + 2^2 = 5 == 0 (mod 5). The companion solution is (5-1) - 1 = 3 = A212354(1).
n=3: a(3)=6 because 6^2 + 7^2 = 85 = 5*17 == 0 (mod 17). The companion is (17-1) - 6 = 10 =  A212354(3).
n=14: a(14)=7 because p=A002144(14) = 113 = A027862(5), and 49^2 + 50^2 = 113. The companion is (113-1) - 7 = 105 = A212354(14).
		

Crossrefs

Cf. A047219(1)=a(1), A212160(1)=a(2), A212161(1)=a(3), A212354 (companions), A206549.

Formula

a(n) is the smaller of the two smallest positive incongruent solutions of the congruence x^2 + (x+1)^2 = 2*x^2 + 2*x + 1 == 0 (mod A002144(n)), where A002144 lists the primes
1 modulo 4 (primes of the form 4*k+1). For the proof of the existence of a(n) see a comment above. The next larger incongruent companion solution is A212354(n), n >= 1.

A212354 a(n) is the second smallest positive incongruent solutions of the congruence x^2 + (x+1)^2 == 0 (mod prime), where prime = A002144(n) (Pythagorean primes).

Original entry on oeis.org

3, 10, 10, 20, 21, 36, 41, 55, 59, 61, 59, 55, 92, 105, 118, 96, 92, 126, 171, 152, 105, 175, 188, 152, 136, 175, 168, 254, 215, 300, 215, 242, 242, 197, 238, 331, 365, 210, 337, 406, 343, 415, 402, 254, 358, 403, 296, 337, 327, 300, 554, 538, 595, 405
Offset: 1

Views

Author

Wolfdieter Lang, May 10 2012

Keywords

Comments

The companion sequence is A212353.
See the comments on A212353 for the proof of two incongruent solutions of this congruence for each prime A002144(n). One takes the smallest positive representatives in each case as A212353(n) and a(n), with A212353(n) < a(n).
All positive solutions of this congruence are provided by the two sequences with entries u(n,k) = A212353(n) + k*A002144(n) and v(n,k) = a(n) + k*A002144(n), n >= 1, k >= 0. For the cases p = 5, 13 and 17 see A047219, A212160 and A212161, respectively, where the even-indexed numbers are the u(n,k) and the odd-indexed ones the v(n,k) (bisection).
r2(n) := 2*a(n) + 1 >= A002144(n) iff r(n) := 2*A212353(n) + 1 <= A002144(n)- 2. r2(n)^2 == +1 (Modd A002144(n)) but only r(n) belongs to the relevant restricted residue class. See A206549. Note that floor(r2(n)^2/A002144(n)) is odd. The same holds for r2 replaced by r.

Examples

			n=1: a(1)=3 because 3^2 + 4^2 = 25 == 0 (mod 5). The other solution is (5-1) - 3 = 1 = A212353(1).
n=3: a(3)=10 because 10^2 + 11^2 = 221 = 13*17 == 0 (mod 17). (17-1) - 10 = 6 = A212353(3).
n=14: a(14)=105 because p=A002144(14) = 113 = A027862(5), and 105^2 + 106^2 = 197*113 == 0 (mod 113). (113-1) - 105 = 7 = A212353(14).
The first pair of solutions [u(n)=A212353(n), v(n)=a(n)], n >= 1, are [1, 3], [2, 10], [6, 10], [8, 20], [15, 21], [4, 36], [11, 41], [5, 55], [13, 59], [27, 61], ...
		

Crossrefs

Formula

a(n) is the second smallest positive incongruent solution of the congruence x^2 + (x+1)^2 = 2*x^2 + 2*x + 1 == 0 (mod A002144(n)), where A002144 lists the primes 1 modulo 4.
a(n) = A002144(n) - 1 - A212353(n), n >= 1.
Showing 1-6 of 6 results.