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

A306236 a(n) is the smallest integer m > n with integer j > m makes n^2, m^2 and j^2 an arithmetic progression.

Original entry on oeis.org

5, 10, 15, 20, 25, 30, 13, 40, 45, 50, 55, 60, 65, 26, 75, 80, 25, 90, 95, 100, 39, 110, 37, 120, 125, 130, 135, 52, 145, 150, 41, 160, 165, 50, 65, 180, 185, 190, 195, 200, 85, 78, 215, 220, 225, 74, 65, 240, 61, 250, 75, 260, 265, 270, 275, 104, 285, 290
Offset: 1

Views

Author

Jinyuan Wang, Feb 08 2019

Keywords

Comments

a(n) and n have the same parity.
If k is a term in A058529, gcd(k, a(k)) does not necessarily equal 1. For example, k = 217, 289, 343, 497, 529, 553, 679, 889, 961, 1127, ...
Conjecture: if gcd(k, a(k)) = 1, then k is a term in A058529.
Proof: if k is not in A058529, then k either is even or has a prime factor p == 3, 5 (mod 8). If k is even, then a(k) is also even, so 2 divides gcd(k, a(k)). If k has a prime factor p == 3, 5 (mod 8), then 2*m^2 == j^2 (mod p), 2^((p-1)/2)*m^(p-1) == -m^(p-1) == j^(p-1) (mod p), so m and j must both be multiples of p. As a result, p divides gcd(k, a(k)). - Jianing Song, Feb 09 2019

Examples

			a(1) = 5 because 1^2, 5^2 and 7^2 are an arithmetic progression.
		

Crossrefs

Cf. A003629, A058529, A289398 (integer j).

Programs

  • Mathematica
    Array[Block[{m = # + 2}, While[! IntegerQ@ Sqrt[2 m^2 - #^2], m += 2]; m] &, 58] (* Michael De Vlieger, Feb 15 2019 *)
  • PARI
    a(n) = {m=n+2; while(issquare(2*m^2-n^2)==0, m=m+2); m;}

Formula

a(n) = sqrt((n^2 + A289398(n)^2)/2).
For positive integer k, a(2*k^2 - 1) = 2*k^2 + 2*k + 1.
a(A003629(k)) = 5*A003629(k).
a(n) <= 5*n.
a(k*n) = k*a(n) for all k not in A058529. - Jianing Song, Feb 15 2019

A379596 a(n) is the least positive integer k for which k^2 + (k + n)^2 is a square.

Original entry on oeis.org

3, 6, 9, 12, 15, 18, 5, 24, 27, 30, 33, 36, 39, 10, 45, 48, 7, 54, 57, 60, 15, 66, 12, 72, 75, 78, 81, 20, 87, 90, 9, 96, 99, 14, 25, 108, 111, 114, 117, 120, 36, 30, 129, 132, 135, 24, 16, 144, 11, 150, 21, 156, 159, 162, 165, 40, 171, 174, 177, 180, 183, 18, 45
Offset: 1

Views

Author

Felix Huber, Feb 15 2025

Keywords

Comments

a(n) is also the smallest short leg of a Pythagorean triangle where the difference between the two legs is n.
A289398(n) is the least integer m > n for which (n^2 + m^2)/2 is a square. This is equivalent to the least positive integer k for which (n^2 + (n + 2*k)^2)/2 = k^2 + (n + k)^2 is a square. From m = n + 2*k follows a(n) = (A289398(n) - n)/2.

Examples

			a(1) = 3 because 3^2 + (3 + 1)^2 = 5^2 and there is no smaller positive integer k than 3 with that property.
a(28) = 20 because 20^2 + (20 + 28)^2 = 52^2 and there is no smaller positive integer k than 20 with that property.
		

Crossrefs

Programs

  • Maple
    A379596:=proc(n)
        local k;
        for k do
            if issqr(k^2+(k+n)^2) then
                return k
            fi
        od
    end proc;
    seq(A379596(n),n=1..63);
  • Mathematica
    s={};Do[k=0;Until[IntegerQ[Sqrt[k^2+(k+n)^2]],k++];AppendTo[s,k],{n,63}];s (* James C. McMahon, Mar 02 2025 *)
  • PARI
    a(n) = my(k=1); while (!issquare(k^2 + (k + n)^2), k++); k; \\ Michel Marcus, Feb 15 2025
    
  • Python
    from itertools import count
    from sympy.ntheory.primetest import is_square
    def A379596(n): return next(k for k in count(1) if is_square(k**2+(k+n)**2)) # Chai Wah Wu, Mar 02 2025

Formula

a(n) = (A289398(n) - n)/2.
Showing 1-2 of 2 results.