login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A181359 a(1)=1. After that, a(n) = a(n-1) XOR a(floor(sqrt(n))). 1
1, 0, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,1

LINKS

Antti Karttunen, Table of n, a(n) for n = 1..65537

Index entries for characteristic functions

FORMULA

a(1) = 1; for n > 1, a(n) = A000035(a(n-1) + a(A000196(n))). - Antti Karttunen, Dec 16 2017, after Magma program of Klaus Brockhaus

MATHEMATICA

f[1] := True

f[x_] := Xor[f[x - 1], f[Floor[Sqrt[x]]]]

PROG

(MAGMA) [ n eq 1 select 1 else (Self(n-1)+Self(Isqrt(n))) mod 2: n in [1..105] ]; // Klaus Brockhaus, Oct 16 2010

(PARI) first(n) = my(res = vector(n)); res[1]=1; for(x=2, n, res[x]=bitxor(res[x-1], res[floor(sqrt(x))])); res \\ Iain Fox, Dec 16 2017

(Scheme, with memoization-macro definec) (definec (A181359 n) (if (= 1 n) n (A000035 (+ (A181359 (- n 1)) (A181359 (A000196 n)))))) ;; Antti Karttunen, Dec 16 2017

CROSSREFS

Cf. A000196 (integer part of square root of n). - Klaus Brockhaus, Oct 16 2010

Sequence in context: A254377 A285657 A162519 * A072418 A128973 A176412

Adjacent sequences:  A181356 A181357 A181358 * A181360 A181361 A181362

KEYWORD

nonn

AUTHOR

Ben Branman, Oct 14 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 April 8 21:44 EDT 2020. Contains 333329 sequences. (Running on oeis4.)