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: W. Edwin Clark

W. Edwin Clark's wiki page.

W. Edwin Clark has authored 114 sequences. Here are the ten most recent ones:

A376691 The number of solutions to x + y == x^2 + y^2 == x^3 + y^3 (mod n) with 0 <= x <= y < n.

Original entry on oeis.org

1, 3, 3, 5, 3, 10, 3, 7, 5, 10, 3, 16, 3, 10, 10, 7, 3, 18, 3, 16, 10, 10, 3, 24, 7, 10, 5, 16, 3, 36, 3, 11, 10, 10, 10, 28, 3, 10, 10, 24, 3, 36, 3, 16, 18, 10, 3, 24, 9, 26, 10, 16, 3, 18, 10, 24, 10, 10, 3, 56, 3, 10, 18, 11, 10, 36, 3, 16, 10, 36
Offset: 1

Author

W. Edwin Clark, Oct 01 2024

Keywords

Comments

This is the same as the number of solutions to x + y == x^2 + y^2 == x^3+y^3 == x^4 + y^4 (mod n) with x <=y. Proved by Sahaj in Math StackExchange link.

Crossrefs

Cf. A376646.

Programs

  • Maple
    a:=proc(n)
     local x,y,count;
      count:=0:
      for x from 0 to n-1 do
       for y from x to n-1 do
         if (x+y) mod n =(x^2+y^2) mod n and (x+y) mod n =(x^3+y^3) mod n then count:=count+1;  fi;
       od:
      od:
      count;
    end:
  • Python
    def A376691(n):
        c = 0
        for x in range(n):
            m = x*(1-x)%n
            c += sum(1 for y in range(x,n) if y*(y-1)%n == m and not m*(x-y)%n)
        return c # Chai Wah Wu, Oct 02 2024

A376646 Number of solutions to x + y == x^2 + y^2 (mod n) with x <= y.

Original entry on oeis.org

1, 3, 3, 6, 3, 10, 5, 10, 7, 10, 7, 20, 7, 18, 10, 18, 9, 26, 11, 20, 18, 26, 13, 36, 11, 26, 19, 36, 15, 36, 17, 34, 26, 34, 18, 52, 19, 42, 26, 36, 21, 68, 23, 52, 26, 50, 25, 68, 29, 42, 34, 52, 27, 74, 26, 68, 42, 58, 31, 72, 31, 66, 50, 66, 26, 100, 35, 68, 50, 68
Offset: 1

Author

W. Edwin Clark, Sep 30 2024

Keywords

Programs

  • Maple
    a:=proc(n)
     local x,y,count;
      count:=0:
      for x from 0 to n-1 do
       for y from x to n-1 do
         if (x+y) mod n =(x^2+y^2) mod n  then count:=count+1; fi;
       od:
      od:
      count;
    end:
    # second Maple program:
    a:= n-> add(add(`if`(x^2-x+y^2-y mod n=0, 1, 0), x=0..y), y=0..n-1):
    seq(a(n), n=1..70);  # Alois P. Heinz, Oct 01 2024
  • PARI
    a(n) = sum(y=0, n-1, sum(x=0, y, (x+y) % n == (x^2+y^2) % n)); \\ Michel Marcus, Oct 01 2024
    
  • Python
    def A376646(n):
        c = 0
        for x in range(n):
            m = x*(1-x)%n
            c += sum(1 for y in range(x,n) if y*(y-1)%n==m)
        return c # Chai Wah Wu, Oct 02 2024

A376190 For a line L in the plane, let C(L) denote the number of prime points [k, prime(k)] on L, and let M(L) denote the maximum prime(k) for any of these points. a(n) is the maximum of the smallest primes in the lines L with C(L) = n and containing prime A376187(n), or a(n) = -1 if no such lines exist.

Original entry on oeis.org

2, 2, 3, 5, 19, 18, 7, 13, 967, 113, 83, 619, 103, 1583, 1693, 1621, 1759, 1753, 5923, 197, 6143, 15823, 5849, 1609, 1663, 10333, 1613, 152003, 15683, 16111, 1619, 141871, 15649, 15383, 140989, 141811, 136481, 141319, 15667, 136769, 16033, 16619, 141707, 15473, 135649
Offset: 1

Author

N. J. A. Sloane, Sep 25 2024, following a suggestion from W. Edwin Clark

Keywords

Comments

Consider all the lines L in the plane containing exactly n prime-points (k, prime(k)). A376187 minimizes the maximal prime on any such line L, while the present sequence then maximizes the minimal prime on the lines from A376187.
In other words, we first minimize (in A376187) the maximal prime over all lines with exactly n points, and then here we further maximize the minimal prime. The second step minimizes the spread of the points.
For most listed terms, there is only one line L with C(L) = n that contains prime A376187(n). - Max Alekseyev, Sep 28 2024

Examples

			The best line with 5 points contains the primes 19,23,31,43,47, so a(5) = 19 and A376187(5) = 47. See the Table for further examples.
		

Crossrefs

Extensions

Better definition and a(28)-a(45) from Max Alekseyev, Sep 28 2024

A376318 The number of distinct values of x+y+z (mod n) when x*y*z = 1 (mod n).

Original entry on oeis.org

1, 1, 2, 1, 4, 2, 7, 2, 4, 4, 11, 2, 13, 7, 8, 3, 17, 4, 19, 4, 14, 11, 23, 4, 20, 13, 11, 7, 29, 8, 31, 6, 22, 17, 28, 4, 37, 19, 26, 8, 41, 14, 43, 11, 16, 23, 47, 6, 49, 20, 34, 13, 53, 11, 44, 14, 38, 29, 59, 8, 61, 31, 28, 11, 52, 22, 67, 17, 46, 28, 71, 8, 73, 37, 40, 19, 77, 26
Offset: 1

Author

W. Edwin Clark, Sep 22 2024

Keywords

Comments

The values of n for which a(n) = n seem to be A007775, but I have no proof of this.

Crossrefs

Programs

  • Maple
    a:=proc(n)
    local x,y,z,N;
    N:=NULL;
    for x from 0 to n-1 do
     for y from x to n-1 do
      for z from y to n-1 do
       if (x*y*z) mod n = 1 mod n then N:=N,(x+y+z) mod n; fi;
      od:
     od:
    od:
    nops({N});
    end:
  • PARI
    a(n)=my(v=vectorsmall(n)); for(x=1,n, if(gcd(x,n)>1, next); for(y=1,x, if(gcd(y,n)>1, next); my(z=1/Mod(x*y,n)); v[lift(x+y+z)+1]=1)); sum(i=1,n, v[i]) \\ Charles R Greathouse IV, Sep 23 2024
  • Python
    def A376318(n):
        s = set()
        for x in range(n):
            for y in range(x,n):
                try:
                    s.add((x+y+pow(x*y%n,-1,n))%n)
                except:
                    continue
        return len(s) # Chai Wah Wu, Sep 23 2024
    

A376427 The number of distinct values of x+y+z+w (mod n) when x*y*z*w = 1 (mod n).

Original entry on oeis.org

1, 1, 3, 1, 5, 3, 7, 2, 5, 5, 11, 3, 13, 7, 15, 4, 17, 5, 19, 5, 21, 11, 23, 6, 25, 13, 15, 7, 29, 15, 31, 8, 33, 17, 35, 5, 37, 19, 39, 10, 41, 21, 43, 11, 25, 23, 47, 12, 49, 25, 51, 13, 53, 15, 55, 14, 57, 29, 59, 15, 61, 31, 35, 16, 65, 33, 67, 17, 69, 35, 71, 10, 73, 37, 75, 19, 77, 39, 79, 20, 45, 41, 83, 21, 85, 43, 87, 22, 89, 25
Offset: 1

Author

W. Edwin Clark, Sep 22 2024

Keywords

Comments

The values of n for which a(n) = n seem to agree with A325128. But I have no proof.

Crossrefs

Programs

  • Maple
    a:=proc(n)
    local x,y,z,w,N;
    N:={};
    for x from 0 to n-1 do
     for y from x to n-1 do
      for z from y to n-1 do
       for w from z to n-1 do
         if (x*y*z*w) mod n = 1 mod n then N:=N union {(x+y+z+w) mod n}; fi;
       od:
      od:
     od:
    od:
    nops(N);
    end:
  • Python
    def A376427(n):
        s = set()
        for x in range(n):
            for y in range(x,n):
                xy, xyp = x*y%n, (x+y)%n
                for z in range(y,n):
                    try:
                        s.add((xyp+z+pow(xy*z%n,-1,n))%n)
                    except:
                        continue
        return len(s) # Chai Wah Wu, Sep 23 2024

A376296 The number of solutions x<=y<=z<=w in Z/(n) of the equation x+y+z+w = x*y*z*w.

Original entry on oeis.org

1, 2, 6, 7, 14, 18, 27, 34, 51, 59, 91, 96, 134, 136, 208, 203, 285, 261, 385, 373, 493, 487, 650, 616, 818, 750, 949, 947, 1240, 1146, 1517, 1397, 1766, 1662, 2089, 1824, 2443, 2309, 2723, 2638, 3311, 2977, 3801, 3482, 4024, 3962, 4900, 4382, 5525, 5023, 6078
Offset: 1

Author

W. Edwin Clark, Sep 19 2024

Keywords

Crossrefs

Programs

  • Maple
    a:=proc(n)
    local x,y,z,w,N;
    N:=0:
    for x from 0 to n-1 do
     for y from x to n-1 do
      for z from y to n-1 do
       for w from z to n-1 do
        if (x+y+z+w-x*y*z*w) mod n = 0 then N:=N + 1; fi;
       od:
      od:
     od:
    od:
    N;
    end:
  • Python
    def A376296(n):
        c = 0
        for x in range(n):
            for y in range(x,n):
                xy,xyp = x*y%n,(x+y)%n
                for z in range(y,n):
                    xyz, xyzp = xy*z%n-1,(xyp+z)%n
                    c += sum(not (xyz*w-xyzp)%n for w in range(z,n))
        return c # Chai Wah Wu, Sep 19 2024

A376183 The number of solutions x<=y<=z in Z/(n) of the equation x+y+z = x*y*z.

Original entry on oeis.org

1, 3, 2, 4, 7, 8, 10, 13, 13, 31, 24, 20, 37, 44, 38, 47, 59, 59, 66, 86, 53, 108, 96, 77, 137, 171, 100, 120, 159, 186, 170, 179, 135, 279, 230, 172, 253, 312, 220, 337, 307, 259, 322, 306, 331, 456, 384, 303, 369, 669, 366, 500, 503, 488, 588, 469, 409, 767, 600
Offset: 1

Author

W. Edwin Clark, Sep 14 2024

Keywords

Comments

Suggested by a discussion initiated by Keith F. Lynch on the MathFun mailing list Sept 8, 2024 about when sums and products of real numbers x,y,z are integers and later raising other similar questions.

Programs

  • Maple
    a:=proc(n)
    local x,y,z,w,N;
    N:=0:
    for x from 0 to n-1 do
     for y from x to n-1 do
      for z from y to n-1 do
       if (x+y+z-x*y*z) mod n = 0 then N:=N + 1; fi;
      od:
     od:
    od:
    N;
    end:
  • PARI
    a(n) = sum(x=0, n-1, sum(y=x, n-1, sum(z=y, n-1, Mod(x+y+z-x*y*z, n)==0))); \\ Michel Marcus, Sep 15 2024
    
  • Python
    def A376183(n):
        c = 0
        for x in range(n):
            for y in range(x,n):
                xy,xyp = x*y%n-1,(x+y)%n
                c += sum(not (xy*z-xyp)%n for z in range(y,n))
        return c # Chai Wah Wu, Sep 19 2024

Extensions

More terms from Hugo Pfoertner, Sep 15 2024

A375625 Number of distinct values taken by F(p) = Sum (|i-j| - |p(i)-p(j)|)^2 where the sum is over all 1 <= i < j <= n, for all permutations p in the symmetric group S_n.

Original entry on oeis.org

1, 1, 1, 2, 4, 10, 17, 51, 55, 160, 140, 389, 300, 795, 566, 1290
Offset: 0

Author

W. Edwin Clark, Aug 21 2024

Keywords

Comments

The function F was defined by Dan Asimov on the Mailing list Math-Fun on Aug. 18, 2024.

Crossrefs

Programs

  • Maple
    F:= S-> add(add((j-i-abs(S[j]-S[i]))^2, i=1..j-1), j=2..nops(S)):
    a:= n-> nops({map(F, combinat[permute](n))[]}):
    seq(a(n), n=0..10);

Extensions

a(11)-a(13) from Hugo Pfoertner, Aug 24 2024
a(14)-a(15) from Hugo Pfoertner, Sep 04 2024

A375623 Maximum value of F(p) = Sum (|i-j| - |p(i)-p(j)|)^2 where the sum is over all 1 <= i < j <= n, for all permutations p in the symmetric group S_n.

Original entry on oeis.org

0, 0, 0, 2, 12, 30, 72, 132, 240, 380, 600, 870, 1260, 1722, 2532, 3080
Offset: 0

Author

W. Edwin Clark, Aug 21 2024

Keywords

Comments

The function F was defined by Dan Asimov on the Mailing list Math-Fun on Aug. 18, 2024. It can be considered as a sort of entropy of a permutation p like the function Sum_{k=1..n} (p(k)-k)^2 in A126972.
The terms for even n seem to agree with A047928.

Crossrefs

Programs

  • Maple
    F := proc(S) local i, j, M;
    M := 0;
    for j from 1 to nops(S) do
        for i from 1 to j-1 do
          M := M + (abs(i - j) - abs(S[i] - S[j]))^2
        od:
    od: M end:
    a := proc(n) local P, m, u, mm;
    P := combinat:-permute(n);
    m := 0;
    for u in P do
       mm := F(u);
       if mm > m then m := mm fi;
    od: m end:
  • PARI
    a375623(n) = my(m=0); forperm(n, p, m=max(m, sum(i=1,n, sum(j=1,i-1,(abs(i-j)-abs(p[i]-p[j]))^2)))); m \\ Hugo Pfoertner, Aug 22 2024

Extensions

a(11)-a(13) from Hugo Pfoertner, Aug 23 2024
a(14) from Markus Sigg, Aug 25 2024
a(15) from Hugo Pfoertner, Sep 04 2024

A346663 The number of nonreal roots of Sum_{k=0..n} prime(k+1)*x^k.

Original entry on oeis.org

0, 0, 2, 2, 4, 4, 6, 6, 8, 8, 10, 10, 12, 12, 14, 14, 16, 16, 18, 18, 20, 20, 22, 22, 24, 24, 26, 26, 28, 28, 30, 30, 32, 32, 34, 34, 36, 36, 38, 38, 40, 40, 42, 42, 44, 44, 46, 46, 48, 48, 50, 50, 52, 52, 54, 54, 56, 56, 58, 58, 60, 60, 62, 62, 64, 64, 66, 66, 68, 68, 70, 70, 72, 72
Offset: 0

Author

W. Edwin Clark, Jul 27 2021

Keywords

Comments

This agrees with A052928 until n = 2436. a(2436) = 2434 and A052928(2436) = 2436. For n >= 2436 we have a(n) = n-2 for n even and a(n) = n - 1 for n odd, for an as yet undetermined number of n. A052928(n) = n - (n mod 2) for all n. See the paper by W. Clark and M. Shattuck linked to below.

Crossrefs