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

A005767 Solutions n to n^2 = a^2 + b^2 + c^2 (a,b,c > 0).

Original entry on oeis.org

3, 6, 7, 9, 11, 12, 13, 14, 15, 17, 18, 19, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 33, 34, 35, 36, 37, 38, 39, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 81, 82, 83, 84, 85
Offset: 1

Views

Author

N. J. A. Sloane, Ralph Peterson (ralphp(AT)library.nrl.navy.mil)

Keywords

Comments

All numbers not equal to some 2^k or 5*2^k [Fraser and Gordon]. - Joseph Biberstine (jrbibers(AT)indiana.edu), Jul 28 2006

References

  • T. Nagell, Introduction to Number Theory, Wiley, 1951, p. 194.

Crossrefs

Complement of A094958. Cf. A169580, A000378, A000419, A000408.
For primitive solutions see A005818.

Programs

  • Mathematica
    z=100;lst={};Do[a2=a^2;Do[b2=b^2;Do[c2=c^2;e2=a2+b2+c2;e=Sqrt[e2];If[IntegerQ[e]&&e<=z,AppendTo[lst,e]],{c,b,1,-1}],{b,a,1,-1}],{a,1,z}];Union@lst (* Vladimir Joseph Stephan Orlovsky, May 19 2010 *)
  • PARI
    is(n)=if(n%5,n,n/5)==2^valuation(n,2) \\ Charles R Greathouse IV, Mar 12 2013
    
  • Python
    def A005767(n):
        def f(x): return n+x.bit_length()+(x//5).bit_length()
        m, k = n, f(n)
        while m != k: m, k = k, f(k)
        return m # Chai Wah Wu, Feb 14 2025

Formula

a(n) = n + 2*log_2(n) + O(1). - Charles R Greathouse IV, Sep 01 2015
A169580(n) = a(n)^2. - R. J. Mathar, Aug 15 2023

Extensions

More terms from T. D. Noe, Mar 04 2010

A330893 Numbers whose set of divisors contains a Pythagorean quadruple.

Original entry on oeis.org

42, 72, 84, 126, 144, 156, 168, 198, 210, 216, 252, 288, 294, 312, 330, 336, 342, 360, 378, 396, 420, 432, 462, 468, 504, 546, 570, 576, 588, 594, 624, 630, 648, 660, 672, 684, 714, 720, 756, 780, 792, 798, 840, 864, 882, 900, 924, 930, 936, 966, 990, 1008, 1026
Offset: 1

Views

Author

Michel Lagneau, May 01 2020

Keywords

Comments

A Pythagorean quadruple (x, y, z, m) is a set of positive integers that satisfy x^2 + y^2 + z^2 = m^2.
The corresponding number of quadruples of the sequence is 1, 1, 2, 2, 2, 1, 3, 1, 3, 2, 4, 3, 2, 2, 1, 4, 1, 2, 3, 2, 7, 4, ... (see the sequence A330894).
It is interesting to note that each set of divisors of a(n) contains m primitive Pythagorean quadruples for some n, m = 1, 2,...
Examples:
- The set of divisors of a(1)= 42 contains only one primitive Pythagorean quadruple: (2, 3, 6, 7).
- The set of divisors of a(9) = 210 contains two primitive Pythagorean quadruples: (2, 3, 6, 7) and (2, 5, 14, 15).
- The set of divisors of a(21) = 420 contains three primitive Pythagorean quadruples: (2, 3, 6, 7), (2, 5, 14, 15) and (4, 5, 20, 21).
If k is in the sequence then so is m*k for m > 1.
Assumes the elements (x,y,z,m) in a quadruple are distinct divisors, as otherwise 6 would be in the sequence with 1^2+2^2+2^2=3^2. - Chai Wah Wu, Nov 16 2020

Examples

			168 is in the sequence because the set of divisors  {1, 2, 3, 4, 6, 7, 8, 12, 14, 21, 24, 28, 42, 56, 84, 168} contains the Pythagorean quadruples {2, 3, 6, 7}, {4, 6, 12, 14} and {8, 12, 24, 28}. The first quadruple is primitive.
		

Crossrefs

Programs

  • Maple
    with(numtheory):
    for n from 3 to 1200 do :
       d:=divisors(n):n0:=nops(d):it:=0:
        for i from 1 to n0-3 do:
         for j from i+1 to n0-2 do :
          for k from j+1 to n0-1 do:
          for m from k+1 to n0 do:
           if d[i]^2 + d[j]^2 + d[k]^2 = d[m]^2
            then
            it:=it+1:
            else
           fi:
          od:
         od:
        od:
        od:
        if it>0 then
        printf(`%d, `,n):
        else fi:
       od:
  • Mathematica
    nq[n_] := If[ Mod[n,6]>0, 0, Block[{t, u, v, c = 0, d = Divisors[n], m}, m = Length@ d; Do[ t = d[[i]]^2 + d[[j]]^2; Do[u = t + d[[h]]^2; If[u > n^2, Break[]]; If[ Mod[n^2, u] == 0 && IntegerQ[v = Sqrt@ u] && Mod[n, v] == 0, c++], {h, j+1, m - 1}], {i, m-3}, {j, i+1, m - 2}]; c]]; Select[ Range@ 1026, nq[#] > 0 &] (* Giovanni Resta, May 04 2020 *)
  • PARI
    isok(n) = {my(d=divisors(n), x); for (i=1, #d-3, for (j=i+1, #d-2, for (k=j+1, #d-1, if (issquare(d[i]^2 + d[j]^2 + d[k]^2, &x) && !(n % x), return(1)););););} \\ Michel Marcus, Nov 16 2020

Formula

a(n) == 0 (mod 6).

A330894 Numbers of Pythagorean quadruples contained in the divisors of A330893(n).

Original entry on oeis.org

1, 1, 2, 2, 2, 1, 3, 1, 3, 2, 4, 3, 2, 2, 1, 4, 1, 2, 3, 2, 7, 4, 2, 2, 8, 2, 1, 4, 4, 2, 3, 7, 3, 2, 5, 2, 2, 4, 6, 2, 5, 2, 11, 6, 4, 1, 4, 1, 6, 2, 4, 12, 2, 5, 1, 4, 6, 4, 2, 5, 6, 4, 1, 2, 3, 4, 17, 6, 2, 3, 6, 1, 5, 6, 1, 3, 4, 6, 6, 13, 1, 2, 4, 8, 4, 4
Offset: 1

Views

Author

Michel Lagneau, May 01 2020

Keywords

Examples

			a(7) = 3 because A330893(7)=168, and the set of divisors of 168: {1, 2, 3, 4, 6, 7, 8, 12, 14, 21, 24, 28, 42, 56, 84, 168} contains three Pythagorean quadruples {2, 3, 6, 7}, {4, 6, 12, 14} and {8, 12, 24, 28}.
		

Crossrefs

Programs

  • Maple
    with(numtheory):
    for n from 3 to 1700 do :
       d:=divisors(n):n0:=nops(d):it:=0:
        for i from 1 to n0-3 do:
         for j from i+1 to n0-2 do :
          for k from j+1 to n0-1 do:
          for m from k+1 to n0 do:
           if d[i]^2 + d[j]^2 + d[k]^2 = d[m]^2
            then
            it:=it+1:
            else
           fi:
          od:
         od:
        od:
        od:
        if it>0 then
        printf(`%d, `,it):
        else fi:
       od:
  • Mathematica
    nq[n_] := If[Mod[n, 6] > 0, 0, Block[{t, u, v, c = 0, d = Divisors[n], m}, m = Length@ d; Do[t = d[[i]]^2 + d[[j]]^2; Do[u = t + d[[h]]^2; If[u > n^2, Break[]]; If[Mod[n^2, u] == 0 && IntegerQ[v = Sqrt@ u] && Mod[n, v] == 0, c++], {h, j+1, m-1}], {i, m-3}, {j, i+1, m - 2}]; c]]; Select[Array[nq, 1638], # > 0 &] (* Giovanni Resta, May 04 2020 *)

A331365 Least k whose set of divisors contains exactly n Pythagorean quadruples, or 0 if no such k exists.

Original entry on oeis.org

42, 84, 168, 252, 672, 756, 420, 504, 2592, 1872, 840, 1008, 1512, 2940, 1680, 2016, 1260, 4536, 3360, 3024, 9450, 4620, 5880, 6552, 9504, 6930, 3780, 8400, 23184, 25704, 2520, 6300, 31752, 8820, 19800, 11088, 10920, 13104, 15840, 19152, 19656, 16632, 38016
Offset: 1

Views

Author

Michel Lagneau, May 03 2020

Keywords

Comments

a(n) == 0 (mod 6).

Examples

			a(3) = 168 because the set of the divisors {1, 2, 3, 4, 6, 7, 8, 12, 14, 21, 24, 28, 42, 56, 84, 168} contains 3 Pythagorean quadruples {2, 3, 6, 7}, {4, 6, 12, 14} and {8, 12, 24, 28}.
		

Crossrefs

Programs

  • Maple
    with(numtheory):
    for n from 1 to 52 do :
    ii:=0:
    for q from 3 to 10^8 while(ii=0) do:
       d:=divisors(q):n0:=nops(d):it:=0:
        for i from 1 to n0-3 do:
         for j from i+1 to n0-2 do :
          for k from j+1 to n0-1 do:
          for l from k+1 to n0 do:
           if d[i]^2 + d[j]^2 + d[k]^2 = d[l]^2
            then
            it:=it+1:
            else
           fi:
          od:
         od:
        od:
       od:
        if it = n
         then
         ii:=1: printf(`%d %d \n`,n,q):
         else
        fi:
    od:
    od:
  • Mathematica
    upto = 38016; nq[n_] := If[Mod[n, 6] > 0, 0, Block[{t, u, v, c=0, d = Divisors@ n, m}, m = Length@ d; Do[t = d[[i]]^2 + d[[j]]^2; Do[u = t + d[[h]]^2; If[u > n^2, Break[]]; If[Mod[n^2, u] == 0 && IntegerQ[v = Sqrt@ u] && Mod[n, v] == 0, c++], {h, j+1, m-1}], {i, m-3}, {j, i+1, m-2}]; c]]; w = ParallelTable[ {nq@ n, n}, {n, 6 Range[ upto / 6]}]; t=0 Range@ Max[First /@ w]; Do[{q, x} = e; If[q > 0 && t[[q]] == 0, t[[q]] = x], {e, w}]; AppendTo[t, 0]; TakeWhile[t, # > 0 &] (* Giovanni Resta, May 04 2020 *)

A166687 Numbers of the form x^2 + y^2 + 1, x, y integers.

Original entry on oeis.org

1, 2, 3, 5, 6, 9, 10, 11, 14, 17, 18, 19, 21, 26, 27, 30, 33, 35, 37, 38, 41, 42, 46, 50, 51, 53, 54, 59, 62, 65, 66, 69, 73, 74, 75, 81, 82, 83, 86, 90, 91, 98, 99, 101, 102, 105, 107, 110, 114, 117, 118, 122, 123, 126, 129, 131, 137, 138, 145, 146, 147, 149, 150, 154, 158, 161
Offset: 1

Views

Author

N. J. A. Sloane, Mar 05 2010

Keywords

Comments

A001481 is the main entry for this sequence.
As Ng points out (Lemma 2.2), each prime divides some member of this sequence: 2 divides a(2) = 2, 3 divides a(3) = 3, 5 divides a(4) = 5, 7 divides a(9) = 14, etc. - Charles R Greathouse IV, Jan 04 2016

Crossrefs

Programs

  • Maple
    N:= 1000: # to get all terms <= N
    S:= {seq(seq(x^2+y^2+1,y=0..floor(sqrt(N-1-x^2))),x=0..floor(sqrt(N-1)))}:
    sort(convert(S,list)); # Robert Israel, Jan 05 2016
  • Mathematica
    Select[Range@ 162, Resolve[Exists[{x, y}, Reduce[# == x^2 + y^2 + 1, {x, y}, Integers]]] &] (* Michael De Vlieger, Jan 05 2016 *)
  • PARI
    is(n)=my(f=factor(n-1)); for(i=1, #f~, if(f[i,1]%4==3 && f[i,2]%2, return(0))); 1 \\ Charles R Greathouse IV, Jan 04 2016
    
  • PARI
    list(lim)=my(v=List(),t); lim\=1; for(m=0,sqrtint(lim-1), t=m^2+1; for(n=0, min(sqrtint(lim-t),m), listput(v,t+n^2))); Set(v) \\ Charles R Greathouse IV, Jan 05 2016

A217554 Numbers of the form x^2 - 1 that are the sum of 3 nonzero square numbers.

Original entry on oeis.org

3, 24, 35, 48, 99, 120, 168, 195, 224, 288, 323, 360, 440, 483, 528, 675, 728, 840, 899, 1088, 1155, 1224, 1368, 1443, 1680, 1763, 1848, 2024, 2115, 2208, 2400, 2499, 2600, 2808, 2915, 3024, 3248, 3363, 3480, 3720, 3843, 3968, 4224, 4355, 4488, 4760, 4899
Offset: 1

Views

Author

Jon Perry, Oct 06 2012

Keywords

Comments

Solutions of a^2 - b^2 - c^2 - d^2 = 1 with a, b, c, and d positive.
Integer points on the unit sphere in a Minkowski 4-space.

Examples

			3 = 1 + 1 + 1
24 = 16 + 4 + 4
35 = 25 + 9 + 1
48 = 16 + 16 + 16
99 = 81 + 9 + 9
120 = 100 + 16 + 4
168 = 100 + 64 + 4
195 = 169 + 25 + 1
224 = 144 + 64 + 16
288 = 256 + 16 + 16
323 = 289 + 25 + 9
360 = 196 + 100 + 64
440 = 400 + 36 + 4
8 can only be expressed as the sum of 3 squares iff 0 is allowed.
		

Crossrefs

Cf. A169580.

Programs

  • Mathematica
    nn = 100; t = {}; Do[n = a^2 + b^2 + c^2; If[n <= nn^2 + 2 && IntegerQ[Sqrt[n + 1]], AppendTo[t, n]], {a, nn}, {b, a}, {c, b}]; t = Union[t] (* T. D. Noe, Oct 10 2012 *)

Extensions

Terms a(14)-a(39) from John W. Layman, Oct 09 2012

A225206 Number of Pythagorean quadruples (a, b, c, d) with d < 10^n.

Original entry on oeis.org

6, 571, 56268, 5614390, 561232920, 56120665334, 5612026652893, 561202243017532, 56120219419339591
Offset: 1

Views

Author

Arkadiusz Wesolowski, May 01 2013

Keywords

Comments

a(n) ~ Pi*A225207(n)/(1+G), where G is Catalan's constant (A006752).

Examples

			a(1) = 6 because there are six solutions (a, b, c, d) as follows: (1, 2, 2, 3), (2, 4, 4, 6), (2, 3, 6, 7), (1, 4, 8, 9), (3, 6, 6, 9), (4, 4, 7, 9) with d < 10.
		

Crossrefs

Formula

a(n) = Sum_{k=1..10^n-1} A181786(k). - Max Alekseyev, Feb 28 2023

Extensions

a(4) from Giovanni Resta, May 01 2013
a(5)-a(9) from Max Alekseyev, Feb 28 2023

A166265 Numbers of the form 1+x^2+y^2, x, y integers >= 1.

Original entry on oeis.org

3, 6, 9, 11, 14, 18, 19, 21, 26, 27, 30, 33, 35, 38, 41, 42, 46, 51, 53, 54, 59, 62, 66, 69, 73, 74, 75, 81, 83, 86, 90, 91, 98, 99, 101, 102, 105, 107, 110, 114, 117, 118, 123, 126, 129, 131, 137, 138, 146, 147, 149, 150, 154, 158, 161, 163, 165, 170, 171, 174, 179, 181, 182
Offset: 1

Views

Author

N. J. A. Sloane, Mar 05 2010

Keywords

Crossrefs

Programs

  • Mathematica
    With[{nn=40},Take[Union[Total/@Tuples[Range[nn]^2,2]+1],2*nn]] (* Harvey P. Dale, Mar 12 2015 *)

A360946 Number of Pythagorean quadruples with inradius n.

Original entry on oeis.org

1, 3, 6, 10, 9, 19, 16, 25, 29, 27, 27, 56, 31, 51, 49, 61, 42, 91, 52, 71, 89, 86, 63, 142, 64, 95, 116, 132, 83, 153, 90, 144, 149, 133, 108, 238, 108, 162, 169, 171, 122, 284, 130, 219, 200, 196, 145, 340, 174, 201, 231, 239, 164, 364, 176, 314, 278, 256, 190, 399, 195, 281, 360, 330
Offset: 1

Views

Author

Keywords

Comments

A Pythagorean quadruple is a quadruple (a,b,c,d) of positive integers such that a^2 + b^2 + c^2 = d^2 with a <= b <= c. Its inradius is (a+b+c-d)/2, which is a positive integer.
For every positive integer n, there is at least one Pythagorean quadruple with inradius n.

Examples

			For n=1 the a(1)=1 solution is (1,2,2,3).
For n=2 the a(2)=3 solutions are (1,4,8,9), (2,3,6,7) and (2,4,4,6).
For n=3 the a(3)=6 solutions are (1,6,18,19), (2,5,14,15), (2,6,9,11), (3,4,12,13), (3,6,6,9) and (4,4,7,9).
		

References

  • J. M. Blanco Casado, J. M. Sánchez Muñoz, and M. A. Pérez García-Ortega, El Libro de las Ternas Pitagóricas, Preprint 2023.

Crossrefs

Programs

  • Mathematica
    n=50;
    div={};suc={};A={};
    Do[A=Join[A,{Range[1,(1+1/Sqrt[3])q]}],{q,1,n}];
    Do[suc=Join[suc,{Length[div]}];div={};For [i=1,i<=Length[Extract[A,q]],i++,div=Join[div,Intersection[Divisors[q^2+(Extract[Extract[A,q],i]-q)^2],Range[2(Extract[Extract[A,q],i]-q),Sqrt[q^2+(Extract[Extract[A,q],i]-q)^2]]]]],{q,1,n}];suc=Rest[Join[suc,{Length[div]}]];matriz={{"q"," ","cuaternas"}};For[j=1,j<=n,j++,matriz=Join[matriz,{{j," ",Extract[suc,j]}}]];MatrixForm[Transpose[matriz]]
Showing 1-9 of 9 results.