login
A145829
Square root of squares in A145768 (XOR of squares of the numbers 1..n).
5
1, 4, 1, 15, 0, 16, 20, 31, 16, 49, 65, 224, 96, 96, 337, 144, 720, 400, 945, 625, 928, 828, 367, 928, 1889, 624, 2609, 3568, 3568, 2064, 10273, 1040, 545, 12384, 12639, 56800, 25812, 15119, 36, 864, 144383, 146463, 195440, 61391, 61072, 61072, 58128, 25872
OFFSET
1,2
LINKS
Reinhard Zumkeller, Table of n, a(n) for n = 1..63
MATHEMATICA
an = 0; Reap[ For[i = 1, i <= 10^6, i++, an = BitXor[an, i^2]; If[IntegerQ[r = Sqrt[an]], Print[r]; Sow[r]]]][[2, 1]] (* Jean-François Alcover, Oct 11 2013, translated from Pari *)
PROG
(PARI) an=0; for( i=1, 10^4, an=bitxor(an, i^2); issquare(an, &an) && print1(an", "))
(Haskell)
a145829 n = a145829_list !! (n-1)
a145829_list = map a000196 $ filter ((== 1) . a010052) $ tail a145768_list
-- Reinhard Zumkeller, Nov 09 2012
(Python)
from itertools import count, islice
from sympy import integer_nthroot
def A145829gen(): # generator of terms
m = 0
for n in count(1):
m ^= n**2
a, b = integer_nthroot(m, 2)
if b: yield a
A145829_list = list(islice(A145829gen(), 20)) # Chai Wah Wu, Dec 16 2021
CROSSREFS
a(n) = A000196( A145828(n)) = A000196( A145768( A145827(n))); A145828 = { a(n)^2 } = A145768 intersect A000290.
Sequence in context: A187055 A257501 A096644 * A016115 A164794 A353763
KEYWORD
easy,nice,nonn
AUTHOR
M. F. Hasler, Oct 20 2008
STATUS
approved