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-4 of 4 results.

A106836 First differences of A060833 and (from a(2) onward) also of A091067 and A255068.

Original entry on oeis.org

3, 3, 1, 4, 1, 2, 1, 4, 3, 1, 1, 3, 1, 2, 1, 4, 3, 1, 4, 1, 2, 1, 1, 3, 3, 1, 1, 3, 1, 2, 1, 4, 3, 1, 4, 1, 2, 1, 4, 3, 1, 1, 3, 1, 2, 1, 1, 3, 3, 1, 4, 1, 2, 1, 1, 3, 3, 1, 1, 3, 1, 2, 1, 4, 3, 1, 4, 1, 2, 1, 4, 3, 1, 1, 3, 1, 2, 1, 4, 3, 1, 4, 1, 2, 1, 1, 3, 3, 1, 1, 3, 1, 2, 1, 1, 3, 3, 1, 4, 1, 2, 1
Offset: 1

Views

Author

Ralf Stephan, May 03 2005

Keywords

Comments

From Antti Karttunen, Feb 20 2015: (Start)
Among the terms a(1) .. a(8192), 1 occurs 4095 times, 2 occurs 1024 times, 3 occurs 2048 times and 4 occurs 1025 times. No larger numbers can ever occur.
That these are the first differences of not just A091067 and A255068, but also of A060833 follows from N. Sato's Feb 12 2013 comment in the latter that "For n > 1, n is in the sequence (A060833) if and only if A038189(n-1) = 1."
Also length of runs in A236840 and A255070.
(End)

Crossrefs

Programs

Formula

a(1) = 3, and for n > 1: a(n) = A091067(n) - A091067(n-1). - Antti Karttunen, Feb 20 2015

Extensions

Name edited by Antti Karttunen, Feb 20 2015

A091067 Numbers whose odd part is of the form 4k+3.

Original entry on oeis.org

3, 6, 7, 11, 12, 14, 15, 19, 22, 23, 24, 27, 28, 30, 31, 35, 38, 39, 43, 44, 46, 47, 48, 51, 54, 55, 56, 59, 60, 62, 63, 67, 70, 71, 75, 76, 78, 79, 83, 86, 87, 88, 91, 92, 94, 95, 96, 99, 102, 103, 107, 108, 110, 111, 112, 115, 118, 119, 120, 123, 124, 126, 127, 131
Offset: 1

Views

Author

Ralf Stephan, Feb 22 2004

Keywords

Comments

Either of form 2*a(m) or 4k+3, k >= 0, 0 < m < n.
A000265(a(n)) is an element of A004767.
a(n) such that A038189(a(n)) = 1.
Numbers n such that Kronecker(-n, m) = Kronecker(m, n) for all m. - Michael Somos, Sep 22 2005
From Antti Karttunen, Feb 20-21 2015: (Start)
Gives all n for which A005811(n) - A005811(n-1) = -1, from which follows that a(n) = the least k such that A255070(k) = n.
Gives the positions of even terms in A003602. (End)
Indices of negative terms in A164677. - M. F. Hasler, Aug 06 2015
Indices of the 0's in A014577. - Gabriele Fici, Jun 02 2016
Also indices of -1 in A034947. - Jianing Song, Apr 24 2021
Conjecture: alternate definition of same sequence is that a(1)=3 and a(n) is the smallest number > a(n-1) so that no number that is the sum of at most 2 terms in this sequence is a power of 2. - J. Lowell, Jan 20 2024
The asymptotic density of this sequence is 1/2. - Amiram Eldar, Aug 31 2024

Crossrefs

Essentially one less than A060833.
Characteristic function: A038189.
Complement of A091072.
First differences are in A106836 (from its second term onward).
Sequence A246590 gives the even terms.
Gives the positions of records (after zero) for A255070 (equally, the position of the first n there).
Cf. A106837 (gives n such that both n and n+1 are terms of this sequence).
Cf. A098502 (gives n such that both n and n+2 are, but n+1 is not in this sequence).

Programs

  • Haskell
    import Data.List (elemIndices)
    a091067 n = a091067_list !! (n-1)
    a091067_list = map (+ 1) $ elemIndices 1 a014707_list
    -- Reinhard Zumkeller, Sep 28 2011
    (Scheme, with Antti Karttunen's IntSeq-library, two versions)
    (define A091067 (MATCHING-POS 1 1 (COMPOSE even? A003602)))
    (define A091067 (NONZERO-POS 1 0 A038189))
    ;; Antti Karttunen, Feb 20 2015
  • Mathematica
    Select[Range[150], Mod[# / 2^IntegerExponent[#, 2], 4] == 3 &] (* Amiram Eldar, Aug 31 2024 *)
  • PARI
    for(n=1,200,if(((n/2^valuation(n,2)-1)/2)%2,print1(n",")))
    
  • PARI
    {a(n) = local(m, c); if( n<1, 0, c=0; m=1; while( cMichael Somos, Sep 22 2005 */
    
  • PARI
    is_A091067(n)=bittest(n,valuation(n,2)+1) \\ M. F. Hasler, Aug 06 2015
    
  • PARI
    a(n) = my(t=1); n<<=1; forstep(i=logint(n,2),0,-1, if(bittest(n,i)==t, n++;t=!t)); n; \\ Kevin Ryde, Mar 21 2021
    

Formula

a(n) = A060833(n+1) - 1. [See N. Sato's Feb 12 2013 comment in A060833.]
Other identities. For all n >= 1 it holds that:
A014707(a(n) + 1) = 1. - Reinhard Zumkeller, Sep 28 2011
A055975(a(n)) < 0. - Reinhard Zumkeller, Apr 28 2012
From Antti Karttunen, Feb 20-21 2015: (Start)
a(n) = A246590(n)/2.
A255070(a(n)) = n, or equally, A236840(a(n)) = 2n.
a(n) = 1 + A255068(n-1). (End)

A082410 a(1)=0. Thereafter, the sequence is constructed using the rule: for any k >= 0, if a(1), a(2), ..., a(2^k+1) are known, the next 2^k terms are given as follows: a(2^k+1+i) = 1 - a(2^k+1-i) for 1 <= i <= 2^k.

Original entry on oeis.org

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

Views

Author

Benoit Cloitre, Apr 24 2003

Keywords

Comments

a(n) is A014577 shifted right twice (the definition here is similar to one of the constructions for A034947). - N. J. A. Sloane, Jul 27 2012
Complement of characteristic function of A060833.
From Tanya Khovanova, Apr 21 2020: (Start)
Suppose you have a deck of cards face down with 2^n cards such that the color pattern corresponds to this sequence: 0 for one color, 1 for the other. Then you proceed in the following manner: transfer to top card to the bottom of the deck, deal the next card, then repeat. The dealt cards will have alternating colors.
Even terms of this sequence alternate: 1, 0, 1, 0 and so on.
Removing even-indexed terms doesn't change the sequence. (End)

Examples

			First 3 terms are 0,1,1; therefore, a(4) = a(3+1) = 1 - a(3-1) = 1 - a(2) = 0, a(5) = a(3+2) = 1 - a(3-2) = 1 - a(1) = 1 and the sequence begins 0, 1, 1, 0, 1, ...
		

Crossrefs

The following are all essentially the same sequence: A014577, A014707, A014709, A014710, A034947, A038189, A082410. - N. J. A. Sloane, Jul 27 2012

Programs

  • Python
    def A082410(n):
        if n == 1:
            return 0
        s = bin(n-1)[2:]
        m = len(s)
        i = s[::-1].find('1')
        return 1-int(s[m-i-2]) if m-i-2 >= 0 else 1 # Chai Wah Wu, Apr 08 2021

Formula

For n >= 2, Sum_{k=1..n} a(k) = (n + A037834(n-1))/2.
a(1) = 0, a(4*n+2) = 1, a(4*n+4) = 0, a(2*n+1) = a(n+1) for n >= 0. - A.H.M. Smeets, Jul 27 2018

A255070 (1/2)*(n minus number of runs in the binary expansion of n): a(n) = (n - A005811(n)) / 2 = A236840(n)/2.

Original entry on oeis.org

0, 0, 0, 1, 1, 1, 2, 3, 3, 3, 3, 4, 5, 5, 6, 7, 7, 7, 7, 8, 8, 8, 9, 10, 11, 11, 11, 12, 13, 13, 14, 15, 15, 15, 15, 16, 16, 16, 17, 18, 18, 18, 18, 19, 20, 20, 21, 22, 23, 23, 23, 24, 24, 24, 25, 26, 27, 27, 27, 28, 29, 29, 30, 31, 31, 31, 31, 32, 32, 32, 33, 34, 34, 34, 34, 35
Offset: 0

Views

Author

Antti Karttunen, Feb 14 2015

Keywords

Crossrefs

Least inverse: A091067 (also the positions of records).
Greatest inverse: A255068.
Run lengths: A106836.

Programs

  • Mathematica
    a[n_] := (n - Length@ Split[IntegerDigits[n, 2]])/2; a[0] = 0; Array[a, 100, 0] (* Amiram Eldar, Jul 16 2023 *)
  • Scheme
    (define (A255070 n) (/ (A236840 n) 2))

Formula

a(n) = A236840(n) / 2 = (n - A005811(n)) / 2.
Other identities:
a(A091067(n)) = n for all n >= 1.
a(A255068(n)) = n for all n >= 0.
a(A269363(n)) = A269367(n). - Antti Karttunen, Aug 12 2019
Showing 1-4 of 4 results.