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.

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

This page as a plain text file.
%I A088534 #54 May 16 2022 17:32:13
%S A088534 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,
%T A088534 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,
%U A088534 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
%N A088534 Number of representations of n by the quadratic form x^2 + xy + y^2 with 0 <= x <= y.
%C A088534 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
%D A088534 B. C. Berndt, "On a certain theta-function in a letter of Ramanujan from Fitzroy House", Ganita 43 (1992), 33-43.
%H A088534 Reinhard Zumkeller, <a href="/A088534/b088534.txt">Table of n, a(n) for n = 0..10000</a>
%H A088534 Michel Deza and Mathieu Dutour Sikiric, <a href="https://doi.org/10.11650/twjm/1500406667">Zigzag and Central Circuit Structure of ({1,2,3},6)-spheres</a>, Taiwanese Journal of Mathematics, 16 (June 2012), No. 3, 913-940; see Table 1, p. 916.
%H A088534 Michel-Marie Deza, Mathieu Dutour Sikiric, and Mikhail Ivanovitch Shtogrin, <a href="https://doi.org/10.1007/978-81-322-2449-5">Geometric Structure of Chemistry-Relevant Graphs</a>, Springer, 2015; see Table 5.4 and Section 5.4.
%H A088534 Oscar Marmon, <a href="https://arxiv.org/abs/math/0508201">Hexagonal Lattice Points on Circles</a>, arXiv:math/0508201 [math.NT], 2005.
%F A088534 a(A003136(n)) > 0; a(A034020(n)) = 0;
%F A088534 a(A118886(n)) > 1; a(A198772(n)) = 1;
%F A088534 a(A198773(n)) = 2; a(A198774(n)) = 3;
%F A088534 a(A198775(n)) = 4;
%F A088534 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
%F A088534 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
%F A088534 a(n) = ceiling(A004016(n)/12) = (A002324(n) + A145377(n)) / 2. - _Andrey Zabolotskiy_, Dec 23 2021
%e A088534 From _M. F. Hasler_, Mar 05 2018: (Start)
%e A088534 a(0) = a(1) = 1 since 0 = 0^2 + 0*0 + 0^2 and 1 = 0^2 + 0*1 + 1^2.
%e A088534 a(2) = 0 since 2 cannot be written as x^2 + xy + y^2.
%e A088534 a(49) = 2 since 49 = 0^2 + 0*7 + 7^2 = 3^2 + 3*5 + 5^2. (End)
%t A088534 a[n_] := Sum[Boole[i^2 + i*j + j^2 == n], {i, 0, n}, {j, 0, i}];
%t A088534 Table[a[n], {n, 0, 104}] (* _Jean-François Alcover_, Jun 20 2018 *)
%o A088534 (PARI) a(n)=sum(i=0,n,sum(j=0,i,if(i^2+i*j+j^2-n,0,1)))
%o A088534 (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
%o A088534 (Haskell)
%o A088534 a088534 n = length
%o A088534    [(x,y) | y <- [0..a000196 n], x <- [0..y], x^2 + x*y + y^2 == n]
%o A088534 a088534_list = map a088534 [0..]
%o A088534 -- _Reinhard Zumkeller_, Oct 30 2011
%o A088534 (Julia)
%o A088534 function A088534(n)
%o A088534     n % 3 == 2 && return 0
%o A088534     M = Int(round(2*sqrt(n/3)))
%o A088534     count = 0
%o A088534     for y in 0:M, x in 0:y
%o A088534         n == x^2 + y^2 + x*y && (count += 1)
%o A088534     end
%o A088534     return count
%o A088534 end
%o A088534 A088534list(upto) = [A088534(n) for n in 0:upto]
%o A088534 A088534list(104) |> println # _Peter Luschny_, Mar 17 2018
%o A088534 (Python)
%o A088534 def A088534(n):
%o A088534     c = 0
%o A088534     for y in range(n+1):
%o A088534         if y**2 > n:
%o A088534             break
%o A088534         for x in range(y+1):
%o A088534             z = x*(x+y)+y**2
%o A088534             if z > n:
%o A088534                 break
%o A088534             elif z == n:
%o A088534                 c += 1
%o A088534     return c # _Chai Wah Wu_, May 16 2022
%Y A088534 Cf. A003136, A034020, A000196.
%Y A088534 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).
%Y A088534 Cf. A215622.
%K A088534 nonn
%O A088534 0,50
%A A088534 _Benoit Cloitre_, Nov 16 2003
%E A088534 Edited by _M. F. Hasler_, Mar 05 2018