A014707 a(4n) = 0, a(4n+2) = 1, a(2n+1) = a(n).
0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 1, 0, 0, 1, 1, 1, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 1, 1, 1, 0, 0, 1, 0, 0, 1, 1, 1, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 1, 0, 0, 1, 1, 1, 0, 0, 1, 1, 0
Offset: 0
References
- Guy Melançon, Factorizing infinite words using Maple, MapleTech journal, Vol. 4, No. 1, 1997, pp. 34-42, esp. p. 36.
Links
- Reinhard Zumkeller, Table of n, a(n) for n = 0..10000
- Jean-Paul Allouche, Anna Lubiw, Michel France, Alfred van der Poorten, and Jeffrey Shallit, Convergents of folded continued fractions, Acta Arithmetica 77 (1996), 77-96.
- Cristina Ballantine and George Beck, Partitions enumerated by self-similar sequences, arXiv:2303.11493 [math.CO], 2023.
- Paul Barry, On the Gap-sum and Gap-product Sequences of Integer Sequences, arXiv:2104.05593 [math.CO], 2021.
- Jörg Endrullis, Dimitri Hendriks, and Jan Willem Klop, Degrees of streams, see table 1 "PF".
- Jui-Yi Kao, Narad Rampersad, Jeffrey Shallit, and Manuel Silva, Words avoiding repetitions in arithmetic progressions, Theoretical Computer Science, Vol. 391, No. 1-2 (2008), pp. 126-137; arXiv preprint, arXiv:math/0608607 [math.CO], 2006.
- Guy Melançon, Lyndon factorization of infinite words, STACS 96 (Grenoble, 1996), 147-154, Lecture Notes in Comput. Sci., 1046, Springer, Berlin, 1996. Math. Rev. 98h:68188.
- Jeffrey Shallit, Cloitre's Self-Generating Sequence, arXiv:2501.00784 [math.CO], 2025.
- László Tóth, Evaluating zeta(s) At Odd Positive Integers Using Automatic Dirichlet Series, arXiv:2508.04151 [math.NT], 2025.
- Index entries for sequences obtained by enumerating foldings.
Crossrefs
Programs
-
Haskell
a014707 n = a014707_list !! n a014707_list = f 0 $ cycle [0,0,1,0] where f i (x:_:xs) = x : a014707 i : f (i+1) xs -- Reinhard Zumkeller, Sep 28 2011
-
Maple
nmax:=92: for p from 0 to ceil(simplify(log[2](nmax))) do for n from 0 to ceil(nmax/(p+2))+1 do a((2*n+1)*2^p-1) := n mod 2 od: od: seq(a(n), n=0..nmax); # Johannes W. Meijer, Jan 28 2013 # second Maple program: a:= proc(n) option remember; `if`(n::even, irem(n/2, 2), a((n-1)/2)) end: seq(a(n), n=0..92); # Alois P. Heinz, Jun 27 2022
-
Mathematica
a[n_ /; Mod[n, 4] == 0] = 0; a[n_ /; Mod[n, 4] == 2] = 1; a[n_ /; Mod[n, 2] == 1] := a[n] = a[(n - 1)/2]; Table[a[n],{n,0,92}] (* Jean-François Alcover, May 17 2011 *) (1 - JacobiSymbol[-1, Range[100]])/2 (* Paolo Xausa, May 26 2024 *)
-
PARI
a(n)=n+=1;my(h=bitand(n,-n));n=bitand(n,h<<1);n!=0; \\ Joerg Arndt, Apr 09 2021
-
Python
def A014707(n): s = bin(n+1)[2:] m = len(s) i = s[::-1].find('1') return int(s[m-i-2]) if m-i-2 >= 0 else 0 # Chai Wah Wu, Apr 08 2021
-
Python
def A014707(n): n+=1; h=n&-n; n=n&(h<<1); return int(n!=0) print([A014707(n) for n in range(93)]) # Michael S. Branicky, Mar 29 2024 after Joerg Arndt
Formula
a(A091072(n)-1) = 0; a(A091067(n)-1) = 1. - Reinhard Zumkeller, Sep 28 2011 [Adjusted to match offset by Peter Munn, Jul 01 2022]
a(n) = (1-Jacobi(-1,n+1))/2 (cf. A034947). - N. J. A. Sloane, Jul 27 2012 [Adjusted to match offset by Peter Munn, Jul 01 2022]
Set a=0, b=1, S(0)=a, S(n+1) = S(n)aF(S(n)), where F(x) reverses x and then interchanges a and b; sequence is limit S(infinity).
a((2*n+1)*2^p-1) = n mod 2, p >= 0. - Johannes W. Meijer, Jan 28 2013
Asymptotic mean: Limit_{m->oo} (1/m) * Sum_{k=1..m} a(k) = 1/2. - Amiram Eldar, Aug 31 2024
Extensions
More terms from Scott C. Lindhurst (ScottL(AT)alumni.princeton.edu)
Comments