login
Fixed under 0 -> 10, 1 -> 100.
22

%I #74 Aug 26 2022 10:26:26

%S 1,0,0,1,0,1,0,1,0,0,1,0,1,0,0,1,0,1,0,0,1,0,1,0,1,0,0,1,0,1,0,0,1,0,

%T 1,0,1,0,0,1,0,1,0,0,1,0,1,0,1,0,0,1,0,1,0,0,1,0,1,0,0,1,0,1,0,1,0,0,

%U 1,0,1,0,0,1,0,1,0,1,0,0,1,0,1,0,0,1,0,1,0,0,1,0,1

%N Fixed under 0 -> 10, 1 -> 100.

%C Partial sums: A088462. - _Reinhard Zumkeller_, Dec 05 2009

%C Write w(n) = a(n) for n >= 1. Each w(n) is generated by w(i) for exactly one i <= n; let g(n) = i. Each w(i) generates a single 1, in a word (10 or 100) that starts with 1. Therefore, g(n) is the number of 1s among w(1), ..., w(n), so that g = A088462. That is, this sequence is generated by its partial sums. - _Clark Kimberling_, May 25 2011

%H T. D. Noe, <a href="/A004641/b004641.txt">Table of n, a(n) for n = 1..8119</a>

%H Wieb Bosma, Michel Dekking, and Wolfgang Steiner, <a href="https://arxiv.org/abs/1710.01498">A remarkable sequence related to Pi and sqrt(2)</a>, arXiv:1710.01498 [math.NT], 2017.

%H Wieb Bosma, Michel Dekking, and Wolfgang Steiner, <a href="http://math.colgate.edu/~integers/sjs4/sjs4.Abstract.html">A remarkable sequence related to Pi and sqrt(2)</a>, Integers, Electronic Journal of Combinatorial Number Theory 18A (2018), #A4.

%H N. G. de Bruijn, <a href="http://dx.doi.org/10.1016/1385-7258(81)90015-9">Sequences of zeros and ones generated by special production rules</a>, Nederl. Akad. Wetensch. Indag. Math. 43 (1981), no. 1, 27-37. Reprinted in Physics of Quasicrystals, ed. P. J. Steinhardt et al., p. 664.

%H C. J. Glasby, S. P. Glasby, and F. Pleijel, <a href="http://dx.doi.org/10.1098/rspb.2008.0418">Worms by number</a>, Proc. Roy. Soc. B, Proc. Biol. Sci. 275 (1647) (2008) 2071-2076.

%H N. J. A. Sloane, <a href="/A115004/a115004.txt">Families of Essentially Identical Sequences</a>, Mar 24 2021 (Includes this sequence).

%H <a href="/index/Ch#char_fns">Index entries for characteristic functions</a>

%F a(n) = floor(n*(sqrt(2) - 1) + sqrt(1/2)) - floor((n - 1)*(sqrt(2) - 1) + sqrt(1/2)) (from the de Bruijn reference). - _Peter J. Taylor_, Mar 26 2015

%F From _Jianing Song_, Jan 02 2019: (Start)

%F a(n) = A001030(n) - 1.

%F a(n) = A006337(n-9) - 1 = A159684(n-10) for n >= 10. (End)

%p P(0):= (1,0): P(1):= (1,0,0):

%p ((P~)@@6)([1]);

%p # in Maple 12 or earlier, comment the above line and uncomment the following:

%p # (curry(map,P)@@6)([1]); # _Robert Israel_, Mar 26 2015

%t Nest[ Flatten[# /. {0 -> {1, 0}, 1 -> {1, 0, 0}}] &, {1}, 5] (* _Robert G. Wilson v_, May 25 2011 *)

%t SubstitutionSystem[{0->{1,0},1->{1,0,0}},{1},5]//Flatten (* _Harvey P. Dale_, Nov 20 2021 *)

%o (Magma) [Floor(n*(Sqrt(2) - 1) + Sqrt(1/2)) - Floor((n - 1)*(Sqrt(2) - 1) + Sqrt(1/2)): n in [0..100]]; // _Vincenzo Librandi_, Mar 27 2015

%o (Python)

%o from math import isqrt

%o def A004641(n): return [1, 0, 0, 1, 0, 1, 0, 1][n-1] if n < 9 else -1-isqrt(m:=(n-9)*(n-9)<<1)+isqrt(m+(n-9<<2)+2) # _Chai Wah Wu_, Aug 25 2022

%Y Equals A001030 - 1. Essentially the same as A006337 - 1 and A159684.

%Y Characteristic function of A086377.

%Y Cf. A081477.

%Y The following sequences are all essentially the same, in the sense that they are simple transformations of each other, with A000201 as the parent: A000201, A001030, A001468, A001950, A003622, A003842, A003849, A004641, A005614, A014675, A022342, A088462, A096270, A114986, A124841. - _N. J. A. Sloane_, Mar 11 2021

%K nonn,nice,easy

%O 1,1

%A _N. J. A. Sloane_