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.

User: Robert C. Lyons

Robert C. Lyons's wiki page.

Robert C. Lyons has authored 74 sequences. Here are the ten most recent ones:

A381009 Ordered areas of the Pythagorean triangles defined by a = 2^(4n) + 2^(2n+1), b = 2^(4n) - 2^(4n-2) - 2^(2n) - 1, c = 2^(4n) + 2^(4n-2) + 2^(2n) + 1.

Original entry on oeis.org

84, 25200, 6350784, 1614708480, 412583721984, 105570270965760, 27022696873181184, 6917599389942743040, 1770891934572664848384, 453347470584212823736320, 116056897129722086198083584, 29710562123440325102508441600, 7605903676927233379495034486784, 1947111326786263531071061496954880
Offset: 1

Author

Robert C. Lyons, Feb 12 2025

Keywords

Comments

Proper subset of A024406.

Crossrefs

Cf. A024406.
Cf. A381005 (short legs), A381006 (long legs), A381007 (hypotenuses), A381008 (perimeters).

Programs

  • Magma
    [(2^(4*n) + 2^(2*n+1)) * (2^(4*n) - 2^(4*n-2) - 2^(2*n) - 1) / 2: n in [1..20]];
    
  • Mathematica
    A381009[n_] := (3*# + 2)*(# + 2)*(# - 2)*2^(2*n - 3) & [4^n]; Array[A381009, 20] (* or *)
    LinearRecurrence[{340, -22848, 348160, -1048576}, {84, 25200, 6350784, 1614708480}, 20] (* Paolo Xausa, Feb 26 2025 *)
  • PARI
    a(n) = (2^(4*n) + 2^(2*n+1)) * (2^(4*n) - 2^(4*n-2) - 2^(2*n) - 1) / 2
    
  • Python
    def A381009(n): return (m:=1<<(n<<1)-1)*(m-1)*(m+1)*(3*m+1)<<1 # Chai Wah Wu, Feb 13 2025

Formula

a(n) = A381005(n) * A381006(n) / 2.
a(n) = (2^(4n) + 2^(2n+1)) * (2^(4n) - 2^(4n-2) - 2^(2n) - 1) / 2.
G.f.: 12*(7 - 280*x - 24832*x^2 + 163840*x^3)/((1 - 4*x)*(1 - 16*x)*(1 - 64*x)*(1 - 256*x)). - Stefano Spezia, Feb 13 2025

A381008 Ordered perimeters of the Pythagorean triangles defined by a = 2^(4n) + 2^(2n+1), b = 2^(4n) - 2^(4n-2) - 2^(2n) - 1, c = 2^(4n) + 2^(4n-2) + 2^(2n) + 1.

Original entry on oeis.org

56, 800, 12416, 197120, 3147776, 50339840, 805339136, 12885032960, 206158954496, 3298536980480, 52776566521856, 844424963686400, 13510799016329216, 216172782650654720, 3458764515968024576, 55340232229718589440, 885443715572418215936, 14167099448746374594560
Offset: 1

Author

Robert C. Lyons, Feb 12 2025

Keywords

Comments

Proper subset of A024364.

Crossrefs

Cf. A024364.
Cf. A381005 (short legs), A381006 (long legs), A381007 (hypotenuses), A381009 (areas).

Programs

  • Magma
    [2^(4*n+1) + 2^(2*n+1) + 2^(4*n): n in [1..20]];
    
  • Mathematica
    A381008[n_] := #*(3*# + 2) & [4^n]; Array[A381008, 20] (* or *)
    LinearRecurrence[{20, -64}, {56, 800}, 20] (* Paolo Xausa, Feb 26 2025 *)
  • PARI
    a(n) = 2^(4*n+1) + 2^(2*n+1) + 2^(4*n)
    
  • Python
    def A381008(n): return (m:=1<<(n<<1))*(2+3*m) # Chai Wah Wu, Feb 13 2025

Formula

a(n) = A381005(n) + A381006(n) + A381007(n).
a(n) = 2^(4n+1) + 2^(2n+1) + 2^(4n).
G.f.: 8*(7 - 40*x)/((1 - 4*x)*(1 - 16*x)). - Stefano Spezia, Feb 13 2025

A381007 Ordered hypotenuses of the Pythagorean triangles defined by a = 2^(4n) + 2^(2n+1), b = 2^(4n) - 2^(4n-2) - 2^(2n) - 1, c = 2^(4n) + 2^(4n-2) + 2^(2n) + 1.

Original entry on oeis.org

25, 337, 5185, 82177, 1311745, 20975617, 335560705, 5368774657, 85899608065, 1374390583297, 21990236749825, 351843737665537, 5629499601321985, 90071992815845377, 1441151881832300545, 23058430096431906817, 368934881491370901505, 5902958103655775993857
Offset: 1

Author

Robert C. Lyons, Feb 12 2025

Keywords

Comments

Proper subset of A020882.
Conjecture: These Pythagorean triangles are primitive. Verified up to n=100000.
The preceding conjecture is true, since, for n>=1, the values of a,b,c are given by Euclid's formula for generating Pythagorean triples: a=2xy, b=x^2-y^2, c=x^2+y^2 with x=2^(2n) and y=2^(2n-1)+1 and x and y are coprime and x is even and y is odd. - Chai Wah Wu, Feb 13 2025

Crossrefs

Cf. A020882.
Cf. A381005 (short legs), A381006 (long legs), A381008 (perimeters), A381009 (areas).

Programs

  • Magma
    [2^(4*n) + 2^(4*n-2) + 2^(2*n) + 1: n in [1..20]];
    
  • Mathematica
    A381007[n_] := 5*4^(2*n - 1) + 4^n + 1; Array[A381007, 20] (* or *)
    LinearRecurrence[{21, -84, 64}, {25, 337, 5185}, 20] (* Paolo Xausa, Feb 26 2025 *)
  • PARI
    a(n) = 2^(4*n) + 2^(4*n-2) + 2^(2*n) + 1
    
  • Python
    def A381007(n): return (m:=1<<(n<<1)-1)*(5*m+2)+1 # Chai Wah Wu, Feb 13 2025

Formula

a(n) = 2^(4n) + 2^(4n-2) + 2^(2n) + 1.
a(n) = sqrt( A381005(n)^2 + A381006(n)^2 ).
G.f.: (25 - 188*x + 208*x^2)/((1 - x)*(1 - 4*x)*(1 - 16*x)). - Stefano Spezia, Feb 13 2025

A381006 Ordered long legs of the Pythagorean triangles defined by a = 2^(4n) + 2^(2n+1), b = 2^(4n) - 2^(4n-2) - 2^(2n) - 1, c = 2^(4n) + 2^(4n-2) + 2^(2n) + 1.

Original entry on oeis.org

24, 288, 4224, 66048, 1050624, 16785408, 268468224, 4295098368, 68720001024, 1099513724928, 17592194433024, 281475010265088, 4503599761588224, 72057594574798848, 1152921506754330624, 18446744082299486208, 295147905213712564224, 4722366483007084167168
Offset: 1

Author

Robert C. Lyons, Feb 12 2025

Keywords

Comments

Proper subset of A020883.
Conjecture: These Pythagorean triangles are primitive. Verified up to n=100000.
The preceding conjecture is true, since, for n>=1, the values of a,b,c are given by Euclid's formula for generating Pythagorean triples: a=2xy, b=x^2-y^2, c=x^2+y^2 with x=2^(2n) and y=2^(2n-1)+1 and x and y are coprime and x is even and y is odd. - Chai Wah Wu, Feb 13 2025

Crossrefs

Cf. A020883.
Cf. A381005 (short legs), A381007 (hypotenuses), A381008 (perimeters), A381009 (areas).

Programs

  • Magma
    [2^(4*n) + 2^(2*n+1): n in [1..20]];
    
  • Mathematica
    A381006[n_] := #*(# + 2) & [4^n]; Array[A381006, 20] (* or *)
    LinearRecurrence[{20, -64}, {24, 288}, 20] (* Paolo Xausa, Feb 26 2025 *)
  • PARI
    a(n) = 2^(4*n) + 2^(2*n+1)
    
  • Python
    def A381006(n): return (m:=1<<(n<<1))*(m+2) # Chai Wah Wu, Feb 13 2025

Formula

a(n) = 2^(4n) + 2^(2n+1).
a(n) = sqrt( A381007(n)^2 - A381005(n)^2 ).
G.f.: 24*(1 - 8*x)/((1 - 4*x)*(1 - 16*x)). - Stefano Spezia, Feb 13 2025

A381005 Ordered short legs of the Pythagorean triangles defined by a = 2^(4n) + 2^(2n+1), b = 2^(4n) - 2^(4n-2) - 2^(2n) - 1, c = 2^(4n) + 2^(4n-2) + 2^(2n) + 1.

Original entry on oeis.org

7, 175, 3007, 48895, 785407, 12578815, 201310207, 3221159935, 51539345407, 824632672255, 13194135339007, 211106215755775, 3377699653419007, 54043195260010495, 864691127381393407, 13835058050987196415, 221360928867334750207, 3541774862083514433535, 56668397794160864657407
Offset: 1

Author

Robert C. Lyons, Feb 12 2025

Keywords

Comments

Proper subset of A020884.
Conjecture: These Pythagorean triangles are primitive. Verified up to n=100000.
The preceding conjecture is true, since, for n>=1, the values of a,b,c are given by Euclid's formula for generating Pythagorean triples: a=2xy, b=x^2-y^2, c=x^2+y^2 with x=2^(2n) and y=2^(2n-1)+1 and x and y are coprime and x is even and y is odd. - Chai Wah Wu, Feb 13 2025

Crossrefs

Cf. A020884.
Cf. A381006 (long legs), A381007 (hypotenuses), A381008 (perimeters), A381009 (areas).

Programs

  • Magma
    [2^(4*n) - 2^(4*n-2) - 2^(2*n) - 1: n in [1..20]];
    
  • Mathematica
    A381005[n_] := (3*# + 2)*(# - 2)/4 & [4^n]; Array[A381005, 20] (* or *)
    LinearRecurrence[{21, -84, 64}, {7, 175, 3007}, 20] (* Paolo Xausa, Feb 26 2025 *)
  • PARI
    a(n) = 2^(4*n) - 2^(4*n-2) - 2^(2*n) - 1
    
  • Python
    def A381005(n): return ((m:=1<<(n<<1)-1)-1)*(3*m+1) # Chai Wah Wu, Feb 13 2025

Formula

a(n) = 2^(4n) - 2^(4n-2) - 2^(2n) - 1.
a(n) = sqrt( A381007(n)^2 - A381006(n)^2 ).
G.f.: (7 + 28*x - 80*x^2)/((1 - x)*(1 - 4*x)*(1 - 16*x)). - Stefano Spezia, Feb 13 2025

A380130 For n >= 2, let b(n) = 1 if A379784(n) is 3 mod 4, 0 if A379784(n) is 1 mod 4; form the RUNS transform of {b(n), n >= 2}.

Original entry on oeis.org

1, 6, 13, 34, 87, 229, 581, 1591, 4268, 11637, 31944, 88526, 246105, 688982, 1936129, 5463517, 15470445
Offset: 1

Author

Robert C. Lyons, Jan 12 2025

Keywords

Examples

			A379784 begins 1, 5, 3, 7, 11, 19, 23, 31, 13, 17, 29, 37, ..., and the {b(n), n >= 2} sequence begins 0, 1, 1, 1, 1, 1, 1, 0, ..., whose RUNS transform is 1, 6, ...
		

Crossrefs

Programs

  • Mathematica
    nn = 2^19; c[_] := True; q = 0; j = r = 1; s = 4;
    Monitor[Rest@ Reap[Do[m = j + s;
      While[Set[k, SelectFirst[FactorInteger[m][[All, 1]], c]];
        ! IntegerQ[k], m += s];
      c[k] = False; j = k;
      If[# == r, q++, r = #; Sow[q]; q = 1] &[(Mod[k, 4] - 1)/2],
    {n, nn}] ][[-1, 1]], n] (* Michael De Vlieger, Jan 13 2025 *)
  • Python
    from sympy import primefactors
    prev_a379784 = 1
    prev_b = -1
    b_run = 0
    a379784_set = set([prev_a379784])
    seq = []
    max_seq_len = 17
    while len(seq) < max_seq_len:
        c = prev_a379784
        done = False
        while not done:
            c = c + 4
            factors = primefactors(c)
            for factor in factors:
                if factor not in a379784_set:
                    a379784_set.add(factor)
                    if factor % 4 == 3:
                        b = 1
                    else:
                        b = 0
                    if prev_b >= 0:
                        if b == prev_b:
                            b_run += 1
                        else:
                            seq.append(b_run)
                            b_run = 1
                    else:
                        b_run = 1
                    prev_b = b
                    prev_a379784 = factor
                    done = True
                    break
    print(seq)

A379899 a(1) = 2. For n > 1, a(n) = smallest prime factor of c=a(n-1)+4 that is not in {a(1), ..., a(n-1)}; if all prime factors of c are in {a(1), ..., a(n-1)}, then we try the next value of c, which is c+4; and so on.

Original entry on oeis.org

2, 3, 7, 11, 5, 13, 17, 29, 37, 41, 53, 19, 23, 31, 43, 47, 59, 67, 71, 79, 83, 103, 107, 127, 131, 139, 151, 163, 167, 179, 61, 73, 89, 97, 101, 109, 113, 137, 149, 157, 173, 181, 193, 197, 229, 233, 241, 257, 269, 277, 281, 293, 313, 317, 337, 349, 353, 373
Offset: 1

Author

Robert C. Lyons, Jan 05 2025

Keywords

Comments

The following are some statistics about how many terms of the sequence are required, so that the first k primes are included:
- The first 10^2 terms include the first 95 primes.
- The first 10^3 terms include the first 697 primes.
- The first 10^4 terms include the first 6783 primes.
- The first 10^5 terms include the first 98563 primes.
Conjecture: this sequence is a permutation of the primes.

Examples

			a(2) is 3 because the prime factors of c=a(1)+4 (i.e., 6) are 2 and 3, and 2 already appears in the sequence as a(1).
a(6) is 13 because the only prime factor of c=a(5)+4 (i.e., 9) is 3 which already appears in the sequence as a(2). The next value of c (i.e., c+4) is 13, which is prime and does not already appear in the sequence.
		

Programs

  • Maple
    b:= proc(n) option remember; `if`(n<1, {}, b(n-1) union {a(n)}) end:
    a:= proc(n) option remember; local c, p; p:= infinity;
          for c from a(n-1)+4 by 4 while p=infinity do
            p:= min(numtheory[factorset](c) minus b(n-1)) od; p
        end: a(1):=2:
    seq(a(n), n=1..200);  # Alois P. Heinz, Jan 11 2025
  • Mathematica
    nn = 120; c[_] := True; j = 2; s = 4; c[2] = False;
    Reap[Do[m = j + s;
      While[k = SelectFirst[FactorInteger[m][[All, 1]], c];
        ! IntegerQ[k], m += s];
    c[k] = False; j = Sow[k], {nn}] ][[-1, 1]] (* Michael De Vlieger, Jan 11 2025 *)
  • Python
    from sympy import primefactors
    seq = [2]
    seq_set = set(seq)
    max_seq_len=100
    while len(seq) <= max_seq_len:
        c = seq[-1]
        done = False
        while not done:
            c = c + 4
            factors = primefactors(c)
            for factor in factors:
                if factor not in seq_set:
                    seq.append(factor)
                    seq_set.add(factor)
                    done = True
                    break
    print(seq)

A379900 a(n) = position of prime(n) in A379899, or a(n) = -1 if prime(n) is not in A379899.

Original entry on oeis.org

1, 2, 5, 3, 4, 6, 7, 12, 13, 8, 14, 9, 10, 15, 16, 11, 17, 31, 18, 19, 32, 20, 21, 33, 34, 35, 22, 23, 36, 37, 24, 25, 38, 26, 39, 27, 40, 28, 29, 41, 30, 42, 73, 43, 44, 74, 75, 76, 77, 45, 46, 78, 47, 79, 48, 80, 49, 81, 50, 51, 82, 52, 83, 84, 53, 54, 85
Offset: 1

Author

Robert C. Lyons, Jan 05 2025

Keywords

Crossrefs

Cf. A379899.

Programs

  • Python
    from sympy import prime, primefactors, primepi
    def get_a379900(a379899_indices):
        a379900 = []
        count = 1
        while True:
            p = prime(count)
            if p not in a379899_indices:
                break
            a379900.append(a379899_indices[p])
            count += 1
        return a379900
    a379899 = [2]
    a379899_indices = dict()
    a379899_indices[2] = 1
    max_a379899_len=1000
    while len(a379899) <= max_a379899_len:
        candidate = a379899[-1]
        done = False
        while not done:
            candidate = candidate + 4
            factors = primefactors(candidate)
            for factor in factors:
                if factor not in a379899_indices:
                    a379899.append(factor)
                    a379899_indices[factor] = len(a379899)
                    done = True
                    break
    a379900 = get_a379900(a379899_indices)
    print(a379900)

A379776 a(n) = position of prime(n) in A379775, or a(n) = -1 if prime(n) is not in A379775.

Original entry on oeis.org

1, 2, 3, 6, 5, 7, 4, 12, 25, 11, 20, 13, 40, 33, 43, 45, 27, 21, 44, 42, 14, 48, 71, 26, 8, 72, 64, 41, 112, 23, 116, 82, 111, 46, 62, 53, 49, 152, 80, 75, 37, 262, 122, 9, 99, 93, 38, 115, 52, 343, 28, 286, 22, 162, 104, 274, 36, 87, 47, 70, 171, 79, 18, 140
Offset: 1

Author

Robert C. Lyons, Jan 02 2025

Keywords

Crossrefs

Cf. A379775.

Programs

  • Python
    from sympy import prime, primefactors, primepi
    def get_a379776(a379775_indices):
        a379776 = []
        count = 1
        while True:
            p = prime(count)
            if p not in a379775_indices:
                break
            a379776.append(a379775_indices[p])
            count += 1
        return a379776
    a379775 = [2]
    a379775_indices = dict()
    a379775_indices[2] = 1
    max_a379775_len=1000
    while len(a379775) <= max_a379775_len:
        candidate = a379775[-1]
        done = False
        while not done:
            candidate = 2*candidate - 1
            factors = primefactors(candidate)
            for factor in factors:
                if factor not in a379775_indices:
                    a379775.append(factor)
                    a379775_indices[factor] = len(a379775)
                    done = True
                    break
    a379776 = get_a379776(a379775_indices)
    print(a379776)

A379775 a(1) = 2. For n > 1, a(n) = smallest prime factor of c=2*a(n-1)-1 that is not in {a(1), ..., a(n-1)}; if all prime factors of c are in {a(1), ..., a(n-1)}, then we try the next value of c, which is 2*c-1; and so on.

Original entry on oeis.org

2, 3, 5, 17, 11, 7, 13, 97, 193, 769, 29, 19, 37, 73, 577, 1153, 461, 307, 613, 31, 61, 241, 113, 449, 23, 89, 59, 233, 929, 619, 1237, 2473, 43, 337, 673, 269, 179, 211, 421, 41, 107, 71, 47, 67, 53, 139, 277, 79, 157, 313, 1249, 227, 151, 601, 1201, 4801
Offset: 1

Author

Robert C. Lyons, Jan 02 2025

Keywords

Comments

The following are some statistics about how many terms of the sequence are required, so that the first k primes are included:
- The first 10^2 terms include the first 28 primes.
- The first 10^3 terms include the first 92 primes.
- The first 10^4 terms include the first 710 primes.
- The first 10^5 terms include the first 4848 primes.
- The first 10^6 terms include the first 29442 primes.
- The first 10^7 terms include the first 260324 primes.
Conjecture: this sequence is a permutation of the primes.

Examples

			a(6) is 7 because the prime factors of c=2*a(5)-1 (i.e., 21) are 3 and 7, and 3 already appears in the sequence as a(2).
a(8) is 97 because the only prime factor of c=2*a(7)-1 (i.e., 25) is 5 which already appears in the sequence as a(3). The next value of c (i.e., 2*c-1) is 49; its only prime factor is 7 which already appears in the sequence as a(6). The next value of c (i.e., 2*c-1) is 97, which is prime and does not already appear in the sequence.
		

Programs

  • Python
    from sympy import primefactors
    seq = [2]
    seq_set = set(seq)
    max_seq_len=100
    while len(seq) <= max_seq_len:
        c = seq[-1]
        done = False
        while not done:
            c = 2*c-1
            factors = primefactors(c)
            for factor in factors:
                if factor not in seq_set:
                    seq.append(factor)
                    seq_set.add(factor)
                    done = True
                    break
    print(seq)