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: Zhi-Wei Sun

Zhi-Wei Sun's wiki page.

Zhi-Wei Sun has authored 1438 sequences. Here are the ten most recent ones:

A386850 Least prime n < p <= (n-1)*(2n-1) such that Sum_{k=1..n} x^(n-k)/k! is irreducible modulo p, or 1 if such a prime p does not exist.

Original entry on oeis.org

1, 3, 7, 7, 13, 41, 13, 31, 29, 31, 37, 23, 97, 331, 53, 101, 47, 89, 43, 199, 53, 43, 47, 107, 83, 61, 149, 37, 353, 127, 113, 199, 173, 107, 67, 401, 349, 101, 347, 47, 79, 89, 83, 241, 139, 641, 673, 103, 491, 179, 383, 293, 61, 439, 397, 547, 79, 1301, 379, 277
Offset: 1

Author

Zhi-Wei Sun, Aug 05 2025

Keywords

Comments

Conjecture: a(n) > 1 for all n > 1. In other words, for any integer n > 1, there is a prime p with n < p <= (n-1)*(2n-1) such that the polynomial Sum_{k=1..n}x^(n-k)/k! is irreducible modulo p.
Note that Sum_{k>0}x^k/k! = e^x - 1.

Examples

			a(2) = 3 since 3 is the only prime in the interval (2, (2-1)*(2*2-1)] and x + 1/2 is irreducible modulo 3.
		

Crossrefs

Programs

  • Mathematica
    P[n_, x_]:=P[n, x]=Sum[x^(n-k)/k!, {k, 1, n}];
    tab={};Do[Do[If[IrreduciblePolynomialQ[P[n, x], Modulus->Prime[k]]==True, tab=Append[tab,Prime[k]]; Goto[aa]], {k, PrimePi[n]+1, PrimePi[(n-1)(2n-1)]}];tab=Append[tab,1]; Label[aa]; Continue, {n, 1, 60}];Print[tab]
  • PARI
    a(n) = forprime(p=n+1, (n-1)*(2*n-1), if (polisirreducible(Mod(sum(k=1, n, x^(n-k)/k!), p)), return(p))); 1; \\ Michel Marcus, Aug 05 2025

A385678 Least prime p <= n^2 - 2*n + 4 such that the polynomial Sum_{k=1..n} phi(k)*x^(n-k) is irreducible modulo p, or 1 if such p does not exist, where phi is Euler's totient function given by A000010.

Original entry on oeis.org

1, 2, 3, 1, 1, 7, 31, 13, 67, 7, 67, 13, 53, 7, 11, 19, 101, 239, 37, 23, 13, 103, 263, 89, 79, 29, 47, 23, 167, 317, 139, 73, 283, 7, 223, 71, 83, 29, 1117, 503, 83, 167, 811, 349, 17, 3, 263, 37, 157, 317, 11, 7, 43, 283, 17, 79, 193, 293, 257, 233
Offset: 1

Author

Zhi-Wei Sun, Aug 04 2025

Keywords

Comments

Conjecture: a(n) > 1 for all n > 5.
Note that Sum_{k=1..4} phi(k)*x^(4-k) = (x + 1)*(x^2 + 2) and Sum_{k=1..5} phi(k)*x^(5-k) = (x^2 - x + 2)*(x^2 + 2*x + 2).
See also A385658 and A385676 for similar conjectures.

Crossrefs

Programs

  • Mathematica
    P[n_, x_]:=P[n, x]=Sum[EulerPhi[k]*x^(n-k), {k, 1, n}];
    tab={};Do[Do[If[IrreduciblePolynomialQ[P[n, x], Modulus->Prime[k]]==True, tab=Append[tab,Prime[k]]; Goto[aa]], {k, 1, PrimePi[n^2-2n+4]}];
    tab=Append[tab,1]; Label[aa]; Continue, {n, 1, 60}];Print[tab]
  • PARI
    a(n) = forprime(p=2, n^2 - 2*n + 4, if (polisirreducible(Mod(sum(k=1, n, eulerphi(k)*x^(n-k)), p)), return(p))); 1; \\ Michel Marcus, Aug 04 2025

Formula

a(9) = 67 since 67 = 9^2 - 2*9 + 4 is the least prime p such that the polynomial Sum_{k=1..9}phi(k)*x^(9-k) is irreducible modulo p.

A386827 Least prime n < p < 2*n*(n-1) such that the polynomial Sum_{k=1..n} x^(n-k)/k is irreducible modulo p, or 1 if such a prime p does not exist.

Original entry on oeis.org

1, 3, 7, 13, 7, 11, 83, 11, 43, 103, 41, 29, 89, 67, 43, 23, 41, 67, 131, 269, 47, 151, 43, 149, 191, 127, 29, 113, 263, 173, 61, 463, 223, 67, 61, 127, 103, 97, 47, 271, 89, 59, 337, 281, 157, 541, 269, 277, 73, 337, 463, 379, 223, 1481, 827, 797, 397, 101, 337, 431
Offset: 1

Author

Zhi-Wei Sun, Aug 04 2025

Keywords

Comments

Conjecture: a(n) > 1 for all n > 1. In other words, for each n = 2,3,... there is a prime p with n < p < 2*n*(n-1) such that the polynomial Sum_{k=1..n} x^(n-k)/k is irreducible modulo p.

Examples

			a(7) = 83 since 83 = 2*7*(7-1) - 1 is the least prime p > 7 such that the polynomial x^6 + x^5/2 + x^4/3 + x^3/4 + x^2/5 + x/6 + 1/7 is irreducible modulo p.
		

Programs

  • Mathematica
    P[n_, x_]:=P[n, x]=Sum[x^(n-k)/k, {k, 1, n}];
    tab={};Do[Do[If[IrreduciblePolynomialQ[P[n, x], Modulus->Prime[k]]==True, tab=Append[tab,Prime[k]]; Goto[aa]], {k, PrimePi[n]+1, PrimePi[2n(n-1)-1]}];
    tab=Append[tab,1]; Label[aa]; Continue, {n,1,60}];Print[tab]
  • PARI
    a(n) = forprime(p=n+1, 2*n*(n-1)-1, if (polisirreducible(Mod(sum(k=1, n, x^(n-k)/k), p)), return(p))); 1; \\ Michel Marcus, Aug 05 2025

A386828 Least prime n < p <= 2*n^2 + 1 such that the polynomial Sum_{k=1..n} x^(n-k)/k^2 is irreducible modulo p, or 1 if such a prime p does not exist.

Original entry on oeis.org

1, 3, 19, 13, 7, 17, 19, 13, 17, 13, 17, 31, 139, 151, 19, 181, 113, 157, 79, 89, 89, 71, 37, 31, 197, 31, 199, 149, 83, 37, 127, 59, 647, 89, 47, 47, 157, 197, 97, 79, 601, 59, 79, 67, 71, 487, 223, 577, 359, 83, 269, 269, 251, 461, 229, 67, 1777, 859, 1091, 701
Offset: 1

Author

Zhi-Wei Sun, Aug 05 2025

Keywords

Comments

Conjecture: a(n) > 1 for all n > 1.
We also have similar conjectures for Sum_{k=1..n} x^(n-k)/k^s with other values of s.

Examples

			a(3) = 19 since 19 = 2*3^2 + 1 is the least prime p > 3 such that the polynomial x^2 + x/2 + 1/3 is irreducible modulo p.
		

Crossrefs

Programs

  • Mathematica
    P[n_, x_]:=P[n, x]=Sum[x^(n-k)/k^2, {k, 1, n}];
    tab={};Do[Do[If[IrreduciblePolynomialQ[P[n, x], Modulus->Prime[k]]==True, tab=Append[tab,Prime[k]]; Goto[aa]], {k, PrimePi[n]+1, PrimePi[2n^2+1]}]; tab=Append[tab,1]; Label[aa]; Continue, {n,1,60}];Print[tab]
  • PARI
    a(n) = forprime(p=n+1, 2*n^2+1, if (polisirreducible(Mod(sum(k=1, n, x^(n-k)/k^2), p)), return(p))); 1; \\ Michel Marcus, Aug 05 2025

A385676 Least prime p <= 2*n^2 - n + 1 such that the polynomial Sum_{k=1..n} sigma(k) * x^(n-k) is irreducible modulo p, or 1 if such p does not exist, where sigma is given by A000203.

Original entry on oeis.org

1, 2, 3, 2, 1, 5, 11, 29, 2, 47, 5, 31, 13, 379, 37, 251, 23, 29, 67, 97, 41, 131, 11, 173, 41, 139, 79, 103, 281, 19, 7, 53, 71, 281, 131, 19, 3, 43, 149, 23, 347, 47, 29, 107, 107, 47, 823, 47, 311, 547, 67, 419, 263, 379, 349, 23, 227, 349, 19, 113
Offset: 1

Author

Zhi-Wei Sun, Aug 04 2025

Keywords

Comments

Conjecture: a(n) > 1 except for n = 1, 5.
Note that Sum_{k=1..5} sigma(k) * x^(5-k) = x^4 + 3*x^3 + 4*x^2 + 7*x + 6 = (x + 2)*(x^3 + x^2 + 2*x + 3).
See A385678 for a similar conjecture involving Euler's totient function.

Examples

			a(14) = 379 since 379 = 2*14^2 - 14 + 1 is the least prime p such that Sum_{k=1..14} sigma(k) * x^(14-k) is irreducible modulo p.
		

Crossrefs

Programs

  • Mathematica
    sigma[n_]:=sigma[n]=DivisorSigma[1,n];
    P[n_, x_]:=P[n, x]=Sum[sigma[k]*x^(n-k), {k, 1, n}];
    tab={};Do[Do[If[IrreduciblePolynomialQ[P[n, x], Modulus->Prime[k]]==True, tab=Append[tab,Prime[k]]; Goto[aa]], {k, 1, PrimePi[2n^2-n+1]}];
    tab=Append[tab,1]; Label[aa]; Continue, {n, 1, 60}];Print[tab]
  • PARI
    a(n) = forprime(p=2, 2*n^2 - n + 1, if (polisirreducible(Mod(sum(k=1, n, sigma(k)*x^(n-k)), p)), return(p))); 1; \\ Michel Marcus, Aug 04 2025

A385658 Least prime p < 2n*(n+1) such that the polynomial Sum_{k=1..n} tau(k)*x^(n-k) is irreducible modulo p, or 1 if such p does not exist, where tau is Ramanujan's tau function given by A000594.

Original entry on oeis.org

1, 2, 5, 17, 59, 19, 43, 17, 19, 89, 47, 67, 257, 89, 173, 11, 103, 67, 103, 191, 29, 89, 101, 139, 19, 13, 19, 79, 79, 271, 223, 149, 131, 5, 37, 31, 593, 149, 353, 109, 293, 293, 17, 19, 97, 83, 59, 79, 883, 101, 71, 13, 199, 113, 1013, 29, 1279, 7, 181, 383, 269, 197, 17
Offset: 1

Author

Zhi-Wei Sun, Aug 03 2025

Keywords

Comments

Conjecture: a(n) > 1 for all n > 1. In other words, for each n = 2,3,... the polynomial x^(n-1) + tau(2)*x^(n-2) + ... + tau(n) is irreducible modulo some prime p < 2n*(n+1).

Examples

			a(5) = 59 since the prime 59 is smaller than 2*5*(5+1) = 60, and 59 is the least prime p such that the polynomial tau(1)*x^4 + tau(2)*x^3 + tau(3)*x^2 + tau(4)*x + tau(5) is irreducible modulo p.
		

Crossrefs

Programs

  • Mathematica
    Tau[n_]:=Tau[n]=RamanujanTau[n];
    P[n_,x_]:=P[n,x]=Sum[Tau[k]x^(n-k),{k,1,n}];
    tab={};Do[Do[If[IrreduciblePolynomialQ[P[n, x], Modulus->Prime[k]]==True, tab=Append[tab,Prime[k]]; Goto[aa]], {k, 1, PrimePi[2n(n+1)-1]}];tab=Append[tab,1]; Label[aa]; Continue, {n,1,63}];Print[tab]
  • PARI
    a(n) = forprime(p=2, 2*n*(n+1)-1, if (polisirreducible(Mod(sum(k=1, n, ramanujantau(k)*x^(n-k)), p)), return(p))); 1; \\ Michel Marcus, Aug 04 2025

A386703 The residue of p(n) modulo q(n) in the interval (-q(n)/2, q(n)/2], where p(n) = A000041(n) and q(n) = A000009(n).

Original entry on oeis.org

0, 0, 1, 1, 1, -1, 0, -2, -2, 2, -4, 2, -7, 3, -13, 7, -7, 17, 4, -13, 32, 23, 7, -11, -30, -39, -62, -56, -43, -20, 42, 159, -161, 22, 258, -59, 357, 95, -239, -504, 483, 412, 471, 719, -978, -426, 434, -1137, 533, -622, -1780, 2087, 2251, -2669, -1562, 831, -3372, 1772
Offset: 1

Author

Zhi-Wei Sun, Jul 30 2025

Keywords

Comments

Conjecture: |a(n)| > 1 for all n > 7.
This has been verified for all n = 8..10^5.
Verified for all n <= 2000000. - Vaclav Kotesovec, Jul 30 2025

Examples

			a(6) = -1  since p(6) = 11 is congruent to -1 modulo q(6) = 4.
a(7) = 0 since p(7) = 15 is congruent to 0 modulo q(7) = 5.
		

Crossrefs

Programs

  • Mathematica
    rMod[m_,n_]:=Mod[Numerator[m]*PowerMod[Denominator[m],-1,n],n,(1-n)/2];
    a[n_]=rMod[PartitionsP[n],PartitionsQ[n]];Table[a[n],{n,1,70}]

A383274 a(n) = Sum_{i,j = 0..n} C(n, i)^2*C(n, j)^2*C(i+j, i)*2^(i+j).

Original entry on oeis.org

1, 13, 441, 20629, 1119361, 66116013, 4126228569, 267666251733, 17868312820737, 1219477111897933, 84701899713767161, 5967906378862013973, 425503428034568158081, 30642774518964618986989, 2225692868157573335052441, 162858794856607965831417429, 11993850186156155815298686977
Offset: 0

Author

Zhi-Wei Sun, Apr 26 2025

Keywords

Comments

Conjecture 1: Let S(p) = Sum_{0
If p == 1,9 (mod 20) with p = x^2 + 5*y^2, then S(p) == 4*x^2-2*p (mod p^2).
If p == 3,7 (mod 20) with 2*p = x^2 + 5*y^2, then S(p) == 2*x^2 - 2*p (mod p^2).
If p == 11, 13, 17, 19 (mod 20), then S(p) == 0 (mod p^2).
Conjecture 2: For any prime p == 1,3,7,9 (mod 20), we have Sum_{0
Both conjectures have been verified for odd primes smaller than 1000.

Examples

			a(1) = 13 since Sum_{i,j = 0,1}C(1,i)^2*C(1,j)^2*C(i+j,i)^2*2^(i+j) = Sum_{i,j = 0,1} C(i+j,i)^2*2^(i+j) = 2^0 + 2^1 + 2^1 + C(2,1)*2^2 = 13.
		

Crossrefs

Cf. A005259.

Programs

  • Maple
    a := proc(n) option remember; local i, j; add(add(binomial(n, i)^2 * binomial(n, j)^2 * binomial(i+j, i) * 2^(i+j), i = 0..n), j = 0..n) end: seq(a(n), n=0..16);  # Peter Luschny, Apr 27 2025
  • Mathematica
    a[n_] := a[n] = Sum[Binomial[n,i]^2*Binomial[n,j]^2*Binomial[i+j,i]*2^(i+j), {i,0,n}, {j,0,n}]; Table[a[n], {n,0,17}]
  • Python
    from math import comb
    def A383274(n): return sum((comb(n,i)**2<Chai Wah Wu, Apr 27 2025

Formula

a(n) ~ 3^(4*n+3) / (8 * sqrt(7) * Pi^(3/2) * n^(3/2)). - Vaclav Kotesovec, Apr 27 2025

A379654 Least positive integer k <= n such that |tau(k)|*n + 1 is prime, or 0 if such k does not exist, where the tau function is given by A000594.

Original entry on oeis.org

1, 1, 2, 1, 5, 1, 5, 2, 3, 1, 4, 1, 2, 2, 11, 1, 2, 1, 2, 5, 13, 1, 4, 2, 2, 3, 5, 1, 3, 1, 5, 2, 3, 6, 3, 1, 21, 15, 2, 1, 3, 1, 2, 11, 5, 1, 2, 2, 6, 2, 3, 1, 4, 2, 2, 11, 7, 1, 3, 1, 3, 2, 3, 5, 3, 1, 2, 3, 2, 1, 4, 1, 2, 2, 2, 6, 10, 1, 15, 3, 4, 1, 2, 2, 5, 3, 2, 1, 2, 2, 6, 12, 4, 3, 2, 1, 7, 3, 2, 1
Offset: 1

Author

Zhi-Wei Sun, Dec 28 2024

Keywords

Comments

Conjecture 1: a(n) > 0 for all n > 0. In other words, for each positive integer n, there is a number k among 1,...,n such that |tau(k)|*n + 1 is prime.
Conjecture 2: For each integer n > 1 not equal to 22, there is a number k among 1,...,n such that |tau(k)|*n - 1 is prime.
We have verified both conjectures for n up to 10^8.

Examples

			a(1) = 1 since 1*|tau(1)| + 1 = 2 is a prime.
a(5) = 5 since 5*|tau(5)| + 1 = 5*4830 + 1 = 24151 is prime, and 5*|tau(k)| + 1 is composite for every k = 1, 2, 3, 4.
		

Crossrefs

Programs

  • Mathematica
    t[n_]:=t[n]=Abs[RamanujanTau[n]];
    L={};Do[Do[If[PrimeQ[t[k]n+1],L=Append[L,k];Goto[aa]],{k,1,n}];L=Append[L,0];Label[aa],{n,1,100}];Print[L]

A376336 Least positive integer m such that tau(m) is divisible by n, where the Ramanujan tau function is given by A000594.

Original entry on oeis.org

1, 2, 2, 2, 5, 2, 3, 2, 3, 5, 8, 2, 7, 3, 5, 4, 239, 3, 89, 8, 3, 8, 4, 2, 25, 7, 6, 3, 13, 5, 139, 4, 8, 239, 5, 3, 191, 89, 11, 8, 257, 3, 19, 8, 10, 4, 67, 6, 15, 40, 239, 7, 107, 6, 8, 6, 89, 13, 61, 8, 9, 139, 3, 4, 35, 8, 31, 239, 5, 5, 137, 6, 2069, 191, 40, 178, 19, 11, 25, 8, 9, 257, 227, 3, 239, 19, 26, 8, 59, 10, 7, 4, 278, 67, 89, 6, 863, 15, 24, 40
Offset: 1

Author

Zhi-Wei Sun, Dec 22 2024

Keywords

Comments

Conjecture: a(n) exists for any positive integer n. Moreover, a(n) <= n^2 for all n > 0.
It seems that for some primes p the value of a(p) is relatively large. For example, 4327 is a prime with a(4327) = 316717, 9133 is a prime with a(9133) = 789977, and 9643 is a prime with a(9643) = 1001401.

Examples

			a(5) = 5 since tau(5) = 4830 is divisible by 5, but none of tau(1) = 1, tau(2) = -24, tau(3) = 252 and tau(4) = -1472 is a multiple of 5.
		

Crossrefs

Cf. A000594.

Programs

  • Mathematica
    f[n_]:=f[n]=RamanujanTau[n]; L={}; Do[m=1;Label[bb];If[Mod[f[m],n]==0,L=Append[L,m];Goto[aa]];m=m+1;Goto[bb];Label[aa],{n,1,100}];Print[L]
    (* Or: *)
    a[n_] := SelectFirst[Range[1, 30000], Divisible[RamanujanTau[#], n] &]; Array[a, 1000] (* Peter Luschny, Dec 22 2024 *)
  • PARI
    first(n) = {
    	my(todo = [1..n], res = vector(n, i, oo));
    	for(i = 1, oo,
    		c = ramanujantau(i);
    		for(j = 1, #todo,
    			if(res[todo[j]] > i && c % todo[j] == 0,
    				res[todo[j]] = i;
    				todo = setminus(todo, Set(todo[j]));
    				if(#todo == 0,
    					return(res)
    				)
    			)
    		);
    );} \\ David A. Corneth, Dec 23 2024
  • SageMath
    from itertools import count
    tau = delta_qexp(30000)  # adjust search length for n > 1000
    a = lambda n: next((k for k in count(1) if n.divides(tau[k])))
    print([a(n) for n in srange(1, 1001)])  # Peter Luschny, Dec 22 2024