login
A331261
List of pairs of numbers having certain properties (see Comments).
0
0, 1, 4, 5, 24, 25, 144, 145, 840, 841, 4900, 4901, 28560, 28561, 166464, 166465, 970224, 970225, 5654884, 5654885, 32959080, 32959081, 192099600, 192099601, 1119638520, 1119638521, 6525731524, 6525731525, 38034750624, 38034750625, 221682772224, 221682772225
OFFSET
1,3
COMMENTS
List of pairs of numbers with following properties:
(1) The numbers in each pair are consecutive.
(2) At least one integer is a square.
(3) The sum of each pair is another square.
(4) The position of the square term oscillates between left and right.
(5) The triple formed by the pair and the square root of their sum is a Pythagorean triple.
PROG
(Python)
# a Python 3.7 program to arrive at Pell-Fermat type Pythagorean triples below a given/entered number.
import math
number = None
# Taking the input from user
number = 10000000
squareList = []
subPythagoreanTriple= []
needed = 1.0
while(needed <= number):
root = math.sqrt(needed)
if int(root + 0.5) ** 2 == needed:
squareList.append(needed)
flag = True
else:
#print(number, "is not a perfect square")
pass
flag = None
needed = needed + 1
def checkSubPythagoreanTriple():
for i in squareList:
SPTless = i-1
SPTmore = i+1
firstSide = 2*i - 1
secondSide = 2*i + 1
firstSideRoot = math.sqrt(firstSide)
secondSideRoot = math.sqrt(secondSide)
if int(firstSideRoot + 0.5) ** 2 == firstSide or int(secondSideRoot + 0.5) ** 2 == secondSide :
if(i%2 == 1):
subPythagoreanTriple.append(int(i-1))
subPythagoreanTriple.append(int(i))
else:
subPythagoreanTriple.append(int(i))
subPythagoreanTriple.append(int(i+1))
else:
pass
def main():
checkSubPythagoreanTriple()
main()
print(str(subPythagoreanTriple))
(Magma) a:=[0, 1]; for k in [2..1000000] do if IsSquare(2*k*k+1) then a:=a cat [k^2, k^2+1]; else if IsSquare(2*k*k-1) then a:=a cat [k^2-1, k^2]; end if; end if; end for; a; // Marius A. Burtea, Jan 21 2020
CROSSREFS
Sequence in context: A361981 A338422 A171885 * A063986 A039583 A042123
KEYWORD
nonn
AUTHOR
Chandrasekhar Karri, Jan 13 2020
EXTENSIONS
More terms from Marius A. Burtea, Jan 13 2020
STATUS
approved