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-8 of 8 results.

A319480 Number of ordered pairs (i,j) with 0 < i < j < prime(n)/2 such that R(i^2,prime(n)) > R(j^2,prime(n)), where R(k,p) (with p an odd prime and k an integer) denotes the unique integer r among 0,1,...,(p-1)/2 for which k is congruent to r or -r modulo p.

Original entry on oeis.org

0, 0, 1, 3, 7, 10, 14, 19, 41, 42, 74, 79, 85, 100, 154, 163, 207, 224, 245, 309, 318, 342, 449, 536, 590, 553, 581, 715, 738, 856, 912, 1085, 1037, 1324, 1229, 1477, 1442, 1491, 1785, 1730, 1952, 1986, 2240, 2316, 2191, 2474, 2748, 2836, 3176
Offset: 2

Views

Author

Zhi-Wei Sun, Sep 20 2018

Keywords

Comments

Conjecture: Let p be any odd prime and let N(p) be the number of ordered pairs (i,j) with 0 < i < j < p/2 and R(i^2,p) > R(j^2,p). Then N(p) == floor((p+1)/8) (mod 2).
See also A319311 for a similar conjecture.

Examples

			a(3) = 0 since prime(3) = 5 and R(1^2,5) = 1 = R(2^2,5).
a(4) = 1 since prime(4) = 7, R(1^2,7) = 1 < R(2^2,7) = 3, R(1^2,7) < R(3^2,7) = 2, and R(2^2,7) = 3 > R(3^2,7) = 2.
		

Crossrefs

Programs

  • Mathematica
    R[k_,p_]:=R[k,p]=Abs[Mod[k,p,-p/2]];
    t[p_]:=t[p]=Sum[Boole[R[i^2,p]>R[j^2,p]],{j,2,(p-1)/2},{i,1,j-1}]; Table[t[Prime[n]],{n,2,50}]

A319882 Number of ordered pairs (i, j) with 0 < i < j < prime(n)/2 such that (i^4 mod prime(n)) > (j^4 mod prime(n)).

Original entry on oeis.org

0, 0, 0, 3, 3, 10, 16, 21, 33, 54, 82, 85, 103, 125, 138, 165, 157, 204, 267, 259, 359, 422, 471, 504, 584, 564, 627, 713, 628, 1053, 960, 1213, 1017, 1278, 1275, 1367, 1522, 1671, 1661, 2118, 2038, 2005, 2242, 2330, 2234, 2418, 3194, 3112, 3126
Offset: 2

Views

Author

Zhi-Wei Sun, Sep 30 2018

Keywords

Comments

Conjecture: Let p be any odd prime, and let t(p) be the number of ordered pairs (i,j) with 0 < i < j < p/2 and (i^4 mod p) > (j^4 mod p). If p is not congruent to 7 modulo 8, then t(p) == floor((p-1)/8) (mod 2). When p == 7 (mod 8), we have t(p) == (p+1)/8 + (h(-p)+1)/2 (mod 2), where h(-p) denotes the class number of the imaginary quadratic field Q(sqrt(-p)).
See also A319311, A319480 and A319894 for similar conjectures.

Examples

			a(5) = 3 since prime(5) = 11, and the only ordered pairs (i, j) with 0 < i < j < 11/2 and (i^4 mod 11) > (j^4 mod 11) are (2, 3), (2, 4), (3, 4).
		

Crossrefs

Programs

  • Mathematica
    f[k_, p_] := f[k, p] = PowerMod[k, 4, p]; Inv[p_] := Inv[p] = Sum[Boole[f[i, p] > f[j, p]], {j, 2, (p - 1)/2}, {i, 1, j - 1}]; Table[Inv[Prime[n]], {n, 2, 50}]

A319894 Number of ordered pairs (i,j) with 0 < i < j < prime(n)/2 such that R(i^4,prime(n)) > R(j^4,prime(n)), where R(k,p) (with p an odd prime) denotes the unique integer r among 0,...,(p-1)/2 with k congruent to r or -r modulo p.

Original entry on oeis.org

0, 0, 0, 6, 3, 5, 10, 22, 51, 62, 58, 53, 100, 146, 194, 200, 185, 246, 242, 310, 374, 344, 422, 497, 540, 582, 652, 683, 768, 946, 916, 1011, 1180, 1294, 1108, 1387, 1592, 1656, 1829, 2050, 2048, 2386, 2365, 2186, 2184, 2770, 2902, 2890, 3296, 3292, 3754, 3063, 3562, 3650, 4184, 4391, 4164, 4506, 4812
Offset: 2

Views

Author

Zhi-Wei Sun, Sep 30 2018

Keywords

Comments

Conjecture: Let p be an odd prime, and let r(p) be the number of ordered pairs (i,j) with 0 < i < j < p/2 and R(i^4,p) > R(j^4,p), where R(k,p) denotes the unique integer r among 0,...,(p-1)/2 with k congruent to r or -r modulo p. Then r(p) is even if p == 3 (mod 4). Also, r(p) == (p-5)/8 (mod 2) if p == 5 (mod 8). When p == 1 (mod 8), r(p) is even if and only if 2 is a quartic residue modulo p.
See also A319311, A319480 and A319882 for similar conjectures.

Examples

			a(6) = 3 since prime(6) = 13, (R(1^4,13),R(2^4,13),...,R(6^4,13)) = (1,3,3,9,1,9), and (2,5), (3,5) and (4,5) are only pairs (i,j) with 0 < i < j < 13/2 and R(i^4,13) > R(j^4,13).
		

Crossrefs

Programs

  • Mathematica
    f[k_,p_]:=f[k,p]=Abs[Mod[PowerMod[k,4,p],p,-p/2]];Inv[p_]:=Inv[p]=Sum[Boole[f[i,p]>f[j,p]],{j,2,(p-1)/2},{i,1,j-1}];Table[Inv[Prime[n]],{n,2,60}]

A319903 Number of ordered pairs (i,j) with 0 < i < j < prime(n)/2 such that (i^8 mod prime(n)) > (j^8 mod prime(n)).

Original entry on oeis.org

0, 0, 1, 2, 7, 5, 10, 22, 45, 48, 68, 53, 104, 127, 146, 200, 203, 250, 288, 312, 387, 318, 450, 557, 536, 745, 664, 581, 722, 797, 986, 1011, 1082, 1474, 1294, 1317, 1608, 1684, 1893, 2096, 1898, 2297, 2333, 2090, 2467, 2652, 2836, 3352, 3698, 3326, 3380, 2981, 3778, 3902, 4165, 4743, 4350, 4652, 4240
Offset: 2

Views

Author

Zhi-Wei Sun, Oct 01 2018

Keywords

Comments

Conjecture 1: Let p be an odd prime, and let N be the number of ordered pairs (i,j) with 0 < i < j < p/2 and (i^8 mod p) > (j^8 mod p). When p == 1 (mod 8), we have 2 | N if and only if 2 is a quartic residue modulo p. Also, N is even if p == 3 (mod 8). When p == 5 (mod 8), we have N == (p-5)/8 (mod 2). If p == 7 (mod 8) then N == (h(-p)+1)/2 (mod 2), where h(-p) is the class number of the imaginary quadratic field Q(sqrt(-p)).
Conjecture 2: Let p be an odd prime, and let N' be the number of ordered pairs (i,j) with 0 < i < j < p/2 and R(i^8,p) > R(j^8,p), where R(k,p) denotes the unique integer r among 0,...,(p-1)/2 with k congruent to r or -r modulo p. When p == 9 (mod 16), we have 2 | N' if and only if 2 is a quartic residue modulo p. Also, N' == floor((p+1)/8) (mod 2) if p is not congruent to 9 modulo 16.
See also A319311, A319480, A319882 and A319894 for similar conjectures.

Examples

			a(4) = 1 since prime(4) = 7, and (R(1^8,7),R(2^8,7),R(3^8,7)) = (1,3,2) with R(2^8,7) > R(3^8,7).
a(5) = 2 since prime(5) = 11, and (R(1^8,11),...,R(5^8,11)) = (1,3,5,2,4) with R(2^8,11) > R(4^8,11), R(3^8,11) > R(4^8,11) and R(3^8,11) > R(5^8,11).
		

Crossrefs

Programs

  • Mathematica
    f[k_,p_]:=f[k,p]=PowerMod[k,8,p];Inv[p_]:=Inv[p]=Sum[Boole[f[i,p]>f[j,p]],{j,2,(p-1)/2},{i,1,j-1}];Table[Inv[Prime[n]],{n,2,60}]

A309012 Number of ordered pairs (i,j) with 0 < i < j < prime(n)/2 such that (i^16 mod prime(n)) > (j^16 mod prime(n)).

Original entry on oeis.org

0, 0, 0, 0, 3, 3, 0, 16, 21, 43, 30, 62, 77, 99, 129, 146, 203, 187, 228, 245, 252, 345, 372, 382, 402, 558, 570, 631, 663, 756, 901, 1114, 961, 1325, 1398, 1253, 1571, 1470, 1601, 1795, 2024, 1988, 2349, 2014, 2184, 2200, 2728, 3054, 3084, 3718, 3386, 3224, 3018, 3861, 3866, 4258, 4361, 4418, 5110, 4724
Offset: 1

Views

Author

Zhi-Wei Sun, Jul 06 2019

Keywords

Comments

Conjecture : Let p be an odd prime, and let N be the number of ordered pairs (i,j) with 0 < i < j < p/2 and (i^16 mod p) > (j^16 mod p). When p == 1 (mod 16), we have 2 | N. Also, N == |{0

Examples

			a(5) = 3 with prime(5) = 11, and (2^16 mod 11) = 9 greater than (3^16 mod 11) = 3, (4^16 mod 11) = 4 and (5^16 mod 11) = 5.
		

Programs

  • Mathematica
    r[p_]:=r[p]=Sum[Boole[PowerMod[j,16,p]>PowerMod[k,16,p]],{k,2,p/2},{j,1,k-1}];
    Print[Table[r[Prime[n]],{n,1,60}]]

A320060 Least residue greater than -prime(n)/2 of the product Product_{i,j} (i^2 - (i+j)*j) modulo prime(n), where i and j run over {1,...,(prime(n)-1)/2} with i^2-(i+j)*j not divisible by prime(n).

Original entry on oeis.org

-1, -1, -1, 1, 5, -4, -1, 1, 1, 1, -6, 1, -1, -1, -23, -1, 1, 1, 1, 27, -1, -1, 1, 22, -1, 1, 1, -1, 15, -1, 1, 37, -1, -1, 1, 28, -1, -1, 80, -1, -1, 1, -81, 14, -1, 1, 1, 1, 1, -89, -1, 1, 1, 16, 1, -1, 1, 60, 1, -1, -138, 1, 1, -25, -114, 1, 148, 1, 1, -42, -1, -1, -104, -1, 1, -1, 63, -1, -1
Offset: 2

Author

Zhi-Wei Sun, Oct 18 2018

Keywords

Comments

Conjecture 1. Let p be an odd prime and let f(p) be the product of i^2-(i+j)*j, where i and j run over {1,...,(p-1)/2} with i^2-(i+j)*j not divisible by p. If p == 1, 9 (mod 20), then f(p) == -5^((p-1)/4) (mod p). If p == 11 (mod 20) or p == 23, 27 (mod 40), then f(p) == 1 (mod p). If p == 19 (mod 20) or p == 3, 7 (mod 40), then f(p) == -1 (mod p). If p == 13 (mod 20) then f(p) == (-1)^(floor((p+10)/20))*5^((p-1)/4) (mod p); if p == 17 (mod 20) then f(p) == (-1)^(floor((p-10)/20))*5^((p-1)/4) (mod p).
Conjecture 2. Let p be any prime congruent to 1 modulo 4, and let a and b be integers with a*b == -1 (mod p). Let F(a,b) be the product of (i-a*j)*(i-b*j), where i and j run over {1,...,(p-1)/2} with (i-a*j)(i-b*j) not divisible by p. If a-b is not divisible by p, then -F(a,b) is congruent to the Legendre symbol ((a-b)/p) modulo p. If a == b (mod p) and p == 1 (mod 8), then F(a,b) == (-1)^((p+7)/8)*((p-1)/2)! (mod p). If p == 5 (mod 8) and a == b == (-1)^k*((p-1)/2)! (mod p) with k in {0,1}, then F(a,b) == (-1)^(k+(p-5)/8) (mod p).
These two conjectures were motivated by Theorem 1.2(ii) in the author's preprint arXiv:1809.07766.
The author has proved Conjecture 2 fully and Conjecture 1 in the case p == 1,9 (mod 10) in arXiv:1810.12102. Here we add a new general conjecture which implies Conjecture 1 in the case p == 3,7 (mod 10).
Conjecture 3. Let A be an integer, and let p be an odd prime with A^2+4 a quadratic nonresidue modulo p. Let f(p,A) be the product Product_{i,j=1,...,(p-1)/2} (i^2-Aij-j^2). If p == 1 (mod 4), then f(p,A) == (-A^2-4)^((p-1)/4) (mod p). If p == 3 (mod 4) then f(p,A) == (-A^2-4)^((p+1)/4)*u_{(p+1)/2}(A)/2 (mod p), where u_0(A) = 0, u_1(A) = 1, and u_{n+1}(A) = A*u_n(A) + u_{n-1}(A) for n = 1,2,3,.... - Zhi-Wei Sun, Oct 30 2018

Examples

			a(4) = -1 since prime(4) = 7 does not divide i^2-(i+j)*j for any i,j = 1,2,3, and Product_{i,j = 1,2,3} (i^2 - (i+j)*j) = -108900 == -1 (mod 7).
		

Crossrefs

Programs

  • Mathematica
    rMod[m_,n_]:=rMod[m,n]=Mod[m,n,-n/2];
    a[p_]:=a[p]=rMod[Product[If[rMod[i^2-(i+j)*j,p]==0,1,i^2-(i+j)*j],{i,1,(p-1)/2},{j,1,(p-1)/2}],p];
    Table[a[Prime[n]],{n,2,80}]

A320159 Number of positive integers x < prime(n)/2 such that (x^2 mod prime(n)) > (4*x^2 mod prime(n)).

Original entry on oeis.org

0, 0, 1, 2, 2, 3, 4, 5, 4, 7, 9, 9, 10, 11, 9, 13, 13, 15, 17, 14, 18, 22, 19, 22, 24, 25, 28, 25, 27, 28, 34, 30, 34, 36, 37, 41, 39, 41, 36, 43, 42, 45, 41, 48, 49, 54, 54, 59, 54, 57, 58, 52, 60, 59, 64, 59, 67, 73, 69, 70, 72, 73, 78, 68, 78, 79, 84, 84, 84, 87, 88, 80, 96, 93, 96, 87, 97, 99, 100, 102
Offset: 1

Author

Qing-Hu Hou and Zhi-Wei Sun, Oct 06 2018

Keywords

Comments

Conjecture: Let p > 3 be a prime and let b be any integer. For a = 2,...,p-1 let I(a,b) denote the number of positive integers x < p/2 with (x^2+b mod p) > (a*x^2+b mod p). Then both S = {I(a,b): 1 < a < p and (a/p) = 1} and T = {I(a,b): 1 < a < p and (a/p) = -1} have cardinality 1 or 2 according as p is congruent to 1 or 3 modulo 4, where (a/p) is the Legendre symbol. Moreover, the set S deos not depend on the value of b.
For any prime p == 1 (mod 4), we have q^2 == -1 (mod p) for some integer q, hence ((q*x)^2 mod p) > (a*(q*x)^2 mod p) if and only if (x^2 mod p) < (a*x^2 mod p). Thus, for each a = 2,...,p-1 there are exactly (p-1)/4 positive integers x < p/2 such that (x^2 mod p) > (a*x^2 mod p). Thus I(a,0) = (p-1)/4 for all a = 2,...,p-1.
The conjecture was confirmed by Q.-H. Hou, H. Pan and Z.-W. Sun in 2021. - Zhi-Wei Sun, Jul 22 2021

Examples

			a(3) = 1 since prime(3) = 5,  (1^2 mod 5) < (4*1^2 mod 5) and (2^2 mod 5) > (4*2^2 mod 5).
a(4) = 2 since prime(4) = 7, (1^2 mod 7) < (4*1^2 mod 7), (2^2 mod 7) > (4*2^2 mod 7) and (3^2 mod 7) > (4*3^2 mod 7).
		

Crossrefs

Programs

  • Mathematica
    Inv[p_]:=Inv[p]=Sum[Boole[Mod[x^2,p]>Mod[4x^2,p]],{x,1,(p-1)/2}];Table[Inv[Prime[n]],{n,1,80}]
  • PARI
    a(n) = my(p=prime(n), m=p\2); if (n==1, m--); sum(k=1, m, lift(Mod(k, p)^2) > lift(Mod(2*k, p)^2)); \\ Michel Marcus, Oct 07 2018

A320260 Number of ordered pairs (j,k) with 0 < j < k < prime(n)/2 such that (j*(j+1) mod prime(n)) > (k*(k+1) mod prime(n)).

Original entry on oeis.org

0, 0, 1, 1, 3, 8, 13, 10, 19, 41, 44, 70, 83, 75, 100, 143, 167, 210, 188, 225, 290, 306, 322, 401, 503, 554, 481, 541, 634, 686, 848, 858, 1048, 981, 1203, 1099, 1468, 1332, 1421, 1700, 1646, 1831, 2054, 2077, 2135, 2017, 2356, 2698, 2712, 2851, 3022, 3112, 3386, 3447, 3838, 3551, 4062, 3956, 4466, 4569
Offset: 1

Author

Zhi-Wei Sun, Oct 08 2018

Keywords

Comments

Conjecture: Let p be a prime with p == 3 (mod 4), and let T(p) denote the number of ordered pairs (j,k) with 0 < j < k < p/2 and (j*(j+1) mod p) > (k*(k+1) mod p). Then T(p) == floor((p+1)/8) (mod 2).

Examples

			a(4) = 1 since prime(4) = 7 and (1*2 mod 7, 2*3 mod 7, 3*4 mod 7) = (1,6,5) with 6 > 5.
		

Crossrefs

Programs

  • Mathematica
    T[p_]:=T[p]=Sum[Boole[Mod[j(j+1),p]>Mod[k(k+1),p]],{k,2,(p-1)/2},{j,1,k-1}];Table[T[Prime[n]],{n,1,60}]
Showing 1-8 of 8 results.