login
This site is supported by donations to The OEIS Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A172038 Smallest nonnegative integer such that n + (a(n))^2 is a perfect square, or -1 if no such integer exists. 2
0, -1, 1, 0, 2, -1, 3, 1, 0, -1, 5, 2, 6, -1, 1, 0, 8, -1, 9, 4, 2, -1, 11, 1, 0, -1, 3, 6, 14, -1, 15, 2, 4, -1, 1, 0, 18, -1, 5, 3, 20, -1, 21, 10, 2, -1, 23, 1, 0, -1, 7, 12, 26, -1, 3, 5, 8, -1, 29, 2, 30, -1, 1, 0, 4, -1, 33, 16, 10, -1, 35, 3, 36, -1, 5, 18, 2, -1, 39, 1, 0, -1, 41, 4, 6 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,5

COMMENTS

a(n) = -1 for all n == 2 (mod 4).

LINKS

Table of n, a(n) for n=1..85.

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

Sequence in context: A072127 A186976 A160550 * A226131 A199056 A144966

Adjacent sequences:  A172035 A172036 A172037 * A172039 A172040 A172041

KEYWORD

sign

AUTHOR

J. Lowell, Jan 23 2010

EXTENSIONS

More terms from R. J. Mathar, Feb 07 2010

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified November 12 04:16 EST 2019. Contains 329047 sequences. (Running on oeis4.)