A115787 Duplicate of A063438.
3, 3, 3, 3, 3, 3, 3, 4, 3, 3, 3, 3, 3, 3, 4, 3, 3, 3, 3, 3, 3, 4
Offset: 1
This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
The evolution starting at 0 is: 0 0, 1 0, 1, 1, 0 0, 1, 1, 0, 1, 0, 0, 1 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1 ....... A_2 = 0 1 1 0, so B_2 = 1 0 0 1 and A_3 = A_2 B_2 = 0 1 1 0 1 0 0 1. From _Joerg Arndt_, Mar 12 2013: (Start) The first steps of the iterated substitution are Start: 0 Rules: 0 --> 01 1 --> 10 ------------- 0: (#=1) 0 1: (#=2) 01 2: (#=4) 0110 3: (#=8) 01101001 4: (#=16) 0110100110010110 5: (#=32) 01101001100101101001011001101001 6: (#=64) 0110100110010110100101100110100110010110011010010110100110010110 (End) From _Omar E. Pol_, Oct 28 2013: (Start) Written as an irregular triangle in which row lengths is A011782, the sequence begins: 0; 1; 1,0; 1,0,0,1; 1,0,0,1,0,1,1,0; 1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1; 1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0; It appears that: row j lists the first A011782(j) terms of A010059, with j >= 0; row sums give A166444 which is also 0 together with A011782; right border gives A000035. (End)
a010060 n = a010060_list !! n a010060_list = 0 : interleave (complement a010060_list) (tail a010060_list) where complement = map (1 - ) interleave (x:xs) ys = x : interleave ys xs -- Doug McIlroy (doug(AT)cs.dartmouth.edu), Jun 29 2003 -- Edited by Reinhard Zumkeller, Oct 03 2012
s := proc(k) local i, ans; ans := [ 0,1 ]; for i from 0 to k do ans := [ op(ans),op(map(n->(n+1) mod 2, ans)) ] od; return ans; end; t1 := s(6); A010060 := n->t1[n]; # s(k) gives first 2^(k+2) terms. a := proc(k) b := [0]: for n from 1 to k do b := subs({0=[0,1], 1=[1,0]},b) od: b; end; # a(k), after the removal of the brackets, gives the first 2^k terms. # Example: a(3); gives [[[[0, 1], [1, 0]], [[1, 0], [0, 1]]]] A010060:=proc(n) add(i,i=convert(n, base, 2)) mod 2 ; end proc: seq(A010060(n),n=0..104); # Emeric Deutsch, Mar 19 2005 map(`-`,convert(StringTools[ThueMorse](1000),bytes),48); # Robert Israel, Sep 22 2014
Table[ If[ OddQ[ Count[ IntegerDigits[n, 2], 1]], 1, 0], {n, 0, 100}]; mt = 0; Do[ mt = ToString[mt] <> ToString[(10^(2^n) - 1)/9 - ToExpression[mt] ], {n, 0, 6} ]; Prepend[ RealDigits[ N[ ToExpression[mt], 2^7] ] [ [1] ], 0] Mod[ Count[ #, 1 ]& /@Table[ IntegerDigits[ i, 2 ], {i, 0, 2^7 - 1} ], 2 ] (* Harlan J. Brothers, Feb 05 2005 *) Nest[ Flatten[ # /. {0 -> {0, 1}, 1 -> {1, 0}}] &, {0}, 7] (* Robert G. Wilson v Sep 26 2006 *) a[n_] := If[n == 0, 0, If[Mod[n, 2] == 0, a[n/2], 1 - a[(n - 1)/2]]] (* Ben Branman, Oct 22 2010 *) a[n_] := Mod[Length[FixedPointList[BitAnd[#, # - 1] &, n]], 2] (* Jan Mangaldan, Jul 23 2015 *) Table[2/3 (1 - Cos[Pi/3 (n - Sum[(-1)^Binomial[n, k], {k, 1, n}])]), {n, 0, 100}] (* or, for version 10.2 or higher *) Table[ThueMorse[n], {n, 0, 100}] (* Vladimir Reshetnikov, May 06 2016 *) ThueMorse[Range[0, 100]] (* The program uses the ThueMorse function from Mathematica version 11 *) (* Harvey P. Dale, Aug 11 2016 *) Nest[Join[#, 1 - #] &, {0}, 7] (* Paolo Xausa, Oct 25 2024 *)
a(n)=if(n<1,0,sum(k=0,length(binary(n))-1,bittest(n,k))%2)
a(n)=if(n<1,0,subst(Pol(binary(n)), x,1)%2)
default(realprecision, 6100); x=0.0; m=20080; for (n=1, m-1, x=x+x; x=x+sum(k=0, length(binary(n))-1, bittest(n, k))%2); x=2*x/2^m; for (n=0, 20000, d=floor(x); x=(x-d)*2; write("b010060.txt", n, " ", d)); \\ Harry J. Smith, Apr 28 2009
a(n)=hammingweight(n)%2 \\ Charles R Greathouse IV, Mar 22 2013
A010060_list = [0] for _ in range(14): A010060_list += [1-d for d in A010060_list] # Chai Wah Wu, Mar 04 2016
def A010060(n): return n.bit_count()&1 # Chai Wah Wu, Mar 01 2023
maxrow <- 8 # by choice b01 <- 1 for(m in 0:maxrow) for(k in 0:(2^m-1)){ b01[2^(m+1)+ k] <- b01[2^m+k] b01[2^(m+1)+2^m+k] <- 1-b01[2^m+k] } (b01 <- c(0,b01)) # Yosu Yurramendi, Apr 10 2017
The word is 010010100100101001010010010100... Over the alphabet {a,b} this is a, b, a, a, b, a, b, a, a, b, a, a, b, a, b, a, a, b, a, b, a, a, b, a, a, b, a, b, a, a, b, a, a, b, a, b, a, a, b, a, b, a, a, b, a, a, b, a, b, a, a, b, a, b, a, a, b, a, a, b, a, b, a, a, b, a, a, b, a, b, a, a, b, a, b, a, a, b, a, a, b, a, b, a, a, b, a, a, b, a, b, a, a, b, a, b, a, a, b, a, a, b, a, b, a, ...
a003849 n = a003849_list !! n a003849_list = tail $ concat fws where fws = [1] : [0] : (zipWith (++) fws $ tail fws) -- Reinhard Zumkeller, Nov 01 2013, Apr 07 2012
t1:=[ n le 2 select ["0","0,1"][n] else Self(n-1) cat "," cat Self(n-2) : n in [1..12]]; t1[12];
z := proc(m) option remember; if m=0 then [0] elif m=1 then [0,1] else [op(z(m-1)),op(z(m-2))]; fi; end; z(12); M:=19; S[0]:=`0`; S[1]:=`01`; for n from 2 to M do S[n]:=cat(S[n-1], S[n-2]); od: t0:=S[M]: l:=length(t0); for i from 1 to l do lprint(i-1,substring(t0,i..i)); od: # N. J. A. Sloane, Nov 01 2006
Nest[ Flatten[ # /. {0 -> {0, 1}, 1 -> {0}}] &, {0}, 10] (* Robert G. Wilson v, Mar 05 2005 *) Flatten[Nest[{#, #[[1]]} &, {0, 1}, 9]] (* IWABUCHI Yu(u)ki, Oct 23 2013 *) Table[Floor[(n + 2) #] - Floor[(n + 1) #], {n, 0, 120}] &[2 - GoldenRatio] (* Michael De Vlieger, Aug 15 2016 *) SubstitutionSystem[{0->{0,1},1->{0}},{0},{10}][[1]] (* Harvey P. Dale, Dec 20 2021 *)
a(n)=my(k=2);while(fibonacci(k)<=n,k++);while(n>1,while(fibonacci(k--)>n,); n-=fibonacci(k)); n==1 \\ Charles R Greathouse IV, Feb 03 2014
M3849=[2,2,1,0]/*L(k),S(k),L(k-1),S(k-1)*/; A003849(n)={while(n>M3849[1],M3849=vecextract(M3849,[1,2,1,2])+[M3849[3],M3849[4]<M. F. Hasler, Apr 07 2021
def fib(n): """Return the concatenation of A003849(0..F-1) where F is the smallest Fibonacci number > n, so that the result contains a(n) at index n.""" a, b = '10' while len(b)<=n: a, b = b, b + a return b # Robert FERREOL, Apr 15 2016, edited by M. F. Hasler, Apr 07 2021
from math import isqrt def A003849(n): return 2-(n+2+isqrt(m:=5*(n+2)**2)>>1)+(n+1+isqrt(m-10*n-15)>>1) # Chai Wah Wu, Aug 25 2022
&cat[Reverse(IntegerToSequence(n,2)): n in [1..31]]; // Jason Kimberley, Mar 02 2012
A030302 := proc(n) local i,t1,t2; t1:=convert(n,base,2); t2:=nops(t1); [seq(t1[t2+1-i],i=1..t2)]; end; # N. J. A. Sloane, Apr 08 2021
i[n_] := Ceiling[FullSimplify[ProductLog[Log[2]/2 (n - 1)]/Log[2] + 1]]; a[n_] := Mod[Floor[2^(Mod[n + 2^i[n] - 2, i[n]] - i[n] + 1) Ceiling[(n + 2^i[n] - 1)/i[n] - 1]], 2]; (* David W. Cantrell (DWCantrell(AT)sigmaxi.net), Feb 19 2007 *) Join @@ Table[ IntegerDigits[i, 2], {i, 1, 40}] (* Olivier Gérard, Mar 28 2011 *) Flatten@ IntegerDigits[ Range@ 25, 2] (* or *) almostNatural[n_, b_] := Block[{m = 0, d = n, i = 1, l, p}, While[m <= d, l = m; m = (b - 1) i*b^(i - 1) + l; i++]; i--; p = Mod[d - l, i]; q = Floor[(d - l)/i] + b^(i - 1); If[p != 0, IntegerDigits[q, b][[p]], Mod[q - 1, b]]]; Array[ almostNatural[#, 2] &, 105] (* Robert G. Wilson v, Jun 29 2014 *)
from itertools import count, islice def A030302_gen(): # generator of terms return (int(d) for n in count(1) for d in bin(n)[2:]) A030302_list = list(islice(A030302_gen(),30)) # Chai Wah Wu, Feb 18 2022
import Data.List (genericIndex) a010056 = genericIndex a010056_list a010056_list = 1 : 1 : ch [2..] (drop 3 a000045_list) where ch (x:xs) fs'@(f:fs) = if x == f then 1 : ch xs fs else 0 : ch xs fs' -- Reinhard Zumkeller, Oct 10 2013
a:= n-> (t-> `if`(issqr(t+4) or issqr(t-4), 1, 0))(5*n^2): seq(a(n), n=0..144); # Alois P. Heinz, Dec 06 2020
Join[{1},With[{fibs=Fibonacci[Range[15]]},If[MemberQ[fibs,#],1,0]& /@Range[100]]] (* Harvey P. Dale, May 02 2011 *)
a(n)=my(k=n^2);k+=(k+1)<<2; issquare(k) || (n>0 && issquare(k-8)) \\ Charles R Greathouse IV, Jul 30 2012
from sympy.ntheory.primetest import is_square def A010056(n): return int(is_square(m:=5*n**2-4) or is_square(m+8)) # Chai Wah Wu, Mar 30 2023
a020985 n = a020985_list !! n a020985_list = 1 : 1 : f (tail a020985_list) (-1) where f (x:xs) w = x : x*w : f xs (0 - w) -- Reinhard Zumkeller, Jan 02 2012
A020985 := proc(n) option remember; if n = 0 then 1 elif n mod 2 = 0 then A020985(n/2) else (-1)^((n-1)/2 )*A020985( (n-1)/2 ); fi; end;
a[0] = 1; a[1] = 1; a[n_?EvenQ] := a[n] = a[n/2]; a[n_?OddQ] := a[n] = (-1)^((n-1)/2)* a[(n-1)/2]; a /@ Range[0, 80] (* Jean-François Alcover, Jul 05 2011 *) a[n_] := 1 - 2 Mod[Length[FixedPointList[BitAnd[#, # - 1] &, BitAnd[n, Quotient[n, 2]]]], 2] (* Jan Mangaldan, Jul 23 2015 *) Array[RudinShapiro, 81, 0] (* JungHwan Min, Dec 22 2016 *)
A020985(n)=(-1)^A014081(n) \\ M. F. Hasler, Jun 06 2012
def a014081(n): return sum([((n>>i)&3==3) for i in range(len(bin(n)[2:]) - 1)]) def a(n): return (-1)**a014081(n) # Indranil Ghosh, Jun 03 2017
def A020985(n): return -1 if (n&(n>>1)).bit_count()&1 else 1 # Chai Wah Wu, Feb 11 2023
a(7)=21 because 7*Pi=21.9911... and a(8)=25 because 8*Pi=25.1327.... a(100000)=314159 because Pi=3.141592...
R:=RieldField(10); [Floor(n*Pi(R)): n in [0..80]]; // G. C. Greubel, Sep 28 2018
a:=n->floor(n*Pi): seq(a(n),n=0..70); # Muniru A Asiru, Sep 28 2018
Floor[Pi Range[0,200]] (* Harvey P. Dale, Aug 27 2024 *)
vector(80, n, n--; floor(n*Pi)) \\ G. C. Greubel, Sep 28 2018
a020987 = (`div` 2) . (1 -) . a020985 -- Reinhard Zumkeller, Jun 06 2012
a[n_] := (1/2)*(1-(-1)^Count[Partition[IntegerDigits[n, 2], 2, 1], {1, 1}]); Table[a[n], {n, 0, 80}] (* Jean-François Alcover, Dec 12 2014, after Robert G. Wilson v *) (1 - RudinShapiro[Range[0, 100]])/2 (* Paolo Xausa, Jan 29 2025 *)
def A020987(n): return (n&(n>>1)).bit_count()&1 # Chai Wah Wu, Feb 11 2023
A043529 := proc(n): if type(ln(n+1)/ln(2), integer) then 1 else 2 fi: end proc: seq(A043529(n), n=0..90); # Johannes W. Meijer, Sep 14 2012
(* Needs version >= 10.2. *) SubstitutionSystem[{0 -> {0, 1}, 1 -> {1, 2}, 2 -> {2, 2}}, 0, 7] // Last // Rest (* Jean-François Alcover, Apr 06 2020 *) Table[Length[Union[IntegerDigits[n,2]]],{n,0,90}] (* Harvey P. Dale, Aug 04 2024 *)
a049320 n = a049320_list !! n a049320_list = 0 : 0 : 1 : 0 : f [0,0,1,0] where f xs = drop (length xs) ys ++ f ys where ys = concatMap ch xs ch 0 = [0,0,1,0]; ch 1 = [1] -- Reinhard Zumkeller, Aug 14 2013
Nest[# /. 0 -> {0, 0, 1, 0}&, {0}, 4] // Flatten (* Jean-François Alcover, Oct 08 2016 *)
Comments