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.

A327796 Values of x in the n solutions corresponding to the least number A300419(n) expressible in exactly n ways as x^2 + x*y + y^2 with x >= y >= 1, with x written as triangle T(n,k), k <= n. y is given in A327797.

Original entry on oeis.org

1, 6, 9, 17, 21, 23, 25, 32, 37, 40, 91, 107, 118, 143, 154, 66, 77, 89, 94, 98, 109, 392, 455, 507, 513, 552, 560, 595, 145, 163, 173, 177, 197, 207, 218, 230, 233, 255, 273, 310, 325, 335, 357, 378, 390, 462, 498, 539, 561, 623, 658, 686, 711, 717, 763
Offset: 1

Views

Author

Hugo Pfoertner, Sep 25 2019

Keywords

Comments

A combined table for the solutions corresponding to A300419(n) was provided by Robert G. Wilson v as a text file, see link.

Examples

			The triangle begins
    1,
    6,   9,
   17,  21,  23,
   25,  32,  37,  40,
   91, 107, 118, 143, 154,
   66,  77,  89,  94,  98, 109,
  392, 455, 507, 513, 552, 560, 595,
  145, 163, 173, 177, 197, 207, 218, 230
.
T(3,1)=17, T(3,2)=21, T(3,3)=23 because
A300419(3) = 637 corresponds to the 3 solutions
637 = 17^2 + 17*12 + 12^2 = 21^2 + 21*7 + 7^2 = 23^2 + 23*4 + 4^2, using the y-values 12, 7, 4 from A327797.
		

Crossrefs

A327797 Values of y in the n solutions corresponding to the least number A300419(n) expressible in exactly n ways as x^2 + x*y + y^2 with x >= y >= 1, with y written as triangle T(n,k), k <= n. x is given in A327796.

Original entry on oeis.org

1, 5, 1, 12, 7, 4, 23, 15, 8, 3, 91, 74, 61, 26, 7, 61, 49, 34, 27, 21, 2, 343, 273, 208, 200, 145, 133, 77, 122, 102, 90, 85, 58, 43, 25, 3, 225, 202, 182, 137, 117, 103, 70, 35, 13, 427, 389, 343, 317, 238, 189, 147, 107, 97, 14
Offset: 1

Views

Author

Hugo Pfoertner, Sep 25 2019

Keywords

Comments

See A327796.

Examples

			The triangle begins
    1,
    5,   1,
   12,   7,   4,
   23,  15,   8,   3,
   91,  74,  61,  26,   7,
   61,  49,  34,  27,  21,   2,
  343, 273, 208, 200, 145, 133, 77,
  122, 102,  90,  85,  58,  43, 25, 3
		

Crossrefs

A024614 Numbers of the form x^2 + xy + y^2, where x and y are positive integers.

Original entry on oeis.org

3, 7, 12, 13, 19, 21, 27, 28, 31, 37, 39, 43, 48, 49, 52, 57, 61, 63, 67, 73, 75, 76, 79, 84, 91, 93, 97, 103, 108, 109, 111, 112, 117, 124, 127, 129, 133, 139, 147, 148, 151, 156, 157, 163, 169, 171, 172, 175, 181, 183, 189, 192, 193, 196, 199, 201, 208, 211, 217, 219, 223, 228
Offset: 1

Views

Author

Keywords

Comments

Equivalently, sequence A024612 with duplicates removed; i.e., numbers of the form i^2 - i*j + j^2, where 1 <= i < j.
A subsequence of A135412, which consists of multiples (by squarefree factors) of the numbers listed here. It appears that this lists numbers > 1 which have in their factorization: (a) no even power of 3 unless there is a factor == 1 (mod 6); (b) no odd power of 2 or of a prime == 5 (mod 6) and no even power unless there is a factor 3 or == 1 (mod 6). - M. F. Hasler, Aug 17 2016
If we regroup the entries in a triangle with row lengths A004526
3,
7,
12, 13,
19, 21,
27, 28, 31,
37, 39, 43,
... it seems that the j-th row of the triangle contains the numbers i^2+j^2-i*j in row j>=2 and column i = floor((j+1)/2) .. j-1. - R. J. Mathar, Aug 21 2016
Proof of the above characterization: the sequence is the union of 3*(the squares A000290) and A024606 (numbers x^2+xy+y^2 with x > y > 0). For the latter it is known that these are the numbers with a factor p==1 (mod 6) and any prime factor == 2 (mod 3) occurring to an even power. The former (3*n^2) are the same as (odd power of 3)*(even power of any other prime factor). The union of the two cases yields the earlier characterization. - M. F. Hasler, Mar 04 2018
Least term that can be written in exactly n ways is A300419(n). - Altug Alkan, Mar 04 2018
For the general theory see the Fouvry et al. reference and A296095. Bounds used in the Julia program are based on the theorems in this paper. - Peter Luschny, Mar 10 2018

Examples

			3 = 1^2 + 1^2 + 1*1, 7 = 2^2 + 1^2 + 2*1, ...
		

Crossrefs

Cf. A003136, A007645 (prime terms), A024612, A135412, A296095, A300419.

Programs

  • Julia
    function isA024614(n)
        n % 3 >= 2 && return false
        n == 3 && return true
        M = Int(round(2*sqrt(n/3)))
        for y in 2:M, x in 1:y
            n == x^2 + y^2 + x*y && return true
        end
        return false
    end
    A024614list(upto) = [n for n in 1:upto if isA024614(n)]
    println(A024614list(228)) # Peter Luschny, Mar 02 2018 updated Mar 17 2018
    
  • Maple
    isA024614 := proc(n)
        local i,j,disc;
        # n=i^2+j^2-i*j = (j-i)^2+i*j, 1<=i=1 and i*j>=j and i^2+j^2-i*j >= 1+j max search radius
        for j from 2 to n-1 do
            # i=(j +- sqrt(4n-3j^2))/2
            disc := 4*n-3*j^2 ;
            if disc >= 0 then
                if issqr(disc) then
                    i := (j+sqrt(disc))/2 ;
                    if type(i,'integer') and i >= 1 and i= 1 and iA024614(t) then
            printf("%d %d\n",n,t) ;
            n := n+1 ;
        end if;
    end do: # R. J. Mathar, Aug 21 2016
    # second Maple program:
    a:= proc(n) option remember; local k, x;
          for k from a(n-1)+1 do for x while x^2 x^2+(x+y)*y=k)((isqrt(4*k-3*x^2)-x)/2) then return k fi
          od od
        end: a(0):=0:
    seq(a(n), n=1..200);  # Alois P. Heinz, Mar 02 2018
  • Mathematica
    max = 228; T0 = {}; xm = Ceiling[Sqrt[max]]; While[T = T0; T0 = Table[x^2 + x y + y^2, {x, 1, xm}, {y, x, xm}] // Flatten // Union // Select[#, # <= max&]&; T != T0, xm = 2 xm]; T (* Jean-François Alcover, Mar 23 2018 *)
  • PARI
    is(n)={n>2&&!for(i=1, #n=Set(Col(factor(n)%6))/*consider prime factors mod 6*/, n[i][1]>1||next/*skip factors = 1 mod 6*/; /* odd power: ok only if p=3 */n[i][2]%2&&(n[i][1]!=3 || next) && return; /*even power: ok if there's a p==1, listed first*/ n[1][1]==1 || /*also ok if it's not a 3 and if there's a 3 elsewhere */ (n[i][1]==2 && i<#n && n[i+1][1]==3) || (n[i][1]>3 && for(j=1,i-1,n[j][1]==3 && next(2))||return))} \\ M. F. Hasler, Aug 17 2016, documented & bug fixed (following an observation by Altug Alkan) Mar 04 2018
    
  • PARI
    is(n)={(n=factor(n))||return/*n=1*/; /*exponents % 2, primes % 3*/ n[,2]%=2; n[,1]%=3; (n=Set(Col(n))) /*odd power of a prime == 2? will be last*/ [#n][2] && n[#n][1]==2 && return; /*factor == 1? will be 1st or after 3*/ n[1+(!n[1][1] && #n>1)][1]==1 || /*thrice a square?*/ (!n[1][1]&&n[1][2]&&!for(i=2,#n,n[i][2]&&return))} \\ Alternate code, 5% slower, maybe a bit less obscure. - M. F. Hasler, Mar 04 2018
    
  • PARI
    N=228; v=vector(N);
    for(x=1,N, x2=x*x; if(x2>N,break); for(y=x,N, t=x2+y*(x+y); if(t>N,break); v[t]=1;));
    for(n=1,N,if(v[n],print1(n,", "))); \\ Joerg Arndt, Mar 10 2018
    
  • PARI
    list(lim)=my(v=List(), x2); lim\=1; for(x=1, sqrtint(4*lim\3), x2=x^2; for(y=1, min((sqrt(4*lim-3*x2)-x)/2, x), listput(v, y*(x+y)+x2))); Set(v) \\ Charles R Greathouse IV, Mar 23 2018

Extensions

Edited by M. F. Hasler, Aug 17 2016
b-file for values a(1)..a(10^4) double-checked with PARI code by M. F. Hasler, Mar 04 2018

A198799 Smallest m such that m can be written in exactly n ways as x^2 + xy + y^2 with 0 <= x <= y.

Original entry on oeis.org

2, 0, 49, 637, 1729, 8281, 12103, 1529437, 53599, 157339, 593047, 19882681, 375193, 68574961, 2989441, 7709611, 1983163, 47738317081, 4877509, 21169376772835837, 18384457, 377770939, 69771386503, 146482609, 13882141, 1302924259, 3418797938647, 92672671
Offset: 0

Views

Author

Reinhard Zumkeller, Oct 30 2011

Keywords

Comments

10^12 < a(19) <= 21169376772835837. a(20) = 18384457. a(21) = 377770939. - Donovan Johnson, Nov 07 2011

Examples

			a(0) = A034020(1) = 2;
a(1) = A198772(1) = 0;
a(2) = A198773(1) = A118886(1) = 49;
a(3) = A198774(1) = A118886(28) = 637;
a(4) = A198775(1) = A118886(97) = 1729;
a(5) = 8281 = A118886(569) = 0 + 0*91 + 91^2 = 11^2 + 11*85 + 85^2 = 19^2 + 19*80 + 80^2 = 39^2 + 39*65 + 65^2 = 49^2 + 49*56 + 56^2;
a(6) = 12103 = A118886(862) = 2^2 + 2*109 + 109^2 = 21^2 + 21*98 + 98^2 = 27^2 + 27*94 + 94^2 = 34^2 + 34*89 + 89^2 = 49^2 + 49*77 + 77^2 = 61^2 + 61*66 + 66^2.
405769 = Q(0, 637) = Q(77, 595) = Q(133, 560) = Q(145, 552) = Q(200, 513) = Q(208, 507) = Q(273, 455) = Q(343, 392), where Q(x, y) = x^2 + xy + y^2 but it is not a(7) since sequence definition focuses 'exactly'. - _M. F. Hasler_, Mar 06 2018
		

Crossrefs

Cf. A300419 (analog, with x,y >= 1).

Programs

  • Haskell
    import Data.List (elemIndex)
    import Data.Maybe (fromJust)
    a198799 n = fromJust $ elemIndex n a088534_list
    
  • PARI
    a(n)=for(k=0,oo,A088534(k)==n&&return(k)) \\ M. F. Hasler, Mar 06 2018

Formula

A088534(a(n)) = n and A088534(m) <> n for m < a(n).

Extensions

a(7)-a(18) from Donovan Johnson, Nov 07 2011
More terms from Seth A. Troisi, Apr 23 2022

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.