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.

Previous Showing 21-30 of 30 results.

A277557 The ordered image of the 1-to-1 mapping of an integer ordered pair (x,y) into an integer using Cantor's pairing function, where 0 < x < y, gcd(x,y)=1 and x+y odd.

Original entry on oeis.org

8, 18, 19, 32, 33, 34, 50, 52, 53, 72, 73, 74, 75, 76, 98, 99, 100, 101, 102, 103, 128, 131, 133, 134, 162, 163, 164, 165, 166, 167, 168, 169, 200, 201, 202, 203, 204, 205, 206, 207, 208, 242, 244, 247, 248, 250, 251, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 338
Offset: 1

Views

Author

Frank M Jackson, Oct 19 2016

Keywords

Comments

The mapping of the ordered pair (x,y) to an integer uses Cantor's pairing function to generate the integer as (x+y)(x+y+1)/2+y. Also for every ordered pair (x,y) such that 0 < x < y, gcd(x,y)=1 and x+y odd, there exists a primitive Pythagorean triple (PPT) (a, b, c) such that a = y^2-x^2, b = 2xy, c = x^2+y^2. Therefore each term in the sequence represents a unique PPT.
Numbers n for which 0 < A025581(n) < A002262(n) and A025581(n)+A002262(n) is odd, and gcd(A025581(n), A002262(n)) = 1. [The definition expressed with A-numbers.] - Antti Karttunen, Nov 02 2016
See also the triangle T(y, x) with the values for PPTs given in A278147. - Wolfdieter Lang, Nov 24 2016

Examples

			a(5)=33 because the ordered pair (2,5) maps to 33 by Cantor's pairing function (see below) and is the 5th such occurrence. Also x=2, y=5 generates a PPT with sides (21,20,29).
Note: Cantor's pairing function is simply A001477 in its two-argument tabular form A001477(k, n) = n + (k+n)*(k+n+1)/2, thus A001477(2,5) = 5 + (2+5)*(2+5+1)/2 = 33. - _Antti Karttunen_, Nov 02 2016
		

Crossrefs

Cf. A020882 (is obtained when A048147(a(n)) is sorted into ascending order), A008846 (same with duplicates removed).

Programs

  • Mathematica
    Cantor[{i_, j_}] := (i+j)(i+j+1)/2+j; getparts[n_] := Reverse@Select[Reverse[IntegerPartitions[n, {2}], 2], GCD@@#==1 &]; pairs=Flatten[Table[getparts[2n+1], {n, 1, 20}], 1]; Table[Cantor[pairs[[n]]], {n, 1, Length[pairs]}]

A056137 Number of ways in which n can be the longer leg (middle side) of an integer-sided right triangle.

Original entry on oeis.org

0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 2, 0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 0, 3, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 1, 2, 0, 0, 0, 2, 0, 1, 0, 1, 2, 0, 0, 3, 0, 0, 0, 1, 0, 0, 1, 2, 0, 0, 0, 4, 0, 0, 2, 1, 0, 0, 0, 1, 0, 1, 0
Offset: 1

Views

Author

Henry Bottomley, Jun 15 2000

Keywords

Crossrefs

Formula

a(n) = A046079(n) - A056138(n) = A046081(n) - A046080(n) - A056138(n).

A328708 Number of non-primitive Pythagorean triples with leg n.

Original entry on oeis.org

0, 0, 0, 0, 0, 1, 0, 1, 1, 1, 0, 2, 0, 1, 2, 2, 0, 2, 0, 2, 2, 1, 0, 5, 1, 1, 2, 2, 0, 4, 0, 3, 2, 1, 2, 5, 0, 1, 2, 5, 0, 4, 0, 2, 5, 1, 0, 8, 1, 2, 2, 2, 0, 3, 2, 5, 2, 1, 0, 9, 0, 1, 5, 4, 2, 4, 0, 2, 2, 4, 0, 10, 0, 1, 5, 2, 2, 4, 0, 8, 3, 1, 0, 9, 2, 1, 2, 5, 0, 7, 2, 2, 2, 1, 2, 11, 0, 2, 5, 5, 0, 4
Offset: 1

Views

Author

Rui Lin, Oct 26 2019

Keywords

Comments

Pythagorean triple including primitive ones and non-primitive ones. For a certain n, it may be a leg in either primitive Pythagorean triple, or non-primitive Pythagorean triple, or both.
This sequence is the count of n as leg in non-primitive Pythagorean triple.

Examples

			n=3 as leg in only one primitive Pythagorean triple, (3,4,5); so a(3)=0.
n=6 as leg in only one non-primitive Pythagorean triple, (6,8,10); so a(6)=1.
n=8 as leg in one primitive Pythagorean triple (8,15,17) and in one non-primitive Pythagorean triple (6,8,10); so a(8)=1.
		

References

  • A. Beiler, Recreations in the Theory of Numbers. New York: Dover Publications, pp. 116-117, 1966.

Crossrefs

Formula

a(n) = A046079(n) - A024361(n).

A365049 a(n) is the number of distinct parallelograms with integer sides and area n, and where at least one height is an integer.

Original entry on oeis.org

1, 1, 2, 3, 2, 4, 2, 5, 5, 4, 2, 10, 2, 4, 8, 9, 2, 9, 2, 10, 8, 4, 2, 20, 5, 4, 8, 10, 2, 16, 2, 13, 8, 4, 8, 23, 2, 4, 8, 20, 2, 16, 2, 10, 18, 4, 2, 34, 5, 9, 8, 10, 2, 16, 8, 20, 8, 4, 2, 40, 2, 4, 18, 19, 8, 16, 2, 10, 8, 16, 2, 45, 2, 4, 18, 10, 8, 16, 2, 34, 13
Offset: 1

Views

Author

Felix Huber, Aug 18 2023

Keywords

Comments

If n is not a square, there are A000005(n)/2 rectangles with A027750(n,i)*A027750(n,j) = n, i < j. If n is a square, there are (A000005(n)-1)/2 rectangles with A027750(n,i)*A027750(n,j) = n, i < j and a square with A027750(n,(A000005(n)+1)/2)^2 = n. From these rectangles and, if present, the square, further parallelograms of equal area and integer sides can be formed. A046079(A027750(n,k)) is the number of possibilities there are for each side of the rectangle or for the side of the square.

Examples

			For area n = 9 there is one rectangle (sides of lengths: 1,9) and a square (3,3) with integer sides. From both, further parallelograms with area n = 9 and integer sides can be formed. Since (9,12,15) and (9,40,41) are the only Pythagorean triples with leg 9, from the rectangle (1,9) exactly the two further parallelograms (1,15) and (1,41) with height 9 can be formed, but no further parallelogram with height 1. Since (3,4,5) is the only Pythagorean triple with leg 3, from the square (3,3) exactly one further parallelogram (3,5) with height 3 can be formed. Therefore for area n = 9 there are a(9) = 5 distinct parallelograms with integer sides.
		

Crossrefs

Programs

  • Python
    from math import prod
    from itertools import takewhile
    from sympy import factorint, divisors
    def A365049(n): return sum(1+(prod((e+(p&1)<<1)-1 for p, e in factorint(d).items())>>1)+(prod((e+(p&1)<<1)-1 for p, e in factorint(n//d).items())>>1 if d*dChai Wah Wu, Aug 21 2023

Formula

If n is a square, then a(n) = 1 + A046079(A027750(n, (A000005(n) + 1)/2)) + Sum_{i = 1..(A000005(n) - 1)/2} (1 + A046079(A027750(n,i)) + A046079(n/A027750(n,i)));
otherwise, a(n) = Sum_{i = 1..A000005(n)/2} (1 + A046079(A027750(n,i)) + A046079(n/A027750(n,i))).

A368041 a(n) is the least number k such that k^2 can be written as the difference of two positive squares in exactly n ways.

Original entry on oeis.org

1, 3, 8, 16, 12, 64, 128, 24, 512, 1024, 48, 4096, 72, 60, 32768, 65536, 192, 144, 524288, 384, 2097152, 4194304, 120, 16777216, 432, 1536, 134217728, 576, 3072, 1073741824, 2147483648, 240, 1152, 17179869184, 12288, 68719476736, 137438953472, 360, 1728, 1099511627776
Offset: 0

Views

Author

Ilya Gutkovskiy, Dec 09 2023

Keywords

Comments

Index of first occurrence of n in A046079.
All the terms are of the form 2^m * A147516(k), m >= 0, k >= 1. - Amiram Eldar, Nov 08 2024

Examples

			a(2) = 8: 8^2 = 10^2 - 6^2 = 17^2 - 15^2.
		

Crossrefs

Formula

a(n) = min(A122842(n+1), 2*A071571(n)). - Jon E. Schoenfield, Dec 09 2023

Extensions

a(26)-a(29) from Michel Marcus, Dec 09 2023
a(30)-a(39) from Jon E. Schoenfield, Dec 09 2023

A056138 Number of ways in which n can be the shorter leg (shortest side) of an integer-sided right triangle.

Original entry on oeis.org

0, 0, 1, 0, 1, 1, 1, 1, 2, 1, 1, 2, 1, 1, 3, 2, 1, 2, 1, 3, 3, 1, 1, 4, 2, 1, 3, 3, 1, 3, 1, 3, 4, 1, 3, 5, 1, 1, 4, 5, 1, 3, 1, 3, 5, 1, 1, 7, 2, 2, 4, 3, 1, 3, 3, 5, 4, 1, 1, 9, 1, 1, 5, 4, 4, 4, 1, 3, 4, 3, 1
Offset: 1

Views

Author

Henry Bottomley, Jun 15 2000

Keywords

Crossrefs

Programs

  • PARI
    a(n)=my(b);sum(c=n+2,n^2\2+1,issquare(c^2-n^2,&b) && nCharles R Greathouse IV, Jul 07 2013

Formula

a(n) = A046079(n) - A056137(n) = A046081(n) - A046080(n) - A056137(n).

A307876 a(n) is the smallest m such that there are prime(n) Pythagorean triangles with a leg (not hypotenuse) of length m, or -1 if no such m exists.

Original entry on oeis.org

8, 16, 64, 24, 4096, 60, 144, 384, 16777216, 1073741824, 240, 360, 4398046511104, 98304, 9216, 18014398509481984, 13824, 6291456, 840, 31104, 2160, 402653184, 19342813113834066795298816, 1237940039285380274899124224, 5760, 884736, 61440, 37748736, 412316860416
Offset: 1

Views

Author

Bob Andriesse, May 02 2019

Keywords

Comments

a(n) is the smallest m such that A046079(m) = n-th prime.
All a(n) > 10^6 for 8 < n < 30 were provided by Amiram Eldar.
When prime(n) is a Sophie Germain prime (A005384), then a(n) = 2^(prime(n)+1).
a(n) = m if m is the smallest solution of the equation A046079(m) = prime(n). This equation can be solved by inversing the formula for A046079(n) given by Temple Keller.

Examples

			4096 is the smallest integer that can be the harmonic mean of two different integers in 11 different ways. A000040(5) = A046079(4096) = 11, so a(5) = 4096.
		

Crossrefs

Formula

Let prime(n)*2 + 1 be (2*a0 - 1)*(2*a1 + 1)*(2*a2 + 1)*(2*a3 + 1)*...*(2*ak + 1). Then a(n) = (2^a0)*(p1^a1)*...*(pk^ak).

A330657 Number of ways the n-th pentagonal number A000326(n) can be written as the difference of two positive pentagonal numbers.

Original entry on oeis.org

0, 0, 0, 1, 1, 0, 2, 0, 0, 1, 0, 1, 1, 1, 0, 1, 2, 0, 2, 1, 1, 3, 1, 0, 2, 3, 0, 3, 1, 1, 2, 1, 1, 1, 2, 1, 3, 1, 2, 2, 1, 2, 1, 1, 1, 1, 3, 2, 2, 2, 1, 4, 1, 0, 2, 1, 2, 1, 1, 1, 3, 2, 2, 1, 3, 1, 3, 2, 1, 6, 1, 1, 1, 3, 2
Offset: 1

Views

Author

Bradley Klee, Mar 01 2020

Keywords

Comments

Equivalently, a(n) is the number of triples [n,k,m] with k>0 satisfying the Diophantine equation n*(3*n-1) + k*(3*k-1) - m*(3*m-1) = 0. Any such triple satisfies a triangle inequality, n+k > m. The n for which there is a triple [n,n,m] are listed in A137694. Solutions of the form [n,m-1,m] appear only when n=3*z+1, z > 0. The n for which a(n)=0 are listed in A135768.

Examples

			Isosceles case, n=5: 2*5*(3*5-1) - 7*(3*7-1) = 0.
		

References

  • N. J. A. Sloane et al., "sum of 2 triangular numbers is a triangular number", math-fun mailing list, Feb. 19-29, 2020.

Crossrefs

Programs

  • Mathematica
    PentaTriples[PNn_] := Sort[Select[{PNn,
          (-PNn + 3 PNn^2 + # - 3 #^2)/(6 #),
          (-PNn + 3 PNn^2 + # + 3 #^2)/(6 #)
          } & /@ Divisors[PNn*(3*PNn - 1)],
       And[And @@ (IntegerQ /@ #), And @@ (# > 0 & /@ #)] &]]
    Length[PentaTriples[#]] & /@ Range[100]
    a[n_] := Length@FindInstance[n > 0 && y > 0 && z > 0 &&
         n (3 n - 1) + y (3 y - 1) == z (3 z - 1), {y, z}, Integers, 10^9];
    a /@ Range[100]

A353875 a(n) is the minimal n-digit number which can be the length of a side of a Pythagorean triangle in the largest number of ways.

Original entry on oeis.org

5, 60, 840, 9240, 65520, 720720, 8168160, 98017920, 931170240, 9311702400, 80313433200, 931635825120, 9626903526240, 95492672074800, 890488576177200, 9973472053184640, 87624075895836480, 876240758958364800, 9419588158802421600, 99847634483305668960
Offset: 1

Views

Author

Zhining Yang, Jun 26 2022

Keywords

Examples

			a(2)=60 because 60 is the minimal 2-digit number which can be the length of a side of an integer-sided right triangle in 14 distinct ways, (11, 60, 61), (25, 60, 65), (32, 60, 68), (36, 48, 60), (45, 60, 75), (60, 63, 87), (60, 80, 100), (60, 91, 109), (60, 144, 156), (60, 175, 185), (60, 221, 229), (60, 297, 303), (60, 448, 452), (60, 899, 901), and 14 is the maximum number of such ways for a 2-digit number.
		

Crossrefs

Programs

  • Python
    from sympy import factorint
    def s(n):
        f=factorint(n)
        d, q=(list(f.keys()), list(f.values()))
        (a, b, c, x)=(0, 1, 1, 0)
        if(d[0]==2):
            a, x=(0, 1)
            if q[0]>1:
                 a=q[0]-1
        for p in range(x, len(d)):
            b*=(1+2*q[p])
            if d[p]%4==1:
                c*=(1+2*q[p])
        return((b-1)//2+a*b+(c-1)//2)
    def a(n):
        max=0
        for i in range(1+10**(n-1), 10**n):
            if s(i)>max:
                k,max=(i,s(i))
        return(n,[k,max])
    for i in range(1,6):
        print (a(i))

A318575 Areas of primitive Heron triangles with square sides.

Original entry on oeis.org

32918611718880, 284239560530875680
Offset: 1

Views

Author

Max Alekseyev, Aug 29 2018

Keywords

Examples

			a(1) is the area of the Heron triangle with sides 1853^2, 4380^2, 4427^2.
a(2) is the area of the Heron triangle with sides 11789^2, 68104^2, 68595^2.
		

Crossrefs

Extensions

a(1) was found by Stanica et al. (2013).
a(2) was found by Randall L Rathbun (2018).
Previous Showing 21-30 of 30 results.