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

A126684 Union of A000695 and 2*A000695.

Original entry on oeis.org

0, 1, 2, 4, 5, 8, 10, 16, 17, 20, 21, 32, 34, 40, 42, 64, 65, 68, 69, 80, 81, 84, 85, 128, 130, 136, 138, 160, 162, 168, 170, 256, 257, 260, 261, 272, 273, 276, 277, 320, 321, 324, 325, 336, 337, 340, 341, 512, 514, 520, 522, 544, 546, 552, 554, 640, 642, 648, 650
Offset: 1

Views

Author

Jonathan Deane, Feb 15 2007, May 04 2007

Keywords

Comments

Essentially the same as A032937: 0 followed by terms of A032937. - R. J. Mathar, Jun 15 2008
Previous name was: If A = {a_1, a_2, a_3...} is the Moser-de Bruijn sequence A000695 (consisting of sums of distinct powers of 4) and A' = {2a_1, 2a_2, 2a_3...} then this sequence, let's call it B, is the union of A and A'. Its significance, alluded to in the entry for the Moser-de Bruijn sequence, is that its sumset, B+B, = {b_i + b_j : i, j natural numbers} consists of the nonnegative integers; and it is the fastest-growing sequence with this property. It can also be described as a "basis of order two for the nonnegative integers".
The sequence is the fastest growing with this property in the sense that a(n) ~ n^2, and any sequence with this property is O(n^2). - Franklin T. Adams-Watters, Jul 27 2015
Or, base 2 representation Sum{d(i)*2^(m-i): i=0,1,...,m} has even d(i) for all odd i.
Union of A000695 and 2*A000695. - Ralf Stephan, May 05 2004
Union of A000695 and A062880. - Franklin T. Adams-Watters, Aug 30 2014
Integers, the binary representation of which contains no pair of 1 bits whose difference in bit index is odd. - Frederik P.J. Vandecasteele, May 29 2025

Examples

			All nonnegative integers can be represented in the form b_i + b_j; e.g. 6 = 5+1, 7 = 5+2, 8 = 0+8, 9 = 4+5
		

Crossrefs

Programs

  • Haskell
    a126684 n = a126684_list !! (n-1)
    a126684_list = tail $ m a000695_list $ map (* 2) a000695_list where
       m xs'@(x:xs) ys'@(y:ys) | x < y     = x : m xs ys'
                               | otherwise = y : m xs' ys
    -- Reinhard Zumkeller, Dec 03 2011
    
  • Mathematica
    nmax = 100;
    b[n_] := FromDigits[IntegerDigits[n, 2], 4];
    Union[A000695 = b /@ Range[0, nmax], 2 A000695][[1 ;; nmax+1]] (* Jean-François Alcover, Oct 28 2019 *)
  • PARI
    for(n=0,350,b=binary(n); l=length(b); if(sum(i=1,floor(l/2), component(b,2*i))==0,print1(n,",")))
    
  • Python
    from gmpy2 import digits
    def A126684(n):
        def bisection(f,kmin=0,kmax=1):
            while f(kmax) > kmax: kmax <<= 1
            while kmax-kmin > 1:
                kmid = kmax+kmin>>1
                if f(kmid) <= kmid:
                    kmax = kmid
                else:
                    kmin = kmid
            return kmax
        def g(x):
            s = digits(x,4)
            for i in range(l:=len(s)):
                if s[i]>'1':
                    break
            else:
                return int(s,2)
            return int(s[:i]+'1'*(l-i),2)
        def f(x): return n-1+x-g(x)-g(x>>1)
        return bisection(f,n-1,n-1) # Chai Wah Wu, Oct 29 2024

Formula

G.f.: sum(i>=1, T(i, x) + U(i, x) ), where
T := (k,x) -> x^(2^k-1)*V(k,x);
U := (k,x) -> 2*x^(3*2^(k-1)-1)*V(k,x); and
V := (k,x) -> (1-x^(2^(k-1)))*(4^(k-1) + sum(4^j*x^(2^j)/(1+x^(2^j)), j = 0..k-2))/(1-x);
Generating function. Define V(k) := [4^(k-1) + Sum ( j=0 to k-2, 4^j * x^(2^j)/(1+x^(2^j)) )] * (1-x^(2^(k-1)))/(1-x) and T(k) := (x^(2^k-1) * V(k), U(k) := x^(3*2^(k-1)-1) * V(k) then G.f. is Sum ( i >= 1, T(i) + U(i) ). Functional equation: if the sequence is a(n), n = 1, 2, 3, ... and h(x) := Sum ( n >= 1, x^a(n) ) then h(x) satisfies the following functional equation: (1 + x^2)*h(x^4) - (1 - x)*h(x^2) - x*h(x) + x^2 = 0.

Extensions

New name (using comment from Ralf Stephan) from Joerg Arndt, Aug 31 2014

A033053 Numbers whose base-2 representation Sum_{i=0..m} d(i)*2^i has d(i)=1 when i != m mod 2.

Original entry on oeis.org

1, 3, 6, 7, 13, 15, 26, 27, 30, 31, 53, 55, 61, 63, 106, 107, 110, 111, 122, 123, 126, 127, 213, 215, 221, 223, 245, 247, 253, 255, 426, 427, 430, 431, 442, 443, 446, 447, 490, 491, 494, 495, 506, 507, 510, 511, 853, 855, 861, 863
Offset: 1

Views

Author

Keywords

Comments

Numbers 2^(2k)-1 - A062880(m) where 2^(2k-2) >= A062880(m) or 2^(2k+1)-1 - A000695(m) where 2^(2k-1) >= A000695(m). - Franklin T. Adams-Watters, Aug 30 2014

Examples

			26 = 11010_2 has m=4, and d(i) = 1 for i=1 and 3.
53 = 110101_2 has m=5, and d(i) = 1 for i=0, 2 and 4.
		

Crossrefs

Disjoint with A032937 if more than 1 digit.

Programs

  • Maple
    F:= proc(m)
       local n0,j,S;
       n0:= 2^m + add(2^(m-1-2*j),j=0..floor((m-1)/2));
       S:= combinat[powerset]({seq(2^(m-2*j),j=1..floor(m/2))});
       map(t -> convert(t,`+`)+n0,S);
    end;
    `union`(seq(F(m),m=0..24)}; # Robert Israel, Mar 30 2014

Formula

a(2j+2) = 4 a(j)+3,
a(2j+1) = 4 a(j) + 2 if j <= 3*2^(m-1)-2,
a(2j+1) = 4 a(j) + 1 otherwise, where m = floor(log_2(j+1)).

Extensions

Definition corrected, incorrect cross-reference removed, and recurrence formulas by Robert Israel, Mar 30 2014

A377412 a(n) is the least k > 0 such that k*n belongs to A126684.

Original entry on oeis.org

1, 1, 1, 7, 1, 1, 7, 3, 1, 9, 1, 31, 7, 5, 3, 91, 1, 1, 9, 55, 1, 1, 31, 3, 7, 13, 5, 3, 3, 9, 91, 11, 1, 33, 1, 39, 9, 113, 55, 7, 1, 25, 1, 127, 31, 121, 3, 443, 7, 21, 13, 87, 5, 97, 3, 19, 3, 73, 9, 1199, 91, 21, 11, 1387, 1, 1, 33, 983, 1, 1, 39, 19, 9
Offset: 0

Views

Author

Rémy Sigrist, Oct 27 2024

Keywords

Comments

This sequence is well defined: for any positive integer n, according to the pigeonhole principle, A195156(i) mod n = A195156(j) mod n for some distinct i and j, hence n divides b = abs(A195156(i) - A195156(j)), and as b belongs to A126684, a(n) <= b/n.

Examples

			The first terms, alongside the binary expansion of a(n)*n, are:
  n   a(n)  bin(a(n)*n)
  --  ----  -----------
   0     1            0
   1     1            1
   2     1           10
   3     7        10101
   4     1          100
   5     1          101
   6     7       101010
   7     3        10101
   8     1         1000
   9     9      1010001
  10     1         1010
  11    31    101010101
  12     7      1010100
		

Crossrefs

See A300867 for a similar sequence.

Programs

Formula

a(n) >= A300867(n).
a(n) = 1 iff n belongs to A126684.
Showing 1-3 of 3 results.