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: Tom Duff

Tom Duff's wiki page.

Tom Duff has authored 8 sequences.

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

Author

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

Keywords

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

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

Author

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

Keywords

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

A376203 a(n) = A376202(2*n-1)/2.

Original entry on oeis.org

0, 1, 0, 3, 0, 0, 6, 0, 0, 9, 6, 0, 0, 0, 0, 15, 0, 0, 18, 12, 0, 21, 0, 0, 21, 0, 0, 0, 18, 0, 30, 0, 0, 33, 0, 0, 36, 0, 0, 39, 0, 0, 0, 0, 0, 72, 30, 0, 48, 0, 0, 51, 0, 0, 54, 36, 0, 0, 0, 0, 0, 0, 0, 63, 42, 0, 108, 0, 0, 69
Offset: 1

Author

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

Keywords

Programs

  • Python
    from math import gcd
    def A376203(n):
        c, m = 0, (n<<1)-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>>1 # Chai Wah Wu, Oct 06 2024

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

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).
		

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

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

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).

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

A330522 First quadrisection of A332843.

Original entry on oeis.org

15, 19, 150, 182, 191, 195, 199, 1500, 1819, 1950, 1981, 1991, 1995, 1999, 15000, 18182, 19091, 19500, 19802, 19901, 19950, 19981, 19991, 19995, 19999, 150000, 181819, 195000, 198020, 199010, 199091, 199500, 199801, 199901, 199950, 199981, 199991, 199995
Offset: 1

Author

Tom Duff and Eric Angelini, Mar 01 2020

Keywords

Crossrefs

Cf. A332843.

Programs

  • PARI
    See Links section.

Extensions

More terms from Rémy Sigrist, Jun 29 2021

A332843 Lexicographically earliest sequence of positive terms such that a(4n+1) is the sum of the next three terms, those three terms having the property that each of them is a substring of a(4n+1).

Original entry on oeis.org

15, 5, 5, 5, 19, 1, 9, 9, 150, 50, 50, 50, 182, 18, 82, 82, 191, 9, 91, 91, 195, 5, 95, 95, 199, 1, 99, 99, 1500, 500, 500, 500, 1819, 181, 819, 819, 1950, 50, 950, 950, 1981, 19, 981, 981, 1991, 9, 991, 991, 1995, 5, 995, 995, 1999, 1, 999, 999, 15000, 5000, 5000, 5000, 18182, 1818, 8182, 8182
Offset: 1

Author

Eric Angelini and Tom Duff, Feb 26 2020

Keywords

Comments

The sequence is infinite as one can always multiply a(4n+1) by 10 and do the same with the next three terms. It is conjectured that at least two of those three terms must be equal.

Examples

			For n = 0, we have a(4n+1) = a(1) = 15 and 15 is the sum 5 + 5 + 5, those last three terms being a(2), a(3), a(4) and substrings of a(1);
For n = 3, we have a(4n+1) = a(13) = 182 and 182 is the sum 18 + 82 + 82, those last three terms being a(14), a(15), a(16) and substrings of a(13).
		

A001082 Generalized octagonal numbers: k*(3*k-2), k=0, +- 1, +- 2, +-3, ...

Original entry on oeis.org

0, 1, 5, 8, 16, 21, 33, 40, 56, 65, 85, 96, 120, 133, 161, 176, 208, 225, 261, 280, 320, 341, 385, 408, 456, 481, 533, 560, 616, 645, 705, 736, 800, 833, 901, 936, 1008, 1045, 1121, 1160, 1240, 1281, 1365, 1408, 1496, 1541, 1633, 1680, 1776, 1825, 1925, 1976
Offset: 1

Keywords

Comments

Numbers of the form 3*m^2+2*m, m an integer.
3*a(n) + 1 is a perfect square.
a(n) mod 10 belongs to a periodic sequence: 0, 1, 5, 8, 6, 1, 3, 0, 6, 5, 5, 6, 0, 3, 1, 6, 8, 5, 1, 0. - Mohamed Bouhamida, Sep 04 2009
A089801 is the characteristic function. - R. J. Mathar, Oct 07 2011
Exponents of powers of q in one form of the quintuple product identity. (-x^-2 + 1) * q^0 + (x^-3 - x) * q^1 + (-x^-5 + x^3) * q^5 + (x^-6 - x^4) * q^8 + ... = Sum_{n>=0} q^(3*n^2 + 2*n) * (x^(3*n) - x^(-3*n - 2)) = Product_{k>0} (1 - x * q^(2*k - 1)) * (1 - x^-1 * q^(2*k - 1)) * (1 - q^(2*k)) * (1 - x^2 * q^(4*k)) * (1 - x^-2 * q^(4*k - 4)). - Michael Somos, Dec 21 2011
The offset 0 would also be valid here, all other entries of generalized k-gonal numbers have offset 0 (see cross references). - Omar E. Pol, Jan 12 2013
Also, x values of the Diophantine equation x(x+3)+(x+1)(x+2) = (x+y)^2+(x-y)^2. - Bruno Berselli, Mar 29 2013
Numbers n such that Sum_{i=1..n} 2*i*(n-i)/n is an integer (the addend is the harmonic mean of i and n-i). - Wesley Ivan Hurt, Sep 14 2014
Equivalently, integers of the form m*(m+2)/3 (nonnegative values of m are listed in A032766). - Bruno Berselli, Jul 18 2016
Exponents of q in the expansion of Sum_{n >= 0} ( q^n * Product_{k = 1..n} (1 - q^(2*k-1)) ) = 1 + q - q^5 - q^8 + q^16 + q^21 - - + + .... - Peter Bala, Dec 03 2020
Exponents of q in the expansion of Product_{n >= 1} (1 - q^(6*n))*(1 + q^(6*n-1))*(1 + q^(6*n-5)) = 1 + q + q^5 + q^8 + q^16 + q^21 + .... - Peter Bala, Dec 09 2020
Exponents of q in the expansion of Product_{n >= 1} (1 - q^n)^2*(1 - q^(4*n))^2 /(1 - q^(2*n)) = 1 - 2*q + 4*q^5 - 5*q^8 + 7*q^16 - + ... (a consequence of the quintuple product identity). The series coefficients are a signed version of A001651. - Peter Bala, Feb 16 2021
From Peter Bala, Nov 26 2024: (Start)
Apart from the first two terms, the exponents of q in the expansion of Sum_{n >= 1} q^(3*n+2) * (Product_{k = 2..n} 1 - q^(2*k-1)) = q^5 + q^8 - q^16 - q^21 + + - - ... (in Andrews, equation 8, replace q with q^2 and set x = q).
Exponents of q^2 in the expansion of Sum_{n >= 0} q^n / (Product_{k = 1..n+1 } 1 + q^(2*k-1)) = 1 + (q^2)^1 - (q^2)^5 - (q^2)^8 + (q^2)^16 + (q^2)^21 - - + + ... (Chen, equation 22). (End)

Examples

			For the ninth comment: 65 is in the sequence because 65 = 13*(13+2)/3 or also 65 = -15*(-15+2)/3. - _Bruno Berselli_, Jul 18 2016
		

Crossrefs

Partial sums of A022998.
Column 4 of A195152. A045944.
Sequences of generalized k-gonal numbers: A001318 (k=5), A000217 (k=6), A085787 (k=7), this sequence (k=8), A118277 (k=9), A074377 (k=10), A195160 (k=11), A195162 (k=12), A195313 (k=13), A195818 (k=14), A277082 (k=15), A274978 (k=16), A303305 (k=17), A274979 (k=18), A303813 (k=19), A218864 (k=20), A303298 (k=21), A303299 (k=22), A303303 (k=23), A303814 (k=24), A303304 (k=25), A316724 (k=26), A316725 (k=27), A303812 (k=28), A303815 (k=29), A316729 (k=30).
Cf. sequences of the form m*(m+k)/(k+1) listed in A274978. [Bruno Berselli, Jul 25 2016]

Programs

  • Haskell
    a001082 n = a001082_list !! n
    a001082_list = scanl (+) 0 $ tail a022998_list
    -- Reinhard Zumkeller, Mar 31 2012
    
  • Magma
    [n^2 - n - Floor(n/2)^2 : n in [1..50]]; // Wesley Ivan Hurt, Sep 14 2014
  • Maple
    seq(n*(n-1)-floor(n/2)^2, n=1..51); # Gary Detlefs, Feb 23 2010
  • Mathematica
    Table[If[EvenQ[n], n*(3*n-4)/4, (n-1) (3*n+1)/4], {n, 100}]
    LinearRecurrence[{1,2,-2,-1,1},{0,1,5,8,16},60] (* Harvey P. Dale, Feb 03 2024 *)
  • PARI
    {a(n) = if( n%2, (n-1) * (3*n + 1) / 4, n * (3*n - 4) / 4)};
    

Formula

a(n) = n*(3*n-4)/4 if n even, (n-1)*(3*n+1)/4 if n odd.
a(n) = n^2 - n - floor(n/2)^2.
G.f.: Sum_{n>=0} (-1)^n*[x^(a(2n+1)) + x^(a(2n+2))] = 1/1 - (x-x^2)/1 - (x^2-x^4)/1 - (x^3-x^6)/1 - ... - (x^k - x^(2k))/1 - ... (continued fraction where k=1..inf). - Paul D. Hanna, Aug 16 2002
a(n+1) = ceiling(n/2)^2 + A046092(floor(n/2)).
a(2n) = n(3n-2) = A000567(n), a(2n+1) = n(3n+2) = A045944(n). - Mohamed Bouhamida, Nov 06 2007
O.g.f.: -x^2*(x^2+4*x+1)/((x-1)^3*(1+x)^2). - R. J. Mathar, Apr 15 2008
a(n) = n^2+n-ceiling(n/2)^2 with offset 0 and a(0)=0. - Gary Detlefs, Feb 23 2010
a(n) = (6*n^2-6*n-1-(2*n-1)*(-1)^n)/8. - Luce ETIENNE, Dec 11 2014
E.g.f.: (3*x^2*exp(x) + x*exp(-x) - sinh(x))/4. - Ilya Gutkovskiy, Jul 15 2016
Sum_{n>=2} 1/a(n) = (9 + 2*sqrt(3)*Pi)/12. - Vaclav Kotesovec, Oct 05 2016
Sum_{n>=2} (-1)^n/a(n) = 3*log(3)/2 - 3/4. - Amiram Eldar, Feb 28 2022

Extensions

New sequence name from Matthew Vandermast, Apr 10 2003
Editorial changes by N. J. A. Sloane, Feb 03 2012
Edited by Omar E. Pol, Jun 09 2012