OFFSET
1,5
COMMENTS
a(n) = -1 for all n == 2 (mod 4).
EXAMPLE
a(7) = 3 because 7 + 1 = 8 and 7 + 4 = 11 are not perfect squares, but 7 + 9 = 16 is.
MAPLE
A172038 := proc(n) local r, kpa, kma, a, k ; r := {} ; for kpa in numtheory[divisors](n) do kma := n/kpa ; if type(kpa-kma, 'even') then a := (kpa-kma)/2 ; k := kpa- a; if a >= 0 and k >= 0 and kpa+kma = 2*k then r := r union {a}; end if; end if; end do ; if r <> {} then return min(op(r)) ; else return -1 ; end if; end proc: for n from 1 to 100 do printf("%d, ", A172038(n)) ; end do : # R. J. Mathar, Feb 07 2010
CROSSREFS
KEYWORD
sign
AUTHOR
J. Lowell, Jan 23 2010
EXTENSIONS
More terms from R. J. Mathar, Feb 07 2010
STATUS
approved