A308085 a(n) is the least positive number k such that n*(n-1)/2 + k*(k-1)/2 is a square.
1, 1, 2, 3, 4, 2, 6, 7, 1, 9, 10, 6, 3, 13, 14, 2, 16, 17, 18, 4, 6, 21, 3, 23, 24, 9, 5, 27, 13, 4, 30, 31, 2, 6, 34, 35, 5, 37, 38, 16, 7, 30, 23, 6, 44, 20, 46, 8, 16, 1, 7, 51, 12, 53, 9, 42, 23, 8, 58, 59, 60, 10, 27, 63, 9, 65, 20, 67, 11, 69, 6, 10, 72, 3, 44, 12, 21, 77, 11, 34, 80, 46
Offset: 1
Examples
a(5) = 4 because 4*3/2 + 5*4/2 = 4^2 and none of 1*0/2 + 5*4/2, 2*1/2 + 5*4/2, 3*2/2 + 5*4/2 are squares.
Links
- Robert Israel, Table of n, a(n) for n = 1..10000
Programs
-
Maple
f:= proc(n) local k; for k from 1 do if issqr((k*(k-1)+n*(n-1))/2) then return k fi od end proc: map(f, [$1..100]);
-
PARI
a(n) = {my(k=1); while (!issquare(n*(n-1)/2 + k*(k-1)/2), k++); k;} \\ Michel Marcus, Jun 27 2019
Comments