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

A088534 Number of representations of n by the quadratic form x^2 + xy + y^2 with 0 <= x <= y.

Original entry on oeis.org

1, 1, 0, 1, 1, 0, 0, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 1, 0, 0, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 2, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 2, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0
Offset: 0

Views

Author

Benoit Cloitre, Nov 16 2003

Keywords

Comments

Also, apparently the number of 6-regular plane graphs with n vertices that have only trigonal faces and loops ("({1,3},6)-spheres" from the paper by Michel Deza and Mathieu Dutour Sikiric). - Andrey Zabolotskiy, Dec 22 2021

Examples

			From _M. F. Hasler_, Mar 05 2018: (Start)
a(0) = a(1) = 1 since 0 = 0^2 + 0*0 + 0^2 and 1 = 0^2 + 0*1 + 1^2.
a(2) = 0 since 2 cannot be written as x^2 + xy + y^2.
a(49) = 2 since 49 = 0^2 + 0*7 + 7^2 = 3^2 + 3*5 + 5^2. (End)
		

References

  • B. C. Berndt, "On a certain theta-function in a letter of Ramanujan from Fitzroy House", Ganita 43 (1992), 33-43.

Crossrefs

Cf. A118886 (indices of values > 1), A198772 (indices of 1's), A198773 (indices of 2's), A198774 (indices of 3's), A198775 (indices of 4's), A198799 (index of 1st term = n).
Cf. A215622.

Programs

  • Haskell
    a088534 n = length
       [(x,y) | y <- [0..a000196 n], x <- [0..y], x^2 + x*y + y^2 == n]
    a088534_list = map a088534 [0..]
    -- Reinhard Zumkeller, Oct 30 2011
    
  • Julia
    function A088534(n)
        n % 3 == 2 && return 0
        M = Int(round(2*sqrt(n/3)))
        count = 0
        for y in 0:M, x in 0:y
            n == x^2 + y^2 + x*y && (count += 1)
        end
        return count
    end
    A088534list(upto) = [A088534(n) for n in 0:upto]
    A088534list(104) |> println # Peter Luschny, Mar 17 2018
    
  • Mathematica
    a[n_] := Sum[Boole[i^2 + i*j + j^2 == n], {i, 0, n}, {j, 0, i}];
    Table[a[n], {n, 0, 104}] (* Jean-François Alcover, Jun 20 2018 *)
  • PARI
    a(n)=sum(i=0,n,sum(j=0,i,if(i^2+i*j+j^2-n,0,1)))
    
  • PARI
    A088534(n,d)=sum(x=0,sqrt(n\3),sum(y=max(x,sqrtint(n-x^2)\2),sqrtint(n-2*x^2),x^2+x*y+y^2==n&&(!d||!printf("%d",[x,y]))))\\ Set 2nd arg = 1 to print all decompositions, with 0 <= x <= y. - M. F. Hasler, Mar 05 2018
    
  • Python
    def A088534(n):
        c = 0
        for y in range(n+1):
            if y**2 > n:
                break
            for x in range(y+1):
                z = x*(x+y)+y**2
                if z > n:
                    break
                elif z == n:
                    c += 1
        return c # Chai Wah Wu, May 16 2022

Formula

a(A003136(n)) > 0; a(A034020(n)) = 0;
a(A118886(n)) > 1; a(A198772(n)) = 1;
a(A198773(n)) = 2; a(A198774(n)) = 3;
a(A198775(n)) = 4;
a(A198799(n)) = n and a(m) <> n for m < A198799(n). - Reinhard Zumkeller, Oct 30 2011, corrected by M. F. Hasler, Mar 05 2018
In the prime factorization of n, let S_1 be the set of distinct prime factors p_i for which p_i == 1 (mod 3), let S_2 be the set of distinct prime factors p_j for which p_j == 2 (mod 3), and let M be the exponent of 3. Then n = 3^M * (Product_{p_i in S_1} p_i ^ e_i) * (Product_{p_j in S_2} p_j ^ e_j), and the number of solutions for x^2 + xy + y^2 = n, 0 <= x <= y is floor((Product_{p_i in S_1} (e_i + 1) + 1) / 2) if all e_j are even and 0 otherwise. E.g. a(1729) = 4 since 1729 = 7^1*13^1*19^1 and floor(((1+1)*(1+1)*(1+1)+1)/2) = 4. - Seth A. Troisi, Jul 02 2020
a(n) = ceiling(A004016(n)/12) = (A002324(n) + A145377(n)) / 2. - Andrey Zabolotskiy, Dec 23 2021

Extensions

Edited by M. F. Hasler, Mar 05 2018

A230655 Squared radii of circles around a point of the hexagonal lattice that contain a record number of lattice points.

Original entry on oeis.org

0, 1, 7, 49, 91, 637, 1729, 8281, 12103, 53599, 157339, 375193, 1983163, 4877509, 13882141, 85276009, 180467833, 596932063, 3428888827, 4178524441, 7760116819, 29249671087, 36412855843, 147442219561, 254889990901, 473367125959, 1784229936307, 2439661341481
Offset: 1

Views

Author

Hugo Pfoertner, Oct 27 2013

Keywords

Comments

It appears that this is also the sequence of numbers with a record number of divisors all of whose prime factors are of the form 3k + 1. - Amiram Eldar, Sep 12 2019 [This is correct, see A343771. - Jianing Song, May 19 2021]
Indices of records of A004016. Apart from the first term, also indices of records of A002324. - Jianing Song, May 20 2021

Examples

			a(2)=7 because a circle with radius sqrt(7) around the lattice point at (0,0) is the first circle that passes through more lattice points than a circle with radius 1, which passes through 6 points. The 12 hit points are (+-1/2,+-3*sqrt(3)/2), (+-2,+-sqrt(3)), (+-5/2, +-sqrt(3)/2).
		

Crossrefs

Cf. A003136 (all occurring squared radii), A198799 (common terms), A230656 (index positions of records), A344472 (records).
Apart from the first term, subsequence of A343771.
Indices of records of Sum_{d|n} kronecker(m, d): this sequence (m=-3), A071383 (m=-4, similar sequence for square lattice), A279541 (m=-6).

Programs

  • PARI
    my(v=list_A344473(10^15), rec=0); print1(0, ", "); for(n=1, #v, if(numdiv(v[n])>rec, rec=numdiv(v[n]); print1(v[n], ", "))) \\ Jianing Song, May 20 2021, see program for A344473

Extensions

Offset corrected by Jianing Song, May 20 2021

A300419 Smallest nonnegative number k such that k can be written in exactly n ways as x^2 + xy + y^2 where x and y are positive integers, with x >= y.

Original entry on oeis.org

0, 3, 91, 637, 1729, 24843, 12103, 405769, 53599, 157339, 593047, 59648043, 375193, 2989441, 8968323, 7709611, 1983163, 3360173089, 4877509, 2339177536969, 18384457, 377770939, 146482609, 439447827, 13882141, 1302924259
Offset: 0

Views

Author

Keywords

Comments

Except a(0) and a(1), all terms are in A118886.
First positive square term of this sequence is a(7) = 405769 = a(3)^2.
a(3), a(7) = a(3)^2 and a(13) = a(4)^2 are also the sum of two nonzero squares in exactly one way.
a(18) = 4877509, a(20) = 18384457, a(22) = 146482609, a(24) = 13882141, a(27) = 92672671, a(30) = 238997941, a(32) = 85276009, a(36) = 180467833. - Robert G. Wilson v, Mar 06 2018

Examples

			a(2) = 91 because 91 = 1^2 + 1*9 + 9^2 = 5^2 + 5*6 + 6^2 and 91 is the least number with this property.
		

Crossrefs

Programs

  • Mathematica
    nmx = 4750; t = Split@ Sort@ Flatten@ Table[x^2 + x*y + y^2, {x, nmx}, {y, x, nmx}]; lmt = 1 + Length@ t; f[n_] := Block[{k = 1}, While[Length@ t[[k]] != n && k < lmt, k++]; t[[k]][[1]]]; Array[f, 16] (* Robert G. Wilson v, Mar 06 2018 *)
  • PARI
    N(n,d)=sum(x=1,sqrt(n\3),sum(y=max(x,sqrtint(n-x^2)\2),sqrtint(n-2*x^2),x^2+x*y+y^2==n&&!(d&&printf("%d",[x,y])))) \\ Set 2nd arg = 1 to display all decompositions.
    a(n)=for(k=0,oo,N(k)==n&&return(k))

Formula

If A198799(n) is not a square and there is no square s < A198799(n) such that A088534(s) = n + 1, then a(n) = A198799(n), for all n > 0.
If A198799(n+1) is a square, then a(n) <= A198799(n+1).

Extensions

a(17)-a(18) from Giovanni Resta, Mar 16 2018
a(19)-a(25) from Bert Dobbelaere, Feb 18 2023

A374275 Smallest k such that k can be written in exactly n ways as x^2 + 3*x*y + y^2 with 0 <= x <= y.

Original entry on oeis.org

2, 0, 121, 2299, 6061, 43681, 66671, 33659659, 187891, 1266749, 8067191, 639533521, 2066801
Offset: 0

Views

Author

Seiichi Manyama, Jul 02 2024

Keywords

Comments

a(n) is the smallest nonnegative k such that A374276(k) = n.
a(14) = 36735721.
a(15) = 153276629.
a(16) = 7703531.
a(18) = 39269219.
a(20) = 250082921.
a(24) = 84738841.
a(32) = 454508329.

Crossrefs

A307109 Number of integer solutions to x^2 + x*y + y^2 <= n excluding (0,0), divided by 2.

Original entry on oeis.org

1, 1, 4, 5, 5, 5, 11, 11, 12, 12, 12, 15, 21, 21, 21, 22, 22, 22, 28, 28, 34, 34, 34, 34, 35, 35, 38, 44, 44, 44, 50, 50, 50, 50, 50, 51, 57, 57, 63, 63, 63, 63, 69, 69, 69, 69, 69, 72, 79, 79, 79, 85, 85, 85, 85, 85, 91, 91, 91, 91, 97, 97, 103, 104, 104, 104
Offset: 1

Views

Author

Hugo Pfoertner, Mar 25 2019

Keywords

Examples

			a(1)=a(2)=(2/2)=1: 2 solutions (-1,1),(1,-1);
a(3)=(8/2)=4: 2 solutions for n<3 and the 6 solutions (1,1), (-1,-1), (1,-2), (2,-1), (-1,2), (-2,1);
a(4)=a(5)=a(6)=10/2=5: 8 solutions for n<6 and the 2 solutions (-2,2), (2,-2).
		

Crossrefs

Showing 1-5 of 5 results.