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.

A376202 Number of pairs 1 <= x <= y <= n-1 such that gcd(x,n) = gcd(y,n) = gcd(x+y,n) = 1 and 1/x + 1/y == 1/(x+y) mod n.

Original entry on oeis.org

0, 0, 2, 0, 0, 0, 6, 0, 0, 0, 0, 0, 12, 0, 0, 0, 0, 0, 18, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 30, 0, 0, 0, 0, 0, 36, 0, 24, 0, 0, 0, 42, 0, 0, 0, 0, 0, 42, 0, 0, 0, 0, 0, 0, 0, 36, 0, 0, 0, 60, 0, 0, 0, 0, 0, 66, 0, 0, 0, 0, 0, 72, 0, 0, 0, 0, 0, 78, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 144, 0, 60, 0, 0, 0, 96, 0, 0, 0, 0, 0, 102, 0, 0
Offset: 1

Views

Author

Tom Duff and N. J. A. Sloane, Oct 06 2024

Keywords

Comments

In general, 1/x + 1/y = 1/(x+y) is the wrong way to add fractions!
See A376203 for a(2*n-1)/2 and A376755 for a(6*n+1)/6.
From Robert Israel, Nov 06 2024: (Start)
If a(n) = 0 then a(m) = 0 whenever m is a multiple of n.
It appears that the primes p for which a(p) > 0 are A007645. (End)

Examples

			For n = 3 the a(3) = 2 solutions are (x,y) = (1,1) and (2,2).
For n = 7 the a(7) = 6 solutions are (x,y) = (1,2), (1,4), (2,4), (3,5), (3,6), (5,6).
		

Crossrefs

Programs

  • Maple
    a:=[];
    for n from 1 to 140 do
    c:=0;
    for y from 1 to n-1 do
    for x from 1 to y do
    if gcd(y,n) = 1 and gcd(x,n) = 1 and gcd(x+y,n) = 1  and (1/x + 1/y - 1/(x+y)) mod n = 0 then c:=c+1; fi;
    od: # od x
    od: # od y
    a:=[op(a),c];
    od: # od n
    a;
  • Python
    from math import gcd
    def A376202(n):
        c = 0
        for x in range(1,n):
            if gcd(x,n) == 1:
                for y in range(x,n):
                    if gcd(y,n)==gcd(z:=x+y,n)==1 and not (w:=z**2-x*y)//gcd(w,x*y*z)%n:
                        c += 1
        return c # Chai Wah Wu, Oct 06 2024

A376755 a(n) = A376202(6*n+1)/6.

Original entry on oeis.org

1, 2, 3, 0, 5, 6, 7, 7, 0, 10, 11, 12, 13, 0, 24, 16, 17, 18, 0, 0, 21, 36, 23, 0, 25, 26, 27, 26, 0, 30, 0, 32, 33, 0, 35, 60, 37, 38, 0, 40, 72, 0, 72, 0, 45, 46, 47, 0, 0, 84, 51, 52, 0, 0, 55, 56, 49, 58, 0, 57, 61, 62, 63, 0, 0, 66, 120, 68, 0, 70, 120, 72
Offset: 1

Views

Author

Tom Duff and N. J. A. Sloane, Oct 06 2024

Keywords

Crossrefs

Programs

  • Python
    from math import gcd
    def A376755(n):
        c, m = 0, 6*n|1
        for x in range(1,m):
            if gcd(x,m) == 1:
                for y in range(x,m):
                    if gcd(y,m)==gcd(z:=x+y,m)==1 and not (w:=z**2-x*y)//gcd(w,x*y*z)%m:
                        c += 1
        return c//6 # Chai Wah Wu, Oct 06 2024

Extensions

a(51)-a(72) from Chai Wah Wu, Oct 06 2024

A376756 Number of pairs 0 <= x <= y <= n-1 such that x^2 + x*y + y^2 == 0 (mod n).

Original entry on oeis.org

1, 1, 3, 3, 1, 3, 7, 3, 6, 1, 1, 9, 13, 7, 3, 10, 1, 6, 19, 3, 21, 1, 1, 9, 15, 13, 18, 27, 1, 3, 31, 10, 3, 1, 7, 21, 37, 19, 39, 3, 1, 21, 43, 3, 6, 1, 1, 30, 70, 15, 3, 51, 1, 18, 1, 27, 57, 1, 1, 9, 61, 31, 60, 36, 13, 3, 67, 3, 3, 7, 1, 21, 73, 37, 45, 75, 7, 39, 79, 10, 45, 1, 1, 81, 1, 43, 3, 3, 1, 6, 163, 3, 93, 1, 19, 30, 97
Offset: 1

Views

Author

Tom Duff and N. J. A. Sloane, Oct 06 2024

Keywords

Crossrefs

Programs

  • Python
    def A376756(n):
        c = 0
        for x in range(n):
            z = x**2%n
            for y in range(x,n):
                if not (z+y*(x+y))%n:
                    c += 1
        return c # Chai Wah Wu, Oct 06 2024

A376757 Number of pairs 0 <= x <= y <= n-1 such that x^3 == y^3 (mod n).

Original entry on oeis.org

1, 2, 3, 5, 5, 6, 13, 14, 18, 10, 11, 15, 25, 26, 15, 28, 17, 36, 37, 25, 39, 22, 23, 42, 35, 50, 81, 71, 29, 30, 61, 72, 33, 34, 65, 99, 73, 74, 75, 70, 41, 78, 85, 55, 90, 46, 47, 84, 112, 70, 51, 137, 53, 162, 55, 218, 111, 58, 59, 75, 121, 122, 288, 208, 125, 66, 133, 85, 69, 130, 71, 306, 145, 146, 105, 203, 143, 150, 157
Offset: 1

Views

Author

Tom Duff and N. J. A. Sloane, Oct 06 2024

Keywords

Comments

A087786 includes pairs (x,y) with x>y (which are excluded from the present sequence).

Crossrefs

Programs

  • PARI
    a(n) = sum(x=0, n-1, sum(y=x, n-1, Mod(x, n)^3 == Mod(y, n)^3)); \\ Michel Marcus, Oct 06 2024
    
  • Python
    from collections import Counter
    def A376757(n): return sum(d*(d+1)>>1 for d in Counter(pow(x,3,n) for x in range(n)).values()) # Chai Wah Wu, Oct 06 2024
Showing 1-4 of 4 results.