OFFSET
1,3
COMMENTS
LINKS
Charles R Greathouse IV, Table of n, a(n) for n = 1..10000
FORMULA
a(n) ~ 4n^2. - Charles R Greathouse IV, May 07 2015
a(n) = A257282(n)^2. - M. F. Hasler, May 08 2015
EXAMPLE
0, 1, 4, 9, 16, 36, are in this sequence because first 14 sums of two consecutive nonsquares are 5, 8, 11, 13, 15, 18, 21, 23, 25, 27, 29, 32, 35, 37.
MATHEMATICA
lim = 15000; s = Plus @@@ (Partition[#, 2, 1] & @ Complement[Range@ lim, Range[Floor@ Sqrt[lim]]^2]); Select[Range@ Floor[Sqrt[lim]]^2, !MemberQ[s, #] &] (* Michael De Vlieger, Apr 29 2015 *)
lst=Partition[Select[Range[0, 10^6], !IntegerQ[Sqrt[#]]&], 2, 1]/.{a_, b_}-> a+b; a256944=Complement[Table[n^2, {n, 0, Sqrt[Last[lst]]}], lst] (* timing improved by Ivan N. Ianakiev, Apr 30 2015 *)
Union[#, Range[0, Max@ #, 2]] &@ Numerator[Convergents[Sqrt@ 2, 6]]^2 (* Michael De Vlieger, Aug 06 2016, after Harvey P. Dale at A001333 *)
PROG
(PARI) is(n)=issquare(n) && (n%2==0 || issquare(n\2) || issquare(n\2+1)) \\ Charles R Greathouse IV, May 07 2015
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Juri-Stepan Gerasimov, Apr 25 2015
STATUS
approved