A080764 First differences of A049472, floor(n/sqrt(2)).
1, 1, 0, 1, 1, 0, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 0, 1, 1, 0, 1, 1, 0
Offset: 0
Examples
From _Peter Bala_, Nov 22 2013: (Start) The first few Sturmian words S(n) are S(0) = 0 S(1) = 1 S(2) = 110 S(3) = 110 110 1 S(4) = 1101101 1101101 110 S(5) = 11011011101101110 11011011101101110 1101101 The lengths of the words are [1, 1, 3, 7, 17, 41, ...] = A001333. (End)
Links
- Reinhard Zumkeller, Table of n, a(n) for n = 0..10000
- Joerg Arndt, Matters Computational (The Fxtbook), section 38.12, pp. 757-758.
- Wikipedia, Sturmian word
- Index entries for sequences that are fixed points of mappings
Crossrefs
Programs
-
Haskell
a080764 n = a080764_list !! n a080764_list = tail $ zipWith (-) (tail a049472_list) a049472_list -- Reinhard Zumkeller, Jul 03 2015
-
Maple
A080764 := proc(n) alpha := 1/sqrt(2) ; floor((n+2)*alpha)-floor((n+1)*alpha) ; end proc: # R. J. Mathar, Jul 09 2013
-
Mathematica
Nest[ Flatten[ # /. {0 -> 1, 1 -> {1, 1, 0}}] &, {1}, 7] (* Robert G. Wilson v, Apr 16 2005 *) NestList[ Flatten[ # /. {0 -> {1}, 1 -> {1, 0, 1}}] &, {1}, 5] // Flatten (* or *) t = Table[Floor[n/Sqrt[2]], {n, 111}]; Drop[t, 1] - Drop[t, -1] (* Robert G. Wilson v, Nov 03 2005 *) a[ n_] := With[{m = n + 1}, Floor[(m + 1) / Sqrt[2]] - Floor[m / Sqrt[2]]]; (* Michael Somos, Aug 19 2018 *)
-
PARI
{a(n) = n++; my(k = sqrtint(n*n\2)); n*(n+2) > 2*k*(k+2)}; /* Michael Somos, Aug 19 2018 */
-
Python
from math import isqrt def A080764(n): return (isqrt((m:=(n+2)**2)<<1)>>1)-(isqrt(m-(n<<1)-3<<1)>>1) # Chai Wah Wu, May 19 2025
Formula
a(n) = floor((n+2)*sqrt(2)/2) - floor((n+1)*sqrt(2)/2).
a(n) = A188295(n+2) for all n in Z. - Michael Somos, Aug 19 2018
Comments