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.

A348169 Positive integers which can be represented as A*(x^2 + y^2 + z^2) = B*(x*y + x*z + y*z) with positive integers x, y, z, A, B and gcd(A,B)=1.

This page as a plain text file.
%I A348169 #62 Dec 19 2024 11:45:36
%S A348169 3,12,18,27,30,42,48,72,75,77,98,108,120,147,154,162,168,192,243,255,
%T A348169 260,264,270,272,273,285,288,297,300,308,338,363,378,392,432,450,462,
%U A348169 480,490,494,507,510,513,588,616,630,648,672,675,693,702,714,722,750,754,768,798
%N A348169 Positive integers which can be represented as A*(x^2 + y^2 + z^2) = B*(x*y + x*z + y*z) with positive integers x, y, z, A, B and gcd(A,B)=1.
%C A348169 The sequence represents a generalization of cases A033428 (k=1), A347960 (k=2), A347969 (k=5) with all possible k given by A331605. Instead of integer k, it utilizes the ratio B/A.
%H A348169 Chai Wah Wu, <a href="/A348169/b348169.txt">Table of n, a(n) for n = 1..10000</a>
%H A348169 Alexander Kritov, <a href="/A348169/a348169_2.c.txt">Source code</a>
%e A348169 a(6)=42: the quintuple (x,y,z) A,B is 1,2,4 (2,3) because 42 = 2*(1^2 + 2^2 + 4^2) = 3*(1*4 + 1*2 + 2*4).
%e A348169   a(n)    (x,y,z)     A,  B
%e A348169     3     (1,1,1)     1,  1
%e A348169    12     (2,2,2)     1,  1
%e A348169    18     (1,1,4)     1,  2
%e A348169    27     (3,3,3)     1,  1
%e A348169    30     (1,1,2)     5,  6
%e A348169    42     (1,2,4)     2,  3
%e A348169    48     (4,4,4)     1,  1
%e A348169    72     (1,2,2)     8,  9  [also (2,2,8) 1, 2]
%e A348169    75     (5,5,5)     1,  1
%e A348169    77     (1,1,3)     7, 11
%e A348169    98     (1,4,9)     1,  2
%e A348169   108     (6,6,6)     1,  1
%e A348169   120     (2,2,4)     5,  6
%e A348169   147     (7,7,7)     1,  1
%e A348169   154     (1,2,3)    11, 14
%e A348169   162     (3,3,12)    1,  2
%e A348169   168     (2,4,8)     2,  3
%e A348169   192     (8,8,8)     1,  1
%e A348169   243     (9,9,9)     1,  1
%e A348169   255     (1,1,7)     5, 17
%e A348169   260     (2,5,6)     4,  5
%e A348169   264     (1,4,4)     8, 11
%e A348169   270     (2,5,5)     5,  6
%e A348169   272     (2,2,3)    16, 17
%e A348169   288     (4,4,2)     8,  9  [also (4,4,16) 1, 2]
%o A348169 (C) /* See links */
%o A348169 (Python)
%o A348169 from itertools import islice, count
%o A348169 from math import gcd
%o A348169 from sympy import divisors, integer_nthroot
%o A348169 def A348169(): # generator of terms
%o A348169     for n in count(1):
%o A348169         for d in divisors(n,generator=False):
%o A348169             x, x2 = 1, 1
%o A348169             while 3*x2 <= d:
%o A348169                 y, y2 = x, x2
%o A348169                 z2 = d-x2-y2
%o A348169                 while z2 >= y2:
%o A348169                     z, w = integer_nthroot(z2,2)
%o A348169                     if w:
%o A348169                         A = n//d
%o A348169                         B, u = divmod(n,x*(y+z)+y*z)
%o A348169                         if u == 0 and gcd(A,B) == 1:
%o A348169                             yield n
%o A348169                             break
%o A348169                     y += 1
%o A348169                     y2 += 2*y-1
%o A348169                     z2 -= 2*y-1
%o A348169                 else:
%o A348169                     x += 1
%o A348169                     x2 += 2*x-1
%o A348169                     continue
%o A348169                 break
%o A348169             else:
%o A348169                 continue
%o A348169             break
%o A348169 A348169_list = list(islice(A348169(),57)) # _Chai Wah Wu_, Nov 26 2021
%Y A348169 Cf. A331605, A347969, A347960.
%Y A348169 The sequence contains A033428 (A=B=1), A347969 (B=2*A), A347960 (B=5*A).
%K A348169 nonn
%O A348169 1,1
%A A348169 _Alexander Kritov_, Oct 04 2021