cp's OEIS Frontend

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.

Showing 1-10 of 27 results. Next

A262392 a(n) = A007504(n) + A010693(n).

Original entry on oeis.org

2, 5, 7, 13, 19, 31, 43, 61, 79, 103, 131, 163, 199, 241, 283, 331, 383, 443, 503, 571, 641, 715, 793, 877, 965, 1063, 1163, 1267, 1373, 1483, 1595, 1723, 1853, 1991, 2129, 2279, 2429, 2587, 2749, 2917, 3089, 3269, 3449, 3641, 3833, 4031, 4229
Offset: 0

Views

Author

Altug Alkan, Sep 21 2015

Keywords

Comments

Sequence is interesting because of the fact that a(n) is a prime number for n = 0..20.
Main inspiration of sequence was indices of prime numbers in A036439 and A227547.

Examples

			a(0) = A007504(0) + A010693(0) = 0 + 2 = 2.
a(1) = A007504(1) + A010693(1) = 2 + 3 = 5.
a(2) = A007504(2) + A010693(2) = 5 + 2 = 7.
a(3) = A007504(3) + A010693(3) = 10 + 3 = 13.
a(4) = A007504(4) + A010693(4) = 17 + 2 = 19.
a(5) = A007504(5) + A010693(5) = 28 + 3 = 31.
		

Crossrefs

Programs

  • Mathematica
    s = Accumulate@ Prime@ Range@ 1200; {2}~Join~Table[s[[n]] + If[OddQ@ n, 3, 2], {n, 46}] (* Michael De Vlieger, Sep 21 2015 *)
  • PARI
    a(n) = sum(k=1, n, prime(k)) + (n%2) + 2;
    vector(50, n, a(n-1))

Formula

a(n) = Sum_{k=1..n} prime(k) + n mod 2 + 2 for n>0, a(0)=2 (from Pari code).

A010060 Thue-Morse sequence: let A_k denote the first 2^k terms; then A_0 = 0 and for k >= 0, A_{k+1} = A_k B_k, where B_k is obtained from A_k by interchanging 0's and 1's.

Original entry on oeis.org

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, 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, 0, 1, 1, 0, 1, 0, 0, 1, 1
Offset: 0

Views

Author

Keywords

Comments

Named after Axel Thue, whose name is pronounced as if it were spelled "Tü" where the ü sound is roughly as in the German word üben. (It is incorrect to say "Too-ee" or "Too-eh".) - N. J. A. Sloane, Jun 12 2018
Also called the Thue-Morse infinite word, or the Morse-Hedlund sequence, or the parity sequence.
Fixed point of the morphism 0 --> 01, 1 --> 10, see example. - Joerg Arndt, Mar 12 2013
The sequence is cubefree (does not contain three consecutive identical blocks) [see Offner for a direct proof] and is overlap-free (does not contain XYXYX where X is 0 or 1 and Y is any string of 0's and 1's).
a(n) = "parity sequence" = parity of number of 1's in binary representation of n.
To construct the sequence: alternate blocks of 0's and 1's of successive lengths A003159(k) - A003159(k-1), k = 1, 2, 3, ... (A003159(0) = 0). Example: since the first seven differences of A003159 are 1, 2, 1, 1, 2, 2, 2, the sequence starts with 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0. - Emeric Deutsch, Jan 10 2003
Characteristic function of A000069 (odious numbers). - Ralf Stephan, Jun 20 2003
a(n) = S2(n) mod 2, where S2(n) = sum of digits of n, n in base-2 notation. There is a class of generalized Thue-Morse sequences: Let Sk(n) = sum of digits of n; n in base-k notation. Let F(t) be some arithmetic function. Then a(n)= F(Sk(n)) mod m is a generalized Thue-Morse sequence. The classical Thue-Morse sequence is the case k=2, m=2, F(t)= 1*t. - Ctibor O. Zizka, Feb 12 2008 (with correction from Daniel Hug, May 19 2017)
More generally, the partial sums of the generalized Thue-Morse sequences a(n) = F(Sk(n)) mod m are fractal, where Sk(n) is sum of digits of n, n in base k; F(t) is an arithmetic function; m integer. - Ctibor O. Zizka, Feb 25 2008
Starting with offset 1, = running sums mod 2 of the kneading sequence (A035263, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, ...); also parity of A005187: (1, 3, 4, 7, 8, 10, 11, 15, 16, 18, 19, ...). - Gary W. Adamson, Jun 15 2008
Generalized Thue-Morse sequences mod n (n>1) = the array shown in A141803. As n -> infinity the sequences -> (1, 2, 3, ...). - Gary W. Adamson, Jul 10 2008
The Thue-Morse sequence for N = 3 = A053838, (sum of digits of n in base 3, mod 3): (0, 1, 2, 1, 2, 0, 2, 0, 1, 1, 2, ...) = A004128 mod 3. - Gary W. Adamson, Aug 24 2008
For all positive integers k, the subsequence a(0) to a(2^k-1) is identical to the subsequence a(2^k+2^(k-1)) to a(2^(k+1)+2^(k-1)-1). That is to say, the first half of A_k is identical to the second half of B_k, and the second half of A_k is identical to the first quarter of B_{k+1}, which consists of the k/2 terms immediately following B_k.
Proof: The subsequence a(2^k+2^(k-1)) to a(2^(k+1)-1), the second half of B_k, is by definition formed from the subsequence a(2^(k-1)) to a(2^k-1), the second half of A_k, by interchanging its 0's and 1's. In turn, the subsequence a(2^(k-1)) to a(2^k-1), the second half of A_k, which is by definition also B_{k-1}, is by definition formed from the subsequence a(0) to a(2^(k-1)-1), the first half of A_k, which is by definition also A_{k-1}, by interchanging its 0's and 1's. Interchanging the 0's and 1's of a subsequence twice leaves it unchanged, so the subsequence a(2^k+2^(k-1)) to a(2^(k+1)-1), the second half of B_k, must be identical to the subsequence a(0) to a(2^(k-1)-1), the first half of A_k.
Also, the subsequence a(2^(k+1)) to a(2^(k+1)+2^(k-1)-1), the first quarter of B_{k+1}, is by definition formed from the subsequence a(0) to a(2^(k-1)-1), the first quarter of A_{k+1}, by interchanging its 0's and 1's. As noted above, the subsequence a(2^(k-1)) to a(2^k-1), the second half of A_k, which is by definition also B_{k-1}, is by definition formed from the subsequence a(0) to a(2^(k-1)-1), which is by definition A_{k-1}, by interchanging its 0's and 1's, as well. If two subsequences are formed from the same subsequence by interchanging its 0's and 1's then they must be identical, so the subsequence a(2^(k+1)) to a(2^(k+1)+2^(k-1)-1), the first quarter of B_{k+1}, must be identical to the subsequence a(2^(k-1)) to a(2^k-1), the second half of A_k.
Therefore the subsequence a(0), ..., a(2^(k-1)-1), a(2^(k-1)), ..., a(2^k-1) is identical to the subsequence a(2^k+2^(k-1)), ..., a(2^(k+1)-1), a(2^(k+1)), ..., a(2^(k+1)+2^(k-1)-1), QED.
According to the German chess rules of 1929 a game of chess was drawn if the same sequence of moves was repeated three times consecutively. Euwe, see the references, proved that this rule could lead to infinite games. For his proof he reinvented the Thue-Morse sequence. - Johannes W. Meijer, Feb 04 2010
"Thue-Morse 0->01 & 1->10, at each stage append the previous with its complement. Start with 0, 1, 2, 3 and write them in binary. Next calculate the sum of the digits (mod 2) - that is divide the sum by 2 and use the remainder." Pickover, The Math Book.
Let s_2(n) be the sum of the base-2 digits of n and epsilon(n) = (-1)^s_2(n), the Thue-Morse sequence, then prod(n >= 0, ((2*n+1)/(2*n+2))^epsilon(n) ) = 1/sqrt(2). - Jonathan Vos Post, Jun 06 2012
Dekking shows that the constant obtained by interpreting this sequence as a binary expansion is transcendental; see also "The Ubiquitous Prouhet-Thue-Morse Sequence". - Charles R Greathouse IV, Jul 23 2013
Drmota, Mauduit, and Rivat proved that the subsequence a(n^2) is normal--see A228039. - Jonathan Sondow, Sep 03 2013
Although the probability of a 0 or 1 is equal, guesses predicated on the latest bit seen produce a correct match 2 out of 3 times. - Bill McEachen, Mar 13 2015
From a(0) to a(2n+1), there are n+1 terms equal to 0 and n+1 terms equal to 1 (see Hassan Tarfaoui link, Concours Général 1990). - Bernard Schott, Jan 21 2022

Examples

			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)
		

References

  • J.-P. Allouche and J. Shallit, Automatic Sequences, Cambridge Univ. Press, 2003, p. 15.
  • Jason Bell, Michael Coons, and Eric Rowland, "The Rational-Transcendental Dichotomy of Mahler Functions", Journal of Integer Sequences, Vol. 16 (2013), #13.2.10.
  • J. Berstel and J. Karhumaki, Combinatorics on words - a tutorial, Bull. EATCS, #79 (2003), pp. 178-228.
  • B. Bollobas, The Art of Mathematics: Coffee Time in Memphis, Cambridge, 2006, p. 224.
  • S. Brlek, Enumeration of factors in the Thue-Morse word, Discrete Applied Math., 24 (1989), 83-96. doi:10.1016/0166-218X(92)90274-E.
  • Yann Bugeaud and Guo-Niu Han, A combinatorial proof of the non-vanishing of Hankel determinants of the Thue-Morse sequence, Electronic Journal of Combinatorics 21(3) (2014), #P3.26.
  • Y. Bugeaud and M. Queffélec, On Rational Approximation of the Binary Thue-Morse-Mahler Number, Journal of Integer Sequences, 16 (2013), #13.2.3.
  • Currie, James D. "Non-repetitive words: Ages and essences." Combinatorica 16.1 (1996): 19-40
  • Colin Defant, Anti-Power Prefixes of the Thue-Morse Word, Journal of Combinatorics, 24(1) (2017), #P1.32
  • F. M. Dekking, Transcendance du nombre de Thue-Morse, Comptes Rendus de l'Academie des Sciences de Paris 285 (1977), pp. 157-160.
  • F. M. Dekking, On repetitions of blocks in binary sequences. J. Combinatorial Theory Ser. A 20 (1976), no. 3, pp. 292-299. MR0429728(55 #2739)
  • Dekking, Michel, Michel Mendès France, and Alf van der Poorten. "Folds." The Mathematical Intelligencer, 4.3 (1982): 130-138 & front cover, and 4:4 (1982): 173-181 (printed in two parts).
  • Dubickas, Artūras. On a sequence related to that of Thue-Morse and its applications. Discrete Math. 307 (2007), no. 9-10, 1082--1093. MR2292537 (2008b:11086).
  • Fabien Durand, Julien Leroy, and Gwenaël Richomme, "Do the Properties of an S-adic Representation Determine Factor Complexity?", Journal of Integer Sequences, Vol. 16 (2013), #13.2.6.
  • M. Euwe, Mengentheoretische Betrachtungen Über das Schachspiel, Proceedings Koninklijke Nederlandse Akademie van Wetenschappen, Amsterdam, Vol. 32 (5): 633-642, 1929.
  • S. Ferenczi, Complexity of sequences and dynamical systems, Discrete Math., 206 (1999), 145-154.
  • S. R. Finch, Mathematical Constants, Cambridge, 2003, Section 6.8.
  • W. H. Gottschalk and G. A. Hedlund, Topological Dynamics. American Mathematical Society, Colloquium Publications, Vol. 36, Providence, RI, 1955, p. 105.
  • J. Grytczuk, Thue type problems for graphs, points and numbers, Discrete Math., 308 (2008), 4419-4429.
  • A. Hof, O. Knill and B. Simon, Singular continuous spectrum for palindromic Schroedinger operators, Commun. Math. Phys. 174 (1995), 149-159.
  • Mari Huova and Juhani Karhumäki, "On Unavoidability of k-abelian Squares in Pure Morphic Words", Journal of Integer Sequences, Vol. 16 (2013), #13.2.9.
  • B. Kitchens, Review of "Computational Ergodic Theory" by G. H. Choe, Bull. Amer. Math. Soc., 44 (2007), 147-155.
  • Le Breton, Xavier, Linear independence of automatic formal power series. Discrete Math. 306 (2006), no. 15, 1776-1780.
  • M. Lothaire, Combinatorics on Words. Addison-Wesley, Reading, MA, 1983, p. 23.
  • Donald MacMurray, A mathematician gives an hour to chess, Chess Review 6 (No. 10, 1938), 238. [Discusses Marston's 1938 article]
  • Mauduit, Christian. Multiplicative properties of the Thue-Morse sequence. Period. Math. Hungar. 43 (2001), no. 1-2, 137--153. MR1830572 (2002i:11081)
  • C. A. Pickover, Wonders of Numbers, Adventures in Mathematics, Mind and Meaning, Chapter 17, 'The Pipes of Papua,' Oxford University Press, Oxford, England, 2000, pages 34-38.
  • C. A. Pickover, A Passion for Mathematics, Wiley, 2005; see p. 60.
  • Clifford A. Pickover, The Math Book, From Pythagoras to the 57th Dimension, 250 Milestones in the History of Mathematics, Sterling Publ., NY, 2009, page 316.
  • Narad Rampersad and Elise Vaslet, "On Highly Repetitive and Power Free Words", Journal of Integer Sequences, Vol. 16 (2013), #13.2.7.
  • G. Richomme, K. Saari, L. Q. Zamboni, Abelian complexity in minimal subshifts, J. London Math. Soc. 83(1) (2011) 79-95.
  • Michel Rigo, Formal Languages, Automata and Numeration Systems, 2 vols., Wiley, 2014. Mentions this sequence - see "List of Sequences" in Vol. 2.
  • M. Rigo, P. Salimov, and E. Vandomme, "Some Properties of Abelian Return Words", Journal of Integer Sequences, Vol. 16 (2013), #13.2.5.
  • Benoit Rittaud, Elise Janvresse, Emmanuel Lesigne and Jean-Christophe Novelli, Quand les maths se font discrètes, Le Pommier, 2008 (ISBN 978-2-7465-0370-0).
  • A. Salomaa, Jewels of Formal Language Theory. Computer Science Press, Rockville, MD, 1981, p. 6.
  • Shallit, J. O. "On Infinite Products Associated with Sums of Digits." J. Number Th. 21, 128-134, 1985.
  • Ian Stewart, "Feedback", Mathematical Recreations Column, Scientific American, 274 (No. 3, 1996), page 109 [Historical notes on this sequence]
  • Thomas Stoll, On digital blocks of polynomial values and extractions in the Rudin-Shapiro sequence, RAIRO - Theoretical Informatics and Applications (RAIRO: ITA), EDP Sciences, 2016, 50, pp. 93-99. .
  • A. Thue. Über unendliche Zeichenreihen, Norske Vid. Selsk. Skr. I. Mat. Nat. Kl. Christiania, No. 7 (1906), 1-22.
  • A. Thue, Über die gegenseitige Lage gleicher Teile gewisser Zeichenreihen, Norske Vid. Selsk. Skr. I. Mat. Nat. Kl. Christiania, 1 (1912), 1-67.
  • S. Wolfram, A New Kind of Science, Wolfram Media, 2002; p. 890.

Crossrefs

Cf. A001285 (for 1, 2 version), A010059 (for 1, 0 version), A106400 (for +1, -1 version), A048707. A010060(n)=A000120(n) mod 2.
Cf. A007413, A080813, A080814, A036581, A108694. See also the Thue (or Roth) constant A014578, also A014571.
Run lengths give A026465. Backward first differences give A029883.
Cf. A004128, A053838, A059448, A171900, A161916, A214212, A005942 (subword complexity), A010693 (Abelian complexity), A225186 (squares), A228039 (a(n^2)), A282317.
Sequences mentioned in the Allouche et al. "Taxonomy" paper, listed by example number: 1: A003849, 2: A010060, 3: A010056, 4: A020985 and A020987, 5: A191818, 6: A316340 and A273129, 18: A316341, 19: A030302, 20: A063438, 21: A316342, 22: A316343, 23: A003849 minus its first term, 24: A316344, 25: A316345 and A316824, 26: A020985 and A020987, 27: A316825, 28: A159689, 29: A049320, 30: A003849, 31: A316826, 32: A316827, 33: A316828, 34: A316344, 35: A043529, 36: A316829, 37: A010060.

Programs

  • Haskell
    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
    
  • Maple
    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
  • Mathematica
    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 *)
  • PARI
    a(n)=if(n<1,0,sum(k=0,length(binary(n))-1,bittest(n,k))%2)
    
  • PARI
    a(n)=if(n<1,0,subst(Pol(binary(n)), x,1)%2)
    
  • PARI
    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
    
  • PARI
    a(n)=hammingweight(n)%2 \\ Charles R Greathouse IV, Mar 22 2013
    
  • Python
    A010060_list = [0]
    for _ in range(14):
        A010060_list += [1-d for d in A010060_list] # Chai Wah Wu, Mar 04 2016
    
  • Python
    def A010060(n): return n.bit_count()&1 # Chai Wah Wu, Mar 01 2023
    
  • R
    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

Formula

a(2n) = a(n), a(2n+1) = 1 - a(n), a(0) = 0. Also, a(k+2^m) = 1 - a(k) if 0 <= k < 2^m.
If n = Sum b_i*2^i is the binary expansion of n then a(n) = Sum b_i (mod 2).
Let S(0) = 0 and for k >= 1, construct S(k) from S(k-1) by mapping 0 -> 01 and 1 -> 10; sequence is S(infinity).
G.f.: (1/(1 - x) - Product_{k >= 0} (1 - x^(2^k)))/2. - Benoit Cloitre, Apr 23 2003
a(0) = 0, a(n) = (n + a(floor(n/2))) mod 2; also a(0) = 0, a(n) = (n - a(floor(n/2))) mod 2. - Benoit Cloitre, Dec 10 2003
a(n) = -1 + (Sum_{k=0..n} binomial(n,k) mod 2) mod 3 = -1 + A001316(n) mod 3. - Benoit Cloitre, May 09 2004
Let b(1) = 1 and b(n) = b(ceiling(n/2)) - b(floor(n/2)) then a(n-1) = (1/2)*(1 - b(2n-1)). - Benoit Cloitre, Apr 26 2005
a(n) = 1 - A010059(n) = A001285(n) - 1. - Ralf Stephan, Jun 20 2003
a(n) = A001969(n) - 2n. - Franklin T. Adams-Watters, Aug 28 2006
a(n) = A115384(n) - A115384(n-1) for n > 0. - Reinhard Zumkeller, Aug 26 2007
For n >= 0, a(A004760(n+1)) = 1 - a(n). - Vladimir Shevelev, Apr 25 2009
a(A160217(n)) = 1 - a(n). - Vladimir Shevelev, May 05 2009
a(n) == A000069(n) (mod 2). - Robert G. Wilson v, Jan 18 2012
a(n) = A000035(A000120(n)). - Omar E. Pol, Oct 26 2013
a(n) = A000035(A193231(n)). - Antti Karttunen, Dec 27 2013
a(n) + A181155(n-1) = 2n for n >= 1. - Clark Kimberling, Oct 06 2014
G.f. A(x) satisfies: A(x) = x / (1 - x^2) + (1 - x) * A(x^2). - Ilya Gutkovskiy, Jul 29 2021
From Bernard Schott, Jan 21 2022: (Start)
a(n) = a(n*2^k) for k >= 0.
a((2^m-1)^2) = (1-(-1)^m)/2 (see Hassan Tarfaoui link, Concours Général 1990). (End)

A000034 Period 2: repeat [1, 2]; a(n) = 1 + (n mod 2).

Original entry on oeis.org

1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2
Offset: 0

Views

Author

Keywords

Comments

Also continued fraction for (sqrt(3)+1)/2 (cf. A040001) and base-3 digital root of n+1 (cf. A007089, A010888). - Henry Bottomley, Jul 05 2001
The sequence 1,-2,-1,2,1,-2,-1,2,... with g.f. (1-2x)/(1+x^2) has a(n) = cos(Pi*n/2)-2*sin(Pi*n/2). - Paul Barry, Oct 18 2004
Hankel transform is [1,-3,0,0,0,0,0,0,0,...]. - Philippe Deléham, Mar 29 2007
4/33 = 0.121212... - Eric Desbiaux, Nov 03 2008
Let A be the Hessenberg matrix of order n, defined by: A[1,j]=A[i,i]:=1, A[i,i-1]=-1, and A[i,j]=0 otherwise. Then, for n>=1, a(n-1) = charpoly(A,2). - Milan Janjic, Jan 24 2010
First differences of A032766. - Tom Edgar, Jul 17 2014
Denominator of the harmonic mean of the first n triangular numbers. - Colin Barker, Nov 13 2014
This is the lexicographically earliest sequence of positive integers such that no polynomial of degree d can be fitted to d+2 consecutive terms (equivalently, such that no iterated difference is zero). - Pontus von Brömssen, Dec 26 2021 [See A300002 for the case where not only consecutive terms are considered. - Pontus von Brömssen, Jan 03 2023]
Number of maximum antichains in the power set of {1,2,...,n} partially ordered by set inclusion. For even n, there is a unique maximum antichain formed by all subsets of size n/2; for odd n, there are two maximum antichains, one formed by all subsets of size (n-1)/2 and the other formed by all subsets of size (n+1)/2. See the David Guichard link below for a proof. - Jianing Song, Jun 19 2022

References

  • Jozsef Beck, Combinatorial Games, Cambridge University Press, 2008.
  • J.-M. De Koninck and A. Mercier, 1001 Problèmes en Théorie Classique des Nombres, Problème 545 pages 73 and 260, Ellipses, Paris 2004.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Cf. sequences listed in Comments section of A283393.

Programs

Formula

G.f.: (1+2*x)/(1-x^2).
a(n) = 2^((1-(-1)^n)/2) = 2^(ceiling(n/2) - floor(n/2)). - Paul Barry, Jun 03 2003
a(n) = (3-(-1)^n)/2; a(n) = 1 + (n mod 2) = 3-a(n-1) = a(n-2) = a(-n).
a(n) = gcd(n-1, n+1). - Paul Barry, Sep 16 2004
Binomial transform of A123344, inverse binomial transform of A003945. - Philippe Deléham, Jun 04 2007
a(n) = A134451(n+1). - Reinhard Zumkeller, Oct 27 2007
a(n) = if(n=0,1,if(mod(a(n-1),2)=0,a(n-1)/2,(3*a(n-1)+1)/2)). See Collatz conjecture. - Paul Barry, Mar 31 2008
a(n) = 2^n (mod 3). - Vincenzo Librandi, Feb 05 2011
a(n) = A000035(n) + 1. - M. F. Hasler, Jan 13 2012
a(n) = abs(sin(n*Pi/2) - 2*cos(n*Pi/2)). - Mohammad K. Azarian, Mar 12 2012
a(n) = A010704(n) / 3. - Reinhard Zumkeller, Jul 03 2012
a(n) = floor((4/33)*10^(n+1)) mod 10. - Hieronymus Fischer, Jan 03 2013
a(n) = floor((5/8)*3^(n+1)) mod 3. - Hieronymus Fischer, Jan 03 2013
a(n) = floor((n+1)*3/2) - floor((n)*3/2). - Hailey R. Olafson, Jul 23 2014
a(n) = denominator(n/2). - Wesley Ivan Hurt, Sep 11 2014
Dirichlet g.f.: zeta(s)*(1 + 1/2^s). - Mats Granvik, Jul 18 2016
E.g.f.: 2*sinh(x) + cosh(x). - Ilya Gutkovskiy, Jul 18 2016
a(n) = A010693(n) - 1. - Filip Zaludek, Oct 29 2016
a(n) = n + 1 - 2*floor(n/2). - Lorenzo Sauras Altuzarra, Jun 28 2019
Limit_{n->oo} (1/n)*Sum_{k=1..n} a(k) = 3/2 (De Koninck reference). - Bernard Schott, Nov 09 2021

Extensions

Better definition from M. F. Hasler, Jan 13 2012

A047215 Numbers that are congruent to {0, 2} mod 5.

Original entry on oeis.org

0, 2, 5, 7, 10, 12, 15, 17, 20, 22, 25, 27, 30, 32, 35, 37, 40, 42, 45, 47, 50, 52, 55, 57, 60, 62, 65, 67, 70, 72, 75, 77, 80, 82, 85, 87, 90, 92, 95, 97, 100, 102, 105, 107, 110, 112, 115, 117, 120, 122, 125, 127, 130, 132, 135, 137, 140, 142, 145, 147, 150, 152, 155, 157
Offset: 0

Views

Author

Keywords

Comments

Number of partitions of 5n into exactly 2 parts. - Colin Barker, Mar 23 2015
Numbers k such that k^2/5 + k*(k + 1)/5 = k*(2*k + 1)/5 is a nonnegative integer. - Bruno Berselli, Feb 14 2017

Crossrefs

Different from A038126.
Cf. A249547 (partial sums), A010693 (1st differences).

Programs

Formula

a(n) = floor(5*n/2).
From R. J. Mathar, Sep 23 2008: (Start)
G.f.: x*(2 + 3*x)/((1 + x)*(1 - x)^2).
a(n) = 5*n/2 + ((-1)^n-1)/4.
a(n+1) - a(n) = A010693(n+1). (End)
a(n) = 5*n - a(n-1) - 8 with a(1)=0. - Vincenzo Librandi, Aug 05 2010
a(n+1) = Sum_{k>=0} A030308(n,k)*A084215(k+1). - Philippe Deléham, Oct 17 2011
a(n) = 2*n + floor(n/2). - Arkadiusz Wesolowski, Sep 19 2012
Sum_{n>=1} (-1)^(n+1)/a(n) = log(5)/4 - sqrt(5)*log(phi)/10 + sqrt(1-2/sqrt(5))*Pi/10, where phi is the golden ratio (A001622). - Amiram Eldar, Dec 07 2021
E.g.f.: (5*x*exp(x) - sinh(x))/2. - David Lovler, Aug 22 2022

A176059 Periodic sequence: Repeat 3, 2.

Original entry on oeis.org

3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3
Offset: 0

Views

Author

Klaus Brockhaus, Apr 07 2010

Keywords

Comments

Interleaving of A010701 and A007395.
Also continued fraction expansion of (3+sqrt(15))/2.
Also decimal expansion of 32/99.
a(n) = A010693(n+1).
Essentially first differences of A047218.
Binomial transform of 3 followed by -A122803.
Inverse binomial transform of 3 followed by A020714.
Second inverse binomial transform of A057198 without initial term 1.

Crossrefs

Cf. A010701 (all 3's sequence), A007395 (all 2's sequence), A176058 (decimal expansion of (3+sqrt(15))/2), A010693 (repeat 2, 3), A047218 (congruent to {0, 3} mod 5), A122803 (powers of -2), A020714 (5*2^n), A057198 ((5*3^(n-1)+1)/2, n > 0).
Cf. A026532 (partial products).

Programs

Formula

a(n) = (5+(-1)^n)/2.
a(n) = a(n-2) for n > 1; a(0) = 3, a(1) = 2.
a(n) = -a(n-1)+5 for n > 0; a(0) = 3.
a(n) = 3*((n+1) mod 2)+2*(n mod 2).
G.f.: (3+2*x)/((1-x)*(1+x)).
E.g.f.: 3*cosh(x) + 2*sinh(x). - Stefano Spezia, Aug 04 2025

A026549 Ratios of successive terms are 2, 3, 2, 3, 2, 3, 2, 3, ...

Original entry on oeis.org

1, 2, 6, 12, 36, 72, 216, 432, 1296, 2592, 7776, 15552, 46656, 93312, 279936, 559872, 1679616, 3359232, 10077696, 20155392, 60466176, 120932352, 362797056, 725594112, 2176782336, 4353564672, 13060694016, 26121388032, 78364164096, 156728328192, 470184984576, 940369969152
Offset: 0

Views

Author

Keywords

Comments

Appears to be the number of permutations p of {1,2,...,n} such that p(i)+p(i+1)>=n for every i=1,2,...,n-1 (if offset is 1). - Vladeta Jovovic, Dec 15 2003
Equals eigensequence of a triangle with 1's in even columns and (1,3,3,3,...) in odd columns. a(5) = 72 = (1, 3, 1, 3, 1, 1) dot (1, 1, 2, 6, 12, 36) = (1 + 3 + 2 + 18 + 12 + 36), where (1, 3, 1, 3, 1, 1) = row 5 of the generating triangle. - Gary W. Adamson, Aug 02 2010
Partial products of A010693. - Reinhard Zumkeller, Mar 29 2012
Satisfies Benford's law [Theodore P. Hill, Personal communication, Feb 06, 2017]. - N. J. A. Sloane, Feb 08 2017
For n >= 2, a(n) is the least k > a(n-1) such that both k and a(n-2) + a(n-1) + k have exactly n prime factors, counted with multiplicity. - Robert Israel, Aug 06 2024

Examples

			G.f. = 1 + 2*x + 6*x^2 + 12*x^3 + 36*x^4 + 72*x^5 + 216*x^6 + ... - _Michael Somos_, Apr 09 2022
		

References

  • Arno Berger and Theodore P. Hill, An Introduction to Benford's Law, Princeton University Press, 2015.

Crossrefs

Programs

  • Haskell
    a026549 n = a026549_list !! n
    a026549_list = scanl (*) 1 $ a010693_list
    -- Reinhard Zumkeller, Mar 29 2012
    
  • Magma
    [(1/2)*(3-(-1)^n)*6^Floor(n/2): n in [0..30]]; // Vincenzo Librandi, Jun 08 2011
    
  • Maple
    seq(seq(2^i*3^j, i=j..j+1),j=0..30); # Robert Israel, Aug 06 2024
  • Mathematica
    LinearRecurrence[{0,6},{1,2},30] (* Harvey P. Dale, May 29 2016 *)
  • PARI
    {a(n) = 6^(n\2) * (n%2+1)}; /* Michael Somos, Apr 09 2022 */
  • SageMath
    [(1+(n%2))*6^(n//2) for n in (0..30)] # G. C. Greubel, Apr 09 2022
    

Formula

Equals T(n, 0) + T(n, 1) + ... + T(n, 2n), T given by A026536.
a(n) = 2*A026532(n), for n > 0.
G.f.: (1+2*x)/(1-6*x^2) - Paul Barry, Aug 25 2003
a(n+3) = a(n+2)*a(n+1)/a(n). - Reinhard Zumkeller, Mar 04 2011
a(n) = (1/2)*(3 - (-1)^n)*6^floor(n/2), or a(n) = 6*a(n-2). - Vincenzo Librandi, Jun 08 2011
a(n) = 1/a(-n) if n is even and (2/3)/a(-n) if n is odd for all n in Z. - Michael Somos, Apr 09 2022
Sum_{n>=0} 1/a(n) = 9/5. - Amiram Eldar, Feb 13 2023

Extensions

New definition from Ralf Stephan, Dec 01 2004

A195013 Multiples of 2 and of 3 interleaved: a(2n-1) = 2n, a(2n) = 3n.

Original entry on oeis.org

2, 3, 4, 6, 6, 9, 8, 12, 10, 15, 12, 18, 14, 21, 16, 24, 18, 27, 20, 30, 22, 33, 24, 36, 26, 39, 28, 42, 30, 45, 32, 48, 34, 51, 36, 54, 38, 57, 40, 60, 42, 63, 44, 66, 46, 69, 48, 72, 50, 75, 52, 78, 54, 81, 56, 84, 58, 87, 60, 90, 62, 93, 64, 96, 66, 99, 68, 102
Offset: 1

Views

Author

Omar E. Pol, Sep 09 2011

Keywords

Comments

First differences of A195014.

Crossrefs

Cf. A111712 (partial sums of this sequence prepended with 1).

Programs

  • Haskell
    import Data.List (transpose)
    a195013 n = a195013_list !! (n-1)
    a195013_list = concat $ transpose [[2, 4 ..], [3, 6 ..]]
    -- Reinhard Zumkeller, Apr 06 2015
    
  • Magma
    &cat[[2*n,3*n]: n in [1..34]]; // Bruno Berselli, Sep 25 2011
    
  • Mathematica
    With[{r = Range[50]}, Riffle[2*r, 3*r]] (* or *)
    LinearRecurrence[{0, 2, 0, -1}, {2, 3, 4, 6}, 100] (* Paolo Xausa, Feb 09 2024 *)
  • PARI
    a(n)=(5*n+(n-2)*(-1)^n+2)/4 \\ Charles R Greathouse IV, Sep 24 2015

Formula

Pair(2*n, 3*n).
From Bruno Berselli, Sep 26 2011: (Start)
G.f.: x*(2+3*x)/(1-x^2)^2.
a(n) = (5*n+(n-2)*(-1)^n+2)/4.
a(n) = 2*a(n-2) - a(n-4) = a(n-2) + A010693(n-1).
a(n)+a(-n) = A010673(n).
a(n)-a(-n) = A106832(n). (End)

A158478 Number of colors needed to paint n sectors of a circle.

Original entry on oeis.org

0, 1, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2
Offset: 0

Views

Author

Jaume Oliver Lafont, Mar 20 2009

Keywords

Comments

No pair of adjacent sectors can have the same color.
For n > 0: smallest prime factor of A098548(n).
Decimal expansion of 61/4950. - Elmo R. Oliveira, May 05 2024

Crossrefs

Programs

  • Haskell
    a158478 n = if n < 4 then n else 2 + mod n 2
    a158478_list = [0..3] ++ cycle [2,3]
    -- Reinhard Zumkeller, Nov 30 2014
  • Mathematica
    Join[Range[0, 1], ConstantArray[{2, 3}, 20]] // Flatten (* Robert Price, Jun 15 2020 *)
  • PARI
    a(n)=if(n<4,n,2+n%2)
    

Formula

G.f.: x*(1+2*x+2*x^2)/(1-x^2).
E.g.f.: 2*cosh(x) + 3*sinh(x) - 2*(1 + x). - Stefano Spezia, Mar 24 2020
a(n) = a(n-2) for n > 3. - Elmo R. Oliveira, May 05 2024
a(n) = (n mod 2) + (2 mod (n+1)). - Aaron J Grech, Sep 02 2024

A016767 a(n) = (3*n)^3.

Original entry on oeis.org

0, 27, 216, 729, 1728, 3375, 5832, 9261, 13824, 19683, 27000, 35937, 46656, 59319, 74088, 91125, 110592, 132651, 157464, 185193, 216000, 250047, 287496, 328509, 373248, 421875, 474552, 531441, 592704
Offset: 0

Views

Author

Keywords

Examples

			G.f. = 27*x + 216*x^2 + 729*x^3 * 1728*x^4 + 3375*x^5 + 5832*x^6 + ... - _Michael Somos_, Sep 16 2018
		

Programs

Formula

From Reinhard Zumkeller, Jan 29 2009: (Start)
a(n) = 27*A000578(n).
A020639(a(n)) = A010693(n), for n>0. (End)
a(n) = A155955(n,3) for n>2. - Reinhard Zumkeller, Jan 31 2009
G.f.: 27*x*(1+4*x+x^2)/(x-1)^4 . - R. J. Mathar, Jul 07 2017
E.g.f.: 27*x*(1 + 3*x + x^2)*exp(x). - G. C. Greubel, Sep 15 2018
a(n) = -a(-n) for all n in Z. - Michael Somos, Sep 16 2018

A101622 A Horadam-Jacobsthal sequence.

Original entry on oeis.org

0, 1, 6, 13, 30, 61, 126, 253, 510, 1021, 2046, 4093, 8190, 16381, 32766, 65533, 131070, 262141, 524286, 1048573, 2097150, 4194301, 8388606, 16777213, 33554430, 67108861, 134217726, 268435453, 536870910, 1073741821, 2147483646, 4294967293, 8589934590
Offset: 0

Views

Author

Paul Barry, Dec 10 2004

Keywords

Comments

Companion sequence to A084639.
This is the sequence A(0,1;1,2;5) of the family of sequences [a,b:c,d:k] considered by G. Detlefs, and treated as A(a,b;c,d;k) in the W. Lang link given below. - Wolfdieter Lang, Oct 18 2010
Except for the initial three terms, the decimal representation of the x-axis, from the left edge to the origin, of the n-th stage of growth of the two-dimensional cellular automaton defined by "Rule 961", based on the 5-celled von Neumann neighborhood, initialized with a single black (ON) cell at stage zero. - Robert Price, Mar 27 2017
Named after the Australian mathematician Alwyn Francis Horadam (1923-2016) and the German mathematician Ernst Jacobsthal (1882-1965). - Amiram Eldar, Jun 10 2021

References

  • Stephen Wolfram, A New Kind of Science, Wolfram Media, 2002; p. 170.

Crossrefs

Cf. A131953.

Programs

  • Magma
    [(2^(n+2)+(-1)^n-5)/2: n in [0..35]]; // Vincenzo Librandi, Aug 12 2011
    
  • Mathematica
    LinearRecurrence[{2,1,-2},{0,1,6},40] (* Harvey P. Dale, Jul 08 2014 *)
  • PARI
    concat(0, Vec(x*(1+4*x)/((1-x)*(1+x)*(1-2*x)) + O(x^30))) \\ Colin Barker, Mar 28 2017

Formula

a(n) = (2^(n+2) + (-1)^n - 5)/2.
G.f.: x*(1+4*x)/((1-x)*(1+x)*(1-2*x)).
a(n) = (A014551(n+2)-5)/2.
(1, 6, 13, 30, 61, ...) are the row sums of A131953. - Gary W. Adamson, Jul 31 2007
From Paul Curtz, Jan 01 2009: (Start)
a(n) = a(n-1) + 2*a(n-2) + 5.
a(n) = 2*a(n-1) + a(n-2) - 2*a(n-3).
a(n) = A000079(n+1) - A010693(n).
a(n+1) = A141722(n) + 5 = A141722(n) + A010716(n).
a(2n+1) - a(2n) = 1, 7, 31, ... = A083420.
a(2n+1) - 2*a(2n) = 1.
a(2n) = A002446 = 6*A002450, a(2n+1) = A141725. (End)
a(n) = 2*a(n-1) + a(n-2) - 2*a(n-3) for n>2. - Colin Barker, Mar 28 2017
a(n) = (1/2) * Sum_{k=1..n} binomial(n+1,k) * (2+(-1)^k). - Wesley Ivan Hurt, Sep 23 2017
Showing 1-10 of 27 results. Next