login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A145828 Squares in A145768 (XOR of squares of the numbers 1...n). 4
0, 1, 16, 1, 225, 0, 256, 400, 961, 256, 2401, 4225, 50176, 9216, 9216, 113569, 20736, 518400, 160000, 893025, 390625, 861184, 685584, 134689, 861184, 3568321, 389376, 6806881, 12730624, 12730624, 4260096, 105534529 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,3
LINKS
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
Equals A145768 intersect A000290; a(n) = A145768(A145827(n)) = A145829(n)^2.
Sequence in context: A099923 A351244 A105671 * A369913 A371081 A223518
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

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

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 24 22:17 EDT 2024. Contains 371964 sequences. (Running on oeis4.)