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 14 results. Next

A010061 Binary self or Colombian numbers: numbers that cannot be expressed as the sum of distinct terms of the form 2^k+1 (k>=0), or equivalently, numbers not of form m + sum of binary digits of m.

Original entry on oeis.org

1, 4, 6, 13, 15, 18, 21, 23, 30, 32, 37, 39, 46, 48, 51, 54, 56, 63, 71, 78, 80, 83, 86, 88, 95, 97, 102, 104, 111, 113, 116, 119, 121, 128, 130, 133, 135, 142, 144, 147, 150, 152, 159, 161, 166, 168, 175, 177, 180, 183, 185, 192, 200, 207, 209, 212, 215, 217
Offset: 1

Views

Author

Keywords

Comments

No two consecutive values appear in this sequence (see Links). - Griffin N. Macris, May 31 2020
The asymptotic density of this sequence is (1/8) * (2 - Sum_{n>=1} 1/2^a(n))^2 = 0.252660... (A242403). - Amiram Eldar, Nov 28 2020

References

  • Steven R. Finch, Mathematical Constants, Cambridge, 2003, Section 2.24, pp. 179-180.
  • József Sándor and Borislav Crstici, Handbook of Number theory II, Kluwer Academic Publishers, 2004, Chapter 4, pp. 384-386.
  • G. Troi and U. Zannier, Note on the density constant in the distribution of self-numbers, Bolletino U. M. I. (7) 9-A (1995), 143-148.

Crossrefs

Complement of A228082, or equally, numbers which do not occur in A092391. Gives the positions of zeros (those occurring after a(0)) in A228085-A228087 and positions of ones in A227643. Leftmost column of A228083. Base-10 analog: A003052.

Programs

  • Haskell
    a010061 n = a010061_list !! (n-1)
    a010061_list = filter ((== 0) . a228085) [1..]
    -- Reinhard Zumkeller, Oct 13 2013
    
  • Maple
    # For Maple code see A230091. - N. J. A. Sloane, Oct 10 2013
  • Mathematica
    Table[n + Total[IntegerDigits[n, 2]], {n, 0, 300}] // Complement[Range[Last[#]], #]& (* Jean-François Alcover, Sep 03 2013 *)
  • PARI
    /* Gen(n, b) returns a list of the generators of n in base b. Written by Max Alekseyev (see Alekseyev et al., 2021).
    For example, Gen(101, 10) returns [91, 101]. - N. J. A. Sloane, Jan 02 2022 */
    { Gen(u, b=10) = my(d, m, k);
      if(u<0 || u==1, return([]); );
      if(u==0, return([0]); );
      d = #digits(u, b)-1;
      m = u\b^d;
      while( sumdigits(m, b) > u - m*b^d,
        m--;
        if(m==0, m=b-1; d--; );
      );
      k = u - m*b^d - sumdigits(m, b);
      vecsort( concat( apply(x->x+m*b^d, Gen(k, b)),
                       apply(x->m*b^d-1-x, Gen((b-1)*d-k-2, b)) ) );
    }

Extensions

More terms from Antti Karttunen, Aug 17 2013
Better definition from Matthew C. Russell, Oct 08 2013

A092391 a(n) = n + wt(n), where wt(n) = A000120(n) = binary weight of n.

Original entry on oeis.org

0, 2, 3, 5, 5, 7, 8, 10, 9, 11, 12, 14, 14, 16, 17, 19, 17, 19, 20, 22, 22, 24, 25, 27, 26, 28, 29, 31, 31, 33, 34, 36, 33, 35, 36, 38, 38, 40, 41, 43, 42, 44, 45, 47, 47, 49, 50, 52, 50, 52, 53, 55, 55, 57, 58, 60, 59, 61, 62, 64, 64, 66, 67, 69, 65, 67, 68, 70, 70, 72, 73, 75
Offset: 0

Views

Author

Reinhard Zumkeller, May 08 2004

Keywords

Crossrefs

A010061 gives the numbers not occurring in this sequence. A228082 gives the terms of this sequence sorted into ascending order, with duplicates removed. A228085(n) gives the number of times n occurs in this sequence.

Programs

Formula

a(n) = n + A000120(n).
A010062(n+1) = a(A010062(n)).
G.f.: (1/(1 - x))*Sum_{k>=0} (2^k + 1)*x^(2^k)/(1 + x^(2^k)). - Ilya Gutkovskiy, Jul 23 2017

A228085 a(n) = number of distinct k which satisfy n = k + wt(k), where wt(k) (A000120) gives the number of 1's in binary representation of a nonnegative integer k.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Aug 09 2013

Keywords

Comments

wt(k) is also called bitcount(k).
a(n) = number of times n occurs in A092391.
The first 2 occurs at n = A230303(2) = 5 (as we have two solutions A092391(3) = A092391(4) = 5).
The first 3 occurs at n = A230303(3) = 129 (as we have three solutions A092391(123) = A092391(124) = A092391(128) = 129).
The first 4 occurs at n = A230303(4) = 4102, where we have solutions A092391(4091) = A092391(4092) = A092391(4099) = A092391(4100) = 4102.
For n>=1, a(2^n) = a(n-1) since an integer k = m is a solution to n-1 = m + wt(m) if and only if k = 2^n - 1 - m is a solution to 2^n = k + wt(k). - Max Alekseyev, Feb 23 2021

Crossrefs

A010061 gives the position of zeros, A228082 the positions of nonzeros, A228088 the positions of ones.
Cf. A000120, A010062, A092391, A228086, A228087, A228091 (positions of 2's), A227643, A230058, A230092 (positions of 3's), A230093, A227915 (positions of 4's), A070939, A230303.

Programs

  • Haskell
    a228085 n = length $ filter ((== n) . a092391) [n - a070939 n .. n]
    -- Reinhard Zumkeller, Oct 13 2013
  • Maple
    For Maple code see A230091. - N. J. A. Sloane, Oct 10 2013
    # Find all inverses of m under x -> x + wt(x) - N. J. A. Sloane, Oct 19 2013
    A000120 := proc(n) local w, m, i; w := 0; m := n; while m > 0 do i := m mod 2; w := w+i; m := (m-i)/2; od; w; end: wt := A000120;
    F:=proc(m) local ans,lb,n,i;
    lb:=m-ceil(log(m+1)/log(2)); ans:=[];
    for n from max(1,lb) to m do if (n+wt(n)) = m then ans:=[op(ans),n]; fi; od:
    [seq(ans[i],i=1..nops(ans))];
    end;
  • Mathematica
    nmax = 8191; Clear[a]; a[_] = 0;
    Scan[Set[a[#[[1]]], #[[2]]]&, Tally[Table[n + DigitCount[n, 2, 1], {n, 0, nmax}]]];
    a /@ Range[0, nmax] (* Jean-François Alcover, Oct 29 2019 *)
    a[n_] := Module[{k, cnt = 0}, For[k = n - Floor[Log[2, n]] - 1, k < n, k++, If[n == k + DigitCount[k, 2, 1], cnt++]]; cnt];
    a /@ Range[0, 100] (* Jean-François Alcover, Nov 28 2020 *)

A228082 Numbers that are of the form k + sum of binary digits of k for some nonnegative integer k.

Original entry on oeis.org

0, 2, 3, 5, 7, 8, 9, 10, 11, 12, 14, 16, 17, 19, 20, 22, 24, 25, 26, 27, 28, 29, 31, 33, 34, 35, 36, 38, 40, 41, 42, 43, 44, 45, 47, 49, 50, 52, 53, 55, 57, 58, 59, 60, 61, 62, 64, 65, 66, 67, 68, 69, 70, 72, 73, 74, 75, 76, 77, 79, 81, 82, 84, 85, 87, 89, 90
Offset: 1

Views

Author

Antti Karttunen, Aug 09 2013

Keywords

Comments

Complement of A010061.
Obtained when A092391 is sorted and duplicates are removed.
The asymptotic density of this sequence is 1 - (1/8) * (Sum_{n>=1} 1/2^a(n))^2 = 1 - A242403 = 0.747339... - Amiram Eldar, Nov 28 2020

References

  • Steven R. Finch, Mathematical Constants, Cambridge, 2003, Section 2.24, pp. 179-180.
  • József Sándor and Borislav Crstici, Handbook of Number theory II, Kluwer Academic Publishers, 2004, Chapter 4, p. 384-386.
  • G. Troi and U. Zannier, Note on the density constant in the distribution of self-numbers, Bolletino U. M. I. (7) 9-A (1995), 143-148.

Crossrefs

Numbers that occur to the right of the leftmost column of A228083. Positions of nonzeros in A228085. A superset of A228088.
The even terms are the first row of A350601.

Programs

  • Haskell
    a228082 n = a228082_list !! (n-1)
    a228082_list = 0 : filter ((> 0) . a228085) [1..]
    -- Reinhard Zumkeller, Oct 13 2013
  • Mathematica
    Table[n + Total[IntegerDigits[n, 2]], {n, 0, 100}] // Union (* Jean-François Alcover, Sep 03 2013 *)

A230641 a(n) = n + (sum of digits in base-3 representation of n).

Original entry on oeis.org

0, 2, 4, 4, 6, 8, 8, 10, 12, 10, 12, 14, 14, 16, 18, 18, 20, 22, 20, 22, 24, 24, 26, 28, 28, 30, 32, 28, 30, 32, 32, 34, 36, 36, 38, 40, 38, 40, 42, 42, 44, 46, 46, 48, 50, 48, 50, 52, 52, 54, 56, 56, 58, 60, 56, 58, 60, 60, 62, 64, 64, 66, 68, 66, 68, 70, 70, 72, 74, 74, 76, 78, 76, 78, 80, 80, 82, 84, 84, 86, 88, 82
Offset: 0

Views

Author

N. J. A. Sloane, Oct 31 2013

Keywords

Comments

The image of this sequence is the set of nonnegative even numbers (A005843). Joshi (1973) proved that the sequence of base-q self numbers (analogous to A003052) is the sequence of odd numbers (A005408) for all odd q. - Amiram Eldar, Nov 28 2020

References

  • V. S. Joshi, Ph.D. dissertation, Gujarat Univ., Ahmedabad (India), October, 1973.
  • József Sándor and Borislav Crstici, Handbook of Number theory II, Kluwer Academic Publishers, 2004, Chapter 4, p. 384-386.

Crossrefs

Related base-3 sequences: A053735, A134451, A230641, A230642, A230643, A230853, A230854, A230855, A230856, A230639, A230640, A010063 (trajectory of 1)

Programs

  • Haskell
    a230641 n = a053735 n + n  -- Reinhard Zumkeller, May 19 2015
  • Mathematica
    Table[n + Plus @@ IntegerDigits[n, 3], {n, 0, 100}] (* Amiram Eldar, Nov 28 2020 *)

Formula

a(n) = n + A053735(n). - Amiram Eldar, Nov 28 2020

A230092 Numbers of the form k + wt(k) for exactly three distinct k, where wt(k) = A000120(k) is the binary weight of k.

Original entry on oeis.org

129, 134, 386, 391, 515, 518, 642, 647, 899, 904, 1028, 1030, 1154, 1159, 1411, 1416, 1540, 1543, 1667, 1672, 1924, 1929, 2178, 2183, 2435, 2440, 2564, 2567, 2691, 2696, 2948, 2953, 3077, 3079, 3203, 3208, 3460, 3465, 3589, 3592, 3716, 3721, 3973, 3978, 4226
Offset: 1

Views

Author

N. J. A. Sloane, Oct 10 2013

Keywords

Comments

The positions of entries equal to 3 in A228085, or numbers that appear exactly thrice in A092391.
Numbers that can be expressed as the sum of distinct terms of the form 2^n+1, n=0,1,... in exactly three ways.

Crossrefs

Programs

  • Haskell
    a230092 n = a230092_list !! (n-1)
    a230092_list = filter ((== 3) . a228085) [1..]
    -- Reinhard Zumkeller, Oct 13 2013
  • Maple
    For Maple code see A230091.
  • Mathematica
    nt = 1000; (* number of terms to produce *)
    S[kmax_] := S[kmax] = Table[k + Total[IntegerDigits[k, 2]], {k, 0, kmax}] // Tally // Select[#, #[[2]] == 3&][[All, 1]]& // PadRight[#, nt]&;
    S[nt];
    S[kmax = 2 nt];
    While[S[kmax] =!= S[kmax/2], kmax *= 2];
    S[kmax] (* Jean-François Alcover, Mar 04 2023 *)

A227915 Numbers of the form k + wt(k) for exactly four distinct k, where wt(k) = A000120(k) is the binary weight of k.

Original entry on oeis.org

4102, 12295, 20487, 28680, 36871, 45064, 53256, 61449, 69639, 77832, 86024, 94217, 102408, 110601, 118793, 126986, 135175, 143368, 151560, 159753, 167944, 176137, 184329, 192522, 200712, 208905, 217097, 225290, 233481, 241674, 249866, 258059, 266247, 274440, 282632, 290825, 299016, 307209, 315401, 323594, 331784, 339977
Offset: 1

Views

Author

Reinhard Zumkeller, Oct 13 2013

Keywords

Comments

Numbers occurring exactly four times in A092391: A228085(a(n)) = 4. For the first number that appears k times, see A230303.

Examples

			a(1) = 4102, the four k with A092391(k) = 4102 being:
4091 = '111111111011', A000120(4091) = 11, 4091 + 11 = 4102;
4092 = '111111111100', A000120(4092) = 12, 4092 + 10 = 4102;
4099 = '1000000000011', A000120(4099) = 3, 4099 + 3 = 4102;
4100 = '1000000000100', A000120(4100) = 2, 4100 + 2 = 4102.
		

Crossrefs

Programs

  • Haskell
    a227915 n = a227915_list !! (n-1)
    a227915_list = filter ((== 4) . a228085) [1..]

A228086 a(n) is the least k which satisfies n = k + bitcount(k), or 0 if no such k exists. Here bitcount(k) (or wt(k), A000120) gives the number of 1's in binary representation of nonnegative integer k.

Original entry on oeis.org

0, 0, 1, 2, 0, 3, 0, 5, 6, 8, 7, 9, 10, 0, 11, 0, 13, 14, 0, 15, 18, 0, 19, 0, 21, 22, 24, 23, 25, 26, 0, 27, 0, 29, 30, 33, 31, 0, 35, 0, 37, 38, 40, 39, 41, 42, 0, 43, 0, 45, 46, 0, 47, 50, 0, 51, 0, 53, 54, 56, 55, 57, 58, 0, 59, 64, 61, 62, 66, 63, 67, 0
Offset: 0

Views

Author

Antti Karttunen, Aug 09 2013

Keywords

Comments

A083058(n)+1 gives a lower bound for nonzero terms, n-1 an upper bound.

Crossrefs

Cf. A228087, A228085, A335599. A010061 gives the positions of zeros after a(0). The union of A010061 and A228088 gives the positions where a(n) = A228087(n).
Cf. also A213723, A227643.

Programs

  • Mathematica
    a[n_] := Module[{k}, For[k = n - Floor[Log[2, n]] - 1, k < n, k++, If[n == k + DigitCount[k, 2, 1], Return[k]]]; 0];
    a /@ Range[0, 1000]; (* Jean-François Alcover, Nov 28 2020 *)
  • Scheme
    (define (A228086 n) (if (zero? n) n (let loop ((k (+ (A083058 n) 1))) (cond ((> k n) 0) ((= n (A092391 k)) k) (else (loop (+ 1 k)))))))

A230091 Numbers of the form k + wt(k) for exactly two distinct k, where wt(k) = A000120(k) is the binary weight of k.

Original entry on oeis.org

5, 14, 17, 19, 22, 31, 33, 36, 38, 47, 50, 52, 55, 64, 67, 70, 79, 82, 84, 87, 96, 98, 101, 103, 112, 115, 117, 120, 131, 132, 143, 146, 148, 151, 160, 162, 165, 167, 176, 179, 181, 184, 193, 196, 199, 208, 211, 213, 216, 225, 227, 230, 232, 241, 244, 246, 249, 258, 260, 262, 271, 274, 276, 279, 288, 290, 293, 295
Offset: 1

Views

Author

N. J. A. Sloane, Oct 10 2013

Keywords

Comments

The positions of entries equal to 2 in A228085, or numbers that appear exactly twice in A092391.
Numbers that can be expressed as the sum of distinct terms of the form 2^n+1, n=0,1,... in exactly two ways.

Examples

			5 = 3 + 2 = 4 + 1, so 5 is in this list.
		

Crossrefs

Programs

  • Haskell
    a230091 n = a230091_list !! (n-1)
    a230091_list = filter ((== 2) . a228085) [1..]
    -- Reinhard Zumkeller, Oct 13 2013
  • Maple
    # Maple code for A000120, A092391, A228085, A010061, A228088, A230091, A230092
    with(LinearAlgebra):
    read transforms;
    wt := proc(n) local w, m, i; w := 0; m := n; while m > 0 do i := m mod 2; w := w+i; m := (m-i)/2; od; w; end: # A000120
    M:=1000;
    lis1:=Array(0..M);
    lis2:=Array(0..M);
    ctmax:=4;
    for i from 0 to ctmax do ct[i]:=Array(0..M); od:
    for n from 0 to M do
    m:=n+wt(n);
    lis1[n]:=m;
    if (m <= M) then lis2[m]:=lis2[m]+1; fi;
    od:
    t1:=[seq(lis1[i],i=0..M)]; # A092391
    t2:=[seq(lis2[i],i=0..M)]; # A228085
    COMPl(t1); # A010061
    for i from 1 to M do h:=lis2[i];
    if h <= ctmax then ct[h]:=[op(ct[h]),i]; fi; od:
    len:=nops(ct[0]); [seq(ct[0][i],i=1..len)]; # A010061 again
    len:=nops(ct[1]); [seq(ct[1][i],i=1..len)]; # A228088
    len:=nops(ct[2]); [seq(ct[2][i],i=1..len)]; # A230091
    len:=nops(ct[3]); [seq(ct[3][i],i=1..len)]; # A230092
  • Mathematica
    nt = 100; (* number of terms to produce *)
    S[kmax_] := S[kmax] = Table[k + Total[IntegerDigits[k, 2]], {k, 0, kmax}] // Tally // Select[#, #[[2]] == 2&][[All, 1]]& // PadRight[#, nt]&;
    S[nt];
    S[kmax = 2 nt];
    While[S[kmax] =!= S[kmax/2], kmax *= 2];
    S[kmax] (* Jean-François Alcover, Mar 04 2023 *)

A228087 a(n) = largest k which satisfies n = k + bitcount(k), or 0 if no such k exists. Here bitcount(k) (A000120) gives the number of 1's in binary representation of nonnegative integer k.

Original entry on oeis.org

0, 0, 1, 2, 0, 4, 0, 5, 6, 8, 7, 9, 10, 0, 12, 0, 13, 16, 0, 17, 18, 0, 20, 0, 21, 22, 24, 23, 25, 26, 0, 28, 0, 32, 30, 33, 34, 0, 36, 0, 37, 38, 40, 39, 41, 42, 0, 44, 0, 45, 48, 0, 49, 50, 0, 52, 0, 53, 54, 56, 55, 57, 58, 0, 60, 64, 61, 65, 66, 63, 68, 0
Offset: 0

Views

Author

Antti Karttunen, Aug 09 2013

Keywords

Comments

A083058(n)+1 gives a lower bound for nonzero terms, n-1 an upper bound.

Crossrefs

Cf. A228086, A228085. A010061 gives the positions of zeros after a(0). The union of A010061 and A228088 gives the positions where a(n) = A228086(n).
Cf. also A213724, A227643.

Programs

  • Scheme
    (define (A228087 n) (let loop ((k n)) (cond ((<= k (A083058 n)) 0) ((= n (A092391 k)) k) (else (loop (- k 1))))))
Showing 1-10 of 14 results. Next