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: Ralf Steiner

Ralf Steiner's wiki page.

Ralf Steiner has authored 80 sequences. Here are the ten most recent ones:

A349682 a(n) = A000292(6*n + 1) where A000292 are the tetrahedral numbers.

Original entry on oeis.org

1, 84, 455, 1330, 2925, 5456, 9139, 14190, 20825, 29260, 39711, 52394, 67525, 85320, 105995, 129766, 156849, 187460, 221815, 260130, 302621, 349504, 400995, 457310, 518665, 585276, 657359, 735130, 818805, 908600, 1004731, 1107414, 1216865, 1333300, 1456935, 1587986
Offset: 0

Author

Ralf Steiner, Nov 25 2021

Keywords

Crossrefs

Programs

  • Mathematica
    nterms=50;Table[36n^3+36n^2+11n+1,{n,0,nterms-1}] (* Paolo Xausa, Nov 25 2021 *)
  • PARI
    a(n) = subst(m*(m+1)*(m+2)/6, 'm, 6*n+1); \\ Michel Marcus, Dec 16 2021
    
  • Python
    def A349682(n): return n*(n*(36*n + 36) + 11) + 1 # Chai Wah Wu, Dec 27 2021

Formula

a(n) = 1 + 11*n + 36*n^2 + 36*n^3 = (1 + 2*n)*(1 + 3*n)*(1 + 6*n).
G.f.: (1 + 80*x + 125*x^2 + 10*x^3)/(1 - x)^4. - Stefano Spezia, Nov 29 2021
From Elmo R. Oliveira, Aug 22 2025: (Start)
E.g.f.: exp(x)*(1 + 83*x + 144*x^2 + 36*x^3).
a(n) = 4*a(n-1) - 6*a(n-2) + 4*a(n-3) - a(n-4). (End)
From Amiram Eldar, Aug 31 2025: (Start)
Sum_{n>=0} 1/a(n) = Pi/(4*sqrt(3)) + 2*log(2) - 3*log(3)/4.
Sum_{n>=0} (-1)^n/a(n) = (3/4 - 1/sqrt(3))*Pi + sqrt(3)*log(2 + sqrt(3))/2 - log(2). (End)

A334909 Area/6 of primitive Pythagorean triangles given in A334638 as triples.

Original entry on oeis.org

1, 35, 770, 14260, 244776, 4053840, 65979040, 1064678720, 17107266176, 274296689920, 4393395202560, 70331527418880, 1125602147608576, 18012016334950400, 288211318352814080, 4611533554425610240, 73785756576381566976, 1180581862943988449280
Offset: 0

Author

Ralf Steiner, May 16 2020

Keywords

Comments

See A334638 for these triangles, and also for the Firstov reference.
For primitive Pythagorean triangle (x, y, z) = (u^2 - v^2, 2*u*v, u^2 + v^2) the area is A = x*y/2 = u*v*(u^2 - v^2) = z*h/2 with altitude h, and h is an irreducible fraction.
From A334638 follows A(n)/6 = (x(n)/3)*(y(n)/4) = A171477(n)*A010036(n), for n >= 0. See the formula section.
Limit_{n->infinity} A(n)/(3*2^(4*n+3)) = 1. See the formula section. - Wolfdieter Lang, Jun 14 2020

Examples

			a(0) = 3*4/12 = 1 for (3, 4, 5).
		

Crossrefs

Programs

  • Mathematica
    Table[ 2^(-1 + n) (-1 + 3 2^n) (-1 + 2^(1 + n)) (-1 + 2^(2 + n))/3, {n, 0, 17}]
  • PARI
    Vec((1 + 5*x) / ((1 - 2*x)*(1 - 4*x)*(1 - 8*x)*(1 - 16*x)) + O(x^20)) \\ Colin Barker, May 17 2020

Formula

a(n) = 2^(n-1)*(3*2^n - 1)*(2^(n+1) - 1)*(2^(n+2) - 1)/3.
a(n) = 2^(4*n+2)*(1 - 13/(3*2^(n+2)) + 3/2^(2*n+3) - 1/(3*2^(3*(n+1)))), for n >= 0.
From Colin Barker: (Start)
G.f.: (1 + 5*x) / ((1 - 2*x)*(1 - 4*x)*(1 - 8*x)*(1 - 16*x)).
a(n) = 30*a(n-1) - 280*a(n-2) + 960*a(n-3) - 1024*a(n-4) for n > 3. (End)

Extensions

Edited by Wolfdieter Lang, Jun 14 2020

A334638 Three-column array pPT read by rows: subsequence of primitive Pythagorean triples (x, y, z) with x = A153893^2 - A000079^2, y = 2*A153893*A000079, z = A153893^2 + A000079^2, ordered by increasing z.

Original entry on oeis.org

3, 4, 5, 21, 20, 29, 105, 88, 137, 465, 368, 593, 1953, 1504, 2465, 8001, 6080, 10049, 32385, 24448, 40577, 130305, 98048, 163073, 522753, 392704, 653825, 2094081, 1571840, 2618369, 8382465, 6289408, 10479617, 33542145, 25161728, 41930753, 134193153, 100655104, 167747585, 536821761, 402636800, 671039489, 2147385345, 1610579968, 2684256257
Offset: 0

Author

Ralf Steiner, May 07 2020

Keywords

Comments

Let [h21] = {{1, 3}, {0, 2}} be the matrix [h_2]*[h_1] in Firstov's notation, from eqs. (24) and (39). Then primitive Pythagorean triples (pPT) (x(n), y(n), z(n)) = (u(n)^2 - v(n)^2, 2*u(n)*v(n), u(n)^2 + v(n)^2), with u(n) and v(n) of different parity, gcd(u(n), v(n)) = 1, and u(n) > v(n) > 0, are generated by (u(n), v(n))^T = [h21]^n*(2,1)^T (T for transpose).
For n > 0: (x(n), y(n), z(n)) = (1, 0, 1) (mod 4). Thus some z are Pythagorean primes (A002144).
The triples converge to the proportion (4:3:5) with:
lim_{n->infinity} x(n)/y(n) = 4/3, lim_{n->infinity} y(n)/z(n) = 3/5.
Altitude h(n) = x(n)*y(n)/z(n) is an irreducible fraction because of primitivity.
From Wolfdieter Lang, Jun 13 2020: (Start)
[h21]^n = sqrt(2)^n*(S(n, 3/sqrt(2))*[1_3] + S(n-1, 3/sqrt(2))*(1/sqrt(2))*([h21] - 3*[1_3])) with the Chebyshev S polynomials (A049310).
u(n) = sqrt(2)^n*(2*S(n, 3/sqrt(2)) - (1/sqrt(2))*S(n-1, 3/sqrt(2)))
= A153893(n),
v(n) = sqrt(2)^n*(S(n, 3/sqrt(2)) - (1/sqrt(2))*S(n-1, 3/sqrt(2)))
= A000079(n). Proof from the recurrence, using the Cayley-Hamilton theorem.
With the monic Chebyshev T polynomials, called R in A127672:
x(n)/3 = 2^(n+1)*(R(2*(n+1), 3/sqrt(2)) - (sqrt(2)/3)*R(2*n+1,3/sqrt(2)) - 1) = A171477(n),
y(n)/4 = 3*2^(n-1)*(sqrt(2)*R(2*n+1,3/sqrt(2)) - R(2*n,3/sqrt(2)) - 1/3)
= A010036(n),
z(n) = 3*2^(n+1)*((3/sqrt(2))*R(2*n+1, 3/sqrt(2)) - (4/3)*R(2*n,3/sqrt(2)) - 1).
Using 2^n*Rnx(2*n, 3/sqrt(2)) = A052539(n) = 2^(2*n) + 1, and
2^(n)*(sqrt(2)/3)*Rnx(2*n+1, 3/sqrt(2)) = A007583(n) = (2^(2*n + 1) + 1)/3,
produces the explicit formulas given by the author in the formula section.
G.f.s for {x(n)} G0(x) = 3/((1 - 4*x)*(1 - 2*x)*(1 - x)), for {y(n)} G1(x) = 4*(1-x)/((1 - 4*x)*(1 - 2*x)), and for {z(n)} = (5 - 6*x + 4*x^2)/((1 - 4*x)*(1 - 2*x)*(1 - x)). This produces the g.f. for the array, read as sequence {a(n)}: G(x) = G0(x^3) + x*G1(x^3) + x^2*G2(x^3) given in the formula section by Colin Barker.
(End)

Examples

			The three-column array pPT(n,k) begins:
n\k        0        1         2
-------------------------------
0:         3        4         5
1:        21       20        29
2:       105       88       137
3:       465      368       593
4:      1953     1504      2465
5:      8001     6080     10049
6:     32385    24448     40577
7:    130305    98048    163073
8:    522753   392704    653825
9:   2094081  1571840   2618369
10:  8382465  6289408  10479617
... - _Wolfdieter Lang_, Jun 13 2020
		

Programs

  • Mathematica
    h21={{1, 3}, {0, 2}}; l = {}; Do[v = MatrixPower[h21, n, {2, 1}]; p = v[[1]]; q = v[[2]];
    a = p^2 - q^2; b = 2 p q; c = p^2 + q^2; l = AppendTo[l, {a, b, c}], {n, 0, 14}]; l // Flatten
  • PARI
    Vec((3 + 4*x + 5*x^2 - 8*x^4 - 6*x^5 + 4*x^7 + 4*x^8) / ((1 - x)*(1 + x + x^2)*(1 - 2*x^3)*(1 - 4*x^3)) + O(x^35)) \\ Colin Barker, Jun 12 2020

Formula

The three-column array PT(n, k) is for k = 0, 1, 2: x(n), y(n), z(n), for n >= 0, with
x(n) = a(3*n + 0) = A153893(n)^2 - A000079(n)^2 = 1 - 3*2^(n+1) + 2^(2*n+3) = binomial(2^(n+2) - 1, 2) = 3*A171477(n),
y(n) = a(3*n + 1) = 2*A153893(n)*A000079(n) = 2^(n+1)*(-1 + 3*2^n) = 4*A010036(n),
z(n) = a(3*n + 2) = A153893(n)^2 + A000079(n)^2 = 1 - 6*2^n + 10*2^(2*n).
From Colin Barker, May 08 2020: (Start)
G.f. (read as sequence {a(n)}): (3 + 4*x + 5*x^2 - 8*x^4 - 6*x^5 + 4*x^7 + 4*x^8) / ((1 - x)*(1 + x + x^2)*(1 - 2*x^3)*(1 - 4*x^3)).
a(n) = 7*a(n-3) - 14*a(n-6) + 8*a(n-9), for n > 8.
(End)

Extensions

Edited, and corrected proportion by Wolfdieter Lang, Jun 13 2020
Minor grammatical edits. - N. J. A. Sloane, Sep 12 2020

A334908 Area/6 of primitive Pythagorean triangles generated by {{2, 0}, {1, -1}}^n * {{2}, {1}}, for n >= 0.

Original entry on oeis.org

1, 10, 220, 3080, 52976, 818720, 13333440, 211474560, 3398520576, 54257082880, 869067996160, 13897453373440, 222420341682176, 3558236809994240, 56935698394234880, 910939899548958720, 14575288593717067776, 233202615903456460800
Offset: 0

Author

Ralf Steiner, May 16 2020

Keywords

Comments

Matrix {{2, 0}, {1, -1}} is [g_{-2}] given by Firstov in eq. (24).
These primitive Pythagorean triples are also given by Lee Price as (M_2)^n (3,4,5)^T (T for transposed), with M_2 = {{2, 1, 1}, {2, -2, 2}, {2, -1, 3}}.
For a primitive Pythagorean triangle (x, y, z) = (u^2-v^2, 2*u*v, u^2+v^2) the area is A = x*y/2 = u*v*(u^2 - v^2) = z*h/2 with altitude h, and h is an irreducible fraction. Here:
x(n) = A084175(n+2).
y(n) = 4*(A084175(n+1) - A084175(n)) = A054881(n+2).
= 2*A192382(n+1) = 4*A003683(n+1).
z(n) = A084175(n+2) + 2*A084175(n+1) - 4*A084175(n).
= A108924(n+2)/2 = A084175(n+2) + 2*A139818(n+1).
= A000302(n+1) + A139818(n+1).
u(n) = A000079(n+1) = 2^(n+1).
v(n) = A001045(n+1) = (2^(n+1) + (-1)^n)/3.
For the area A(n): Limit_{n -> oo} (3^3/(2^(4*n+7)))*A(n) = 1. See the formula section. - Wolfdieter Lang, Jun 14 2020

Examples

			a(0) = 3*4/12 = 1 for the triangle (3, 4, 5).
		

Programs

  • Magma
    [(2^(2*n+1)*(2^(2*n+5) -3) +(-2)^n*(3*2^(2*n+3) -1))/81: n in [0..40]]; // G. C. Greubel, Feb 18 2023
    
  • Mathematica
    Table[(2^(2*n+1)*(2^(2*n+5) -3) + (-2)^n*(3*2^(2*n+3) -1))/3^4, {n,0,40}]
  • SageMath
    [(2^(2*n+1)*(2^(2*n+5) -3) +(-2)^n*(3*2^(2*n+3) -1))/81 for n in range(41)] # G. C. Greubel, Feb 18 2023

Formula

a(n) = ( 2^(4*n+6) - 3*2^(2*n+1) - 3*(-2)^(3*n+3) - (-2)^n )/3^4.
G.f.: 1 / ((1 + 2*x)*(1 - 4*x)*(1 + 8*x)*(1 - 16*x)). - Colin Barker, Jun 11 2020
E.g.f.: (1/81)*(24*exp(-8*x) - exp(-2*x) - 6*exp(4*x) + 64*exp(16*x)). - G. C. Greubel, Feb 18 2023

A326917 Nonnegative numbers of the form 8*T(x) - T(y) with 0 <= x, 0 <= y, where T() denotes a triangular number.

Original entry on oeis.org

0, 2, 3, 5, 7, 8, 9, 12, 14, 15, 18, 20, 21, 23, 24, 25, 27, 29, 32, 33, 34, 35, 38, 42, 44, 45, 47, 48, 52, 53, 54, 57, 59, 60, 62, 63, 65, 70, 71, 74, 75, 77, 78, 79, 80, 84, 88, 89, 90, 92, 93, 96, 98, 99, 102, 104, 105, 107, 110, 113, 114, 115, 117, 119
Offset: 1

Author

Ralf Steiner, Oct 21 2019

Keywords

Comments

When incremented by 1 this is also the difference between an odd square (1 + 8*T) and a triangular number T.

Examples

			8*A000217(1) - A000217(2) = 8*1 - 3 = 5 = a(4).
		

Crossrefs

Cf. A000217 (T), A175035, A016754 (odd squares).

Programs

  • Mathematica
    T[n_] := n (n + 1)/2;Select[Union[Flatten[Table[8 T[x] - T[y], {x, 0, 15}, {y, 0, 100}]]],115 >= # >= 0 &]

Formula

a(n) = A175035(n) - 1.

A309388 Numbers y such that x*(x+1) + y*(y+1) = z*(z+1) does not have a solution in positive integers x, z with x <= y.

Original entry on oeis.org

1, 3, 4, 7, 8, 11, 12, 15, 16, 19, 23, 28, 31, 32, 36, 40, 43, 47, 52, 59, 60, 63, 64, 67, 71, 72, 79, 83, 87, 88, 96, 100, 103, 107, 108, 112, 127, 128, 131, 136, 139, 148, 151, 156, 163, 167, 172, 176, 179, 180, 183, 187, 191, 192, 196, 199, 211, 223, 227
Offset: 1

Author

Ralf Steiner, Aug 02 2019

Keywords

Comments

The similar sequence A027861 (complement of A012132) is related to primes.

Crossrefs

Complement of A308395.

Programs

  • Maple
    filter:= proc(y) local S;
      S:= map(t -> subs(t, x), [isolve(x*(x+1)+y*(y+1)=z*(z+1))]);
      select(t -> t>0 and t<=y, S) = []
    end proc:
    select(filter, [$1..300]); # Robert Israel, Aug 06 2019
  • Mathematica
    max = 500; lst = {}; For[x = 1, x < max, x++,
    For[y = x, y < max, y++,
      For[z = y, z < max, z++,
       If[x (x + 1) + y (y + 1) == z (z + 1),
        lst = AppendTo[lst, y]]]]]; lst =
    Select[Union[lst], # < max/2 &]; Complement[Range[Length[lst]], lst]
  • Python
    from sympy import integer_nthroot
    A309388_list, y, w = [], 1, 0
    while len(A309388_list) < 10000:
        w += y
        z = 0
        for x in range(1,y+1):
            z += x
            if integer_nthroot(8*(w+z)+1,2)[1]:
                break
        else:
            A309388_list.append(y)
        y += 1 # Chai Wah Wu, Aug 07 2019

A308395 Numbers y such that x*(x+1) + y*(y+1) = z*(z+1) is solvable in positive integers x, z with x <= y.

Original entry on oeis.org

2, 5, 6, 9, 10, 13, 14, 17, 18, 20, 21, 22, 24, 25, 26, 27, 29, 30, 33, 34, 35, 37, 38, 39, 41, 42, 44, 45, 46, 48, 49, 50, 51, 53, 54, 55, 56, 57, 58, 61, 62, 65, 66, 68, 69, 70, 73, 74, 75, 76, 77, 78, 80, 81, 82, 84, 85, 86, 89, 90, 91, 92, 93, 94, 95, 97
Offset: 1

Author

Ralf Steiner, Jul 31 2019

Keywords

Examples

			14 is a term because 14*15 + 14*15 = 20*21.
		

Crossrefs

Cf. A012132.

Programs

  • Mathematica
    max = 220; lst = {}; For[x = 1, x < max, x++,
    For[y = x, y < max, y++,
      For[z = y, z < max, z++,
       If[x (x + 1) + y (y + 1) == z (z + 1),
        lst = AppendTo[lst, y]]]]]; Select[Union[lst], # < max/2 &]
  • Python
    from sympy import integer_nthroot
    A308395_list, y, w = [], 1, 0
    while len(A308395_list) < 10000:
        w += y
        z = 0
        for x in range(1,y+1):
            z += x
            if integer_nthroot(8*(w+z)+1,2)[1]:
                A308395_list.append(y)
                break
        y += 1 # Chai Wah Wu, Aug 02 2019

A319673 Primes that are neither a twin prime nor a Sophie Germain or safe prime.

Original entry on oeis.org

37, 67, 79, 97, 127, 157, 163, 211, 223, 257, 277, 307, 317, 331, 337, 353, 367, 373, 379, 389, 397, 401, 409, 439, 449, 457, 487, 499, 541, 547, 557, 577, 607, 613, 631, 647, 673, 677, 691, 701, 709, 727, 733, 739, 751, 757, 769, 773, 787, 797, 853, 877, 907, 919, 929, 937, 941, 947, 967, 971, 977, 991, 997
Offset: 1

Author

Ralf Steiner, Sep 25 2018

Keywords

Examples

			37 is prime, but it is not a twin prime (neither 35 nor 39 are prime), it is not a Sophie Germain prime (2*37 + 1 = 75 is not prime), and it is not a safe prime ((37 - 1)/2 = 18 is not prime).  So 37 is in the sequence.
		

Crossrefs

Programs

  • GAP
    Filtered([1..1000],p->IsPrime(p) and not IsPrime(p-2) and not IsPrime(p+2) and not IsPrime(2*p+1) and not IsPrime((p-1)/2)); # Muniru A Asiru, Sep 27 2018
    
  • Magma
    [p: p in PrimesUpTo(1000) | not IsPrime(p-2) and not IsPrime(p+2)and not IsPrime(2*p+1)and not IsPrime((p-1) div 2)]; // Vincenzo Librandi, Oct 25 2018
  • Maple
    select(p->isprime(p) and not isprime(p-2) and not isprime(p+2) and not isprime(2*p+1) and not isprime((p-1)/2),[$1..1000]); # Muniru A Asiru, Sep 27 2018
  • Mathematica
    Select[Prime@ Range@ PrimePi[10^3], NoneTrue[{# - 2, # + 2, 2 # + 1, (# - 1)/2}, PrimeQ] &] (* Michael De Vlieger, Sep 26 2018 *)
  • PARI
    isok(p) = isprime(p) && !isprime(p-2) && !isprime(p+2) && !isprime(2*p+1) && !isprime((p-1)/2); \\ Michel Marcus, Sep 26 2018
    

Formula

A319506 Number of numbers of the form 2*p or 3*p between consecutive triangular numbers T(n - 1) < {2,3}*p <= T(n) with p prime.

Original entry on oeis.org

0, 0, 2, 2, 2, 1, 2, 2, 2, 2, 3, 2, 3, 2, 3, 4, 3, 3, 3, 4, 5, 2, 4, 3, 5, 5, 2, 6, 3, 5, 5, 5, 5, 6, 4, 3, 7, 5, 6, 6, 5, 6, 7, 4, 5, 6, 6, 7, 6, 7, 9, 6, 6, 7, 8, 5, 6, 7, 9, 7, 7, 8, 7, 11, 7, 8, 8, 7, 6, 11, 5, 12, 7, 7, 7, 11, 11, 7, 12, 10, 9, 10, 7, 9, 9, 8, 10, 12, 10, 7, 10, 9, 12, 9, 11, 10, 13, 14, 10, 7
Offset: 1

Author

Ralf Steiner, Sep 21 2018

Keywords

Comments

1) It is conjectured that for k >= 1 each left-sided half-open interval (T(2*k - 1), T(2*k + 1)] and (T(2*k), T(2*(k + 1))] contains at least one composite c_2 = 2*p_i and c_3 = 3*p_j each, p_i, p_j prime, i != j.
2) It is conjectured that for k >= 3 each left-sided half-open interval (T(k - 1), T(k)] contains at least one composite c_2 = 2*p_i or c_3 = 3*p_j, p_i, p_j prime, i != j.
3) It is conjectured that for k >= 2 each left-sided half-open interval (T(2*k - 1), T(2*k)] contains at least one composite c_3 = 3*p_j, p_j prime.
4) It is conjectured that for k >= 1 each left-sided half-open interval (T(2*k), T(2*k + 1)] contains at least one composite c_2 = 2*p_i, p_i prime.

Examples

			a(3) = 2 since (T(3 - 1),T(3)] = {4 = 2*2,5,6 = 2*3 = 3*2}, 2,3 prime.
		

Crossrefs

Cf. A000040 (primes), A000217 (triangular numbers).

Programs

  • Mathematica
    Table[Count[
      Select[Range[(n - 1) n/2 + 1, n (n + 1)/2],
       PrimeQ[#/2] || PrimeQ[#/3] &], _Integer], {n, 1, 100}]
    p23[{a_,b_}]:=Module[{r=Range[a+1,b]},Count[Union[Join[r/2,r/3]], ?PrimeQ]]; p23/@Partition[Accumulate[Range[0,100]],2,1] (* _Harvey P. Dale, May 02 2020 *)
  • PARI
    isok1(n, k) = ((n%k) == 0) && isprime(n/k);
    isok2(n) = isok1(n,2) || isok1(n,3);
    t(n) = n*(n+1)/2;
    a(n) = sum(i=t(n-1)+1, t(n), isok2(i)); \\ Michel Marcus, Oct 12 2018

A316676 Ordered set of products (P_s(k) + 1)*(P_s'(k') + 1), s,s' >= 3, k,k' in {3,4} with nontrivial polygonal numbers P_s(k).

Original entry on oeis.org

49, 70, 77, 91, 100, 110, 112, 119, 121, 130, 133, 143, 154, 160, 161, 169, 170, 175, 176, 187, 190, 196, 203, 208, 209, 217, 220, 221, 230, 238, 242, 245, 247, 250, 253, 256, 259, 272, 275, 280, 286, 287, 289, 290, 299, 301, 304, 308, 310, 319, 322, 323, 325, 329, 340, 341, 343, 350, 352, 361, 364
Offset: 1

Author

Ralf Steiner, Jul 10 2018

Keywords

Comments

Conjecture: All odd numbers d >= 17 excluding d in {P_s(k), s >= 3, k >= 5; P_s(k) - 1, s >= 3, k >= 4; a(n)} are accurate the primes p = d >= 17.

Crossrefs

Cf. A090466 (nontrivial polygonal numbers).

Programs

  • Mathematica
    pn[s_, k_] := s (k - 1) k/2 - (k - 1)^2 + 1;
    lst = {}; Do[n = (pn[s, k] + 1) (pn[ss, ks] + 1);
    lst = Union[lst, {n}], {s, 3, 20}, {ss, 3, 20}, {k, 3, 4}, {ks, 3,
      4}]; Take[lst, 70]