A373028 a(n) is the least positive integer k such that 3*n^2 + 2*n + k^2 is a square.
2, 3, 4, 5, 6, 1, 8, 9, 10, 2, 12, 13, 14, 3, 16, 10, 18, 4, 20, 21, 2, 5, 24, 25, 10, 6, 28, 29, 30, 7, 32, 33, 34, 8, 36, 3, 38, 9, 20, 41, 42, 10, 44, 45, 46, 11, 48, 49, 50, 12, 4, 53, 54, 13, 56, 33, 58, 14, 60, 23, 62, 15, 64, 65, 66, 5, 68, 69, 70, 17, 72, 73, 74, 18, 76, 49, 78, 19, 80, 33, 6
Offset: 1
Examples
a(1) = 2 because 3*1^2 + 2*1 = 5 and 5 + 1^2 is not a square, but 5 + 2^2 is. So, 2 is a term. a(2) = 3 because 3*2^2 + 2*2 = 16 and 16 + 1^2 and 16 + 2^2 are not squares,but 16 + 3^2 is. So, 3 is a term.
Programs
-
PARI
a(n) = my(m=3*n^2+2*n, k=1); while (!issquare(m+k^2), k++); k; \\ Michel Marcus, May 20 2024
Comments