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

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

A335893 Primitive triples for integer-sided triangles whose angles A < B < C are in arithmetic progression.

Original entry on oeis.org

3, 7, 8, 5, 7, 8, 7, 13, 15, 8, 13, 15, 5, 19, 21, 16, 19, 21, 11, 31, 35, 24, 31, 35, 7, 37, 40, 33, 37, 40, 13, 43, 48, 35, 43, 48, 16, 49, 55, 39, 49, 55, 9, 61, 65, 56, 61, 65, 32, 67, 77, 45, 67, 77, 17, 73, 80, 63, 73, 80, 40, 79, 91, 51, 79, 91, 11, 91, 96
Offset: 1

Views

Author

Bernard Schott, Jun 29 2020

Keywords

Comments

The triples are displayed in nondecreasing order of middle side, and if middle sides coincide then by increasing order of the largest side, hence, each triple (a, b, c) is in increasing order.
These three properties below are equivalent:
-> integer-sided triangles whose angles A < B < C are in arithmetic progression,
-> integer-sided triangles such that B = (A+C)/2 with A < C,
-> integer-sided triangles such that A < B < C with B = Pi/3.
When A < B < C are in arithmetic progression with B = A + phi and C = B + phi, then 0 < phi < Pi/3.
The corresponding metric relation between sides is b^2 = a^2 - a*c + c^2.
There exists such primitive triangle iff b^2 is an odd square term of A024612. Hence, the first few middle sides b are 7, 13, 19, 31, 37, 43, 49, 61, 67, ... and b is a term of A004611 \ {1}. Indeed, b cannot be even if the triple is primitive.
As B = Pi/3 and C runs from Pi/3 to 2*Pi/3, sin(C) gets a maximum when C = Pi/2 with sin(C) = 1, hence, from law of sines (see link): b/sin(B) = c/sin(C), and c < b/sin(Pi/3) = b * 2/sqrt(3) < 6*b/5. This bound is used in the PARI and Maple programs below.
When triple (a, b, c) is solution, then triple (c-a, b, c) is another solution. Hence, for each b odd solution, there exist 2 triples with same middle side b and same largest side c.
The common tangent to the nine-point circle and the incircle of a triangle ABC is parallel to the Euler line iff angles A < B < C are in arithmetic progression (see Crux Mathematicorum for Indian team selection). - Bernard Schott, Apr 14 2022
These triples are called (primitive) Eisenstein triples (Wikipedia). - Bernard Schott, Sep 21 2022

Examples

			(3, 7, 8) is a triple for this sequence because from law of cosines (see link), cos(A) = (7^2 + 8^2 - 3^2)/(2*7*8) = 13/14, cos(B) = (8^2 + 3^2 - 7^2)/(2*8*3) = 1/2 and cos(C) = (3^2 + 7^2 - 8^2)/(2*3*7) = -1/7; then, (A+C)/2 = ( arccos(13/14) + arccos(-1/7) )/2 = Pi/3 = B.
Also, arccos(13/14) ~ 21.787 degrees, arccos(1/2) = 60 degrees, arccos(-1/7) ~ 98.213 degrees, so B-A = C-B ~ 38.213 degrees, hence (A, B, C) are in arithmetic progression.
5^2 - 5*8 + 8^2 = 7^2, hence (5, 7, 8) is another triple for triangle whose angles A < B < C are in arithmetic progression.
		

References

  • V. Lespinard & R. Pernet, Trigonométrie, Classe de Mathématiques élémentaires, programme 1962, problème B-298 p. 124, André Desvigne.

Crossrefs

Cf. A335894 (smallest side), A335895 (middle side), A335896 (largest side), A335897 (perimeter).
Cf. A103606 (primitive Pythagorean triples), A335034 (primitive triples for triangles with two perpendicular medians).

Programs

  • Maple
    for b from 3 to 250 by 2 do
    for c from b+1 to 6*b/5 do
    a := (c - sqrt(4*b^2-3*c^2))/2;
    if gcd(a,b)=1 and issqr(4*b^2-3*c^2) then print(a,b,c,c-a,b,c); end if;
    end do;
    end do;
  • PARI
    lista(nn) = {forstep(b=1, nn, 2, for(c=b+1, 6*b\5, if (issquare(d=4*b^2 - 3*c^2), my(a = (c - sqrtint(d))/2); if ((denominator(a)==1) && (gcd(a, b) == 1), print(a, ", ", b, ", ", c, ", "); print(c-a, ", ", b, ", ", c, ", ");););););} \\ Michel Marcus, Jul 15 2020

A256497 Triangle read by rows, sums of 2 distinct nonzero cubes: T(n,k) = (n+1)^3+k^3, 1 <= k <= n.

Original entry on oeis.org

9, 28, 35, 65, 72, 91, 126, 133, 152, 189, 217, 224, 243, 280, 341, 344, 351, 370, 407, 468, 559, 513, 520, 539, 576, 637, 728, 855, 730, 737, 756, 793, 854, 945, 1072, 1241, 1001, 1008, 1027, 1064, 1125, 1216, 1343, 1512, 1729
Offset: 1

Views

Author

Bob Selcoe, Mar 31 2015

Keywords

Comments

When n=k: T(n,k) = (2n+1)(n^2+n+1). Therefore, T(n,k)/(2n+1) = A002061(n+1).
A002383 is the sequence of all primes of the form T(n,k)/(2n+1), n=k.
When starting at T(n,k) n=k, diagonal sums are n^2*(2n+1)^2. For example, starting at T(4,4) = 189: 189+243+351+513 = 4^2*9^2 = 1296.
Coefficients in T(n,k) are multiples of n+k+1; therefore, coefficients in all diagonals starting at T(n,1) are multiples of n+2.
Let T"(n,k) = T(n,k)/(n+k+1). Then reading T"(n,k) by rows:
i. Row sums are A162147(n). For example, T"(3,k) = [65/5, 72/6, 91/7] = [13,12,13]. 13+12+13 = 38; A162147(3) = 38.
ii. Extend the triangle in A215631 to a symmetric array by reflection about the main diagonal, and let that array be T"215631(n,k). Then the diagonal starting with T"215631(n,1) is row n in T"(n,k). For example, the diagonal starting at T"215631(4,1) = [21,19,19,21]; T"(4,k) = [126/6, 133/7, 152/8, 189/9] = [21,19,19,21].
iii. Coefficients in T"(n,k) are a permutation of A024612.

Examples

			Triangle starts:
n\k   1    2    3    4    5    6    7     8    9   10 ...
1:    9
2:    28  35
3:    65  72   91
4:   126  133  152  189
5:   217  224  243  280  341
6:   344  351  370  407  468  559
7:   513  520  539  576  637  728  855
8:   730  737  756  793  854  945  1072 1241
9:   1001 1008 1027 1064 1125 1216 1343 1512 1729
10:  1332 1339 1358 1395 1456 1547 1674 1843 2060 2331
...
The successive terms are (2^3+1^3), (3^3+1^3), (3^3+2^3), (4^3+1^3), (4^3+2^3), (4^3+3^3), ...
		

Crossrefs

Formula

T(n,k) = (n+1)^3+k^3.
T(n,k) = (2k+1)(k^2+k+1) + Sum_{j=k+1..n} A003215(j), n>=k+1. For example, T(8,4) = 9*21 + 91 + 127 + 169 + 217 = 793.
Showing 1-3 of 3 results.