OFFSET
1,3
LINKS
Chai Wah Wu, Table of n, a(n) for n = 1..97
MATHEMATICA
Reap[For[Sow[x=0]; k=1, k <= 10^4, k++, x = BitXor[x, k^2]; If[IntegerQ[ Sqrt[x]], Sow[x]]]][[2, 1]] (* Jean-François Alcover, Nov 25 2015 *)
PROG
(PARI) an=0; for( i=1, 10^4, an=bitxor(an, i^2); issquare(an) && print1(an", "))
(Python)
from gmpy2 import is_square
filter(is_square, [reduce(lambda x, y:x^y, [x**2 for x in range(n)]) for n in range(1, 10**4)]) # Chai Wah Wu, Aug 05 2014
(PARI) {a(n) = my(x, m, k); while( m<n, x = bitxor(x, k++^2); issquare(x) && m++); x}; /* Michael Somos, Aug 05 2014 */
CROSSREFS
KEYWORD
easy,nice,nonn
AUTHOR
M. F. Hasler, Oct 20 2008
EXTENSIONS
Edited to start at 0 to match A145768 by Chai Wah Wu, Aug 05 2014
STATUS
approved