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

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

Views

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

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

Views

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

A376240 a(n) = number of {x,y,z} in Z/nZ such that x+y+z = x*y*z is nonzero.

Original entry on oeis.org

0, 1, 0, 1, 4, 2, 6, 6, 6, 21, 18, 7, 30, 30, 22, 28, 50, 37, 56, 63, 30, 86, 84, 42, 120, 145, 72, 87, 144, 124, 154, 140, 98, 245, 188, 123, 234, 274, 176, 274, 286, 169, 300, 253, 270, 410, 360, 196, 336, 607, 308, 437, 476, 388, 520, 378, 344, 709, 570, 429, 630, 758, 372, 600, 882, 517, 736, 751, 524, 968, 828, 546, 900, 1153, 810, 839, 720, 912, 1026, 1140, 738, 1413, 1134, 585, 1502, 1482, 930
Offset: 1

Views

Author

M. F. Hasler, Sep 24 2024

Keywords

Comments

Similar to A376183, but the sum equal to the product is restricted to be nonzero, as to exclude many rather trivial solutions.
Counting sets {x, y, z} means that the order of the three (not necessarily distinct) values is irrelevant. Equivalently, one could use representatives with, e.g., x <= y <= z.

Examples

			For n=1, we can't have x+y+z = x*y*z nonzero because zero is the only element, so there are a(1) = 0 solutions.
For n=2, x+y+z = x*y*z != 0 implies x = y = z = 1 (in Z/2Z), so there is only one unique solution, and a(2) = 1.
For n=3, x+y+z = x*y*z != 0 is impossible: if x = y = z, the sum is zero (in Z/3Z), and 1 + 2 + z = 1*2*z <=> z = 0, so there is no solution, a(3) = 0.
For n=4, since 2*2 = 0 in Z/4Z, at most one among {x, y, z}, say z, can equal 2. In this case, x = -y = +-1, gives a solution {x, y, z} = {1, 2, 3}. One then checks that x = +-y = z = +-1 can't yield a solution, so a(4) = 1.
For n=5, we see that (x, y) = (2, 3) gives z = z, so we have a solution for any nonzero z, and exhaustive verification shows that these are no other solutions: a(5) = 4.
		

Crossrefs

Cf. A376183 (same without restriction to nonzero sum/product).

Programs

  • PARI
    apply( {A376240(n)=sum(x=1,n-1,sum(y=1,x,sum(z=1,y, (x+y+z-x*y*z)%n==0 && x*y*z%n)))}, [1..99])
    
  • Python
    def A376240(n):
        c = 0
        for x in range(1,n):
            for y in range(x,n):
                xy,xyp = x*y%n-1,n-(x+y)%n
                c += sum(not (z==xyp or (xy*z+xyp)%n) for z in range(y,n))
        return c # Chai Wah Wu, Sep 30 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

Views

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
    
Showing 1-4 of 4 results.