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 11 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 *)

A228088 Numbers n for which there is a unique k which satisfies n = k + wt(k), where wt(k) (A000120) gives the number of 1's in binary representation of nonnegative integer k.

Original entry on oeis.org

0, 2, 3, 7, 8, 9, 10, 11, 12, 16, 20, 24, 25, 26, 27, 28, 29, 34, 35, 40, 41, 42, 43, 44, 45, 49, 53, 57, 58, 59, 60, 61, 62, 65, 66, 68, 69, 72, 73, 74, 75, 76, 77, 81, 85, 89, 90, 91, 92, 93, 94, 99, 100, 105, 106, 107, 108, 109, 110, 114, 118, 122, 123, 124
Offset: 1

Views

Author

Antti Karttunen, Aug 09 2013

Keywords

Comments

wt(k) = A000120(k) is also called bitcount(k).
In other words, the positions of ones in A228085.
Numbers that can be expressed as the sum of distinct terms of the form 2^n+1, n=0,1,... in exactly one way. - Matthew C. Russell, Oct 08 2013

Examples

			0 is in this sequence because there is a unique k such that k+A000120(k)=0, in this case k=0.
1 is not in this sequence because there is no such k that k+A000120(k) would be 1. (Instead 1 is in A010061).
2 is in this sequence because there is exactly one k that satisfies k+A000120(k)=2, namely k=1.
3 is in this sequence because there is exactly one k that satisfies k+A000120(k)=3, namely k=2.
4 is not in this sequence because there is no such k that k+A000120(k) would be 4. (Instead 4 is in A010061.)
5 is not in this sequence because there is more than one k that satisfies k+A000120(k)=5, namely k=3 and k=4.
		

Crossrefs

Subset of A228082.
Cf. A228089 (corresponding k's for each a(n)).
Cf. A228090 (the same k's sorted into ascending order).
Cf. A227915.

Programs

Formula

a(n) = A092391(A228089(n)). [Consequence of the definitions of A228088 & A228089. Use the given Scheme-code to actually compute the sequence]

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

A230303 Let M(1)=0 and for n >= 2, let B(n)=M(ceiling(n/2))+M(floor(n/2))+2, M(n)=2^B(n)+M(floor(n/2))+1; sequence gives M(n).

Original entry on oeis.org

0, 5, 129, 4102, 87112285931760246646623899502532662132742, 1852673427797059126777135760139006525652319754650249024631321344126610074239106
Offset: 1

Views

Author

N. J. A. Sloane, Oct 24 2013; Mar 26 2014

Keywords

Comments

M(n) is the smallest value of k such that A228085(k) = n. For example, 129 is the first time a 3 appears in A228085 (and is therefore the first term in A230092). M(4) = 4102 is the first time a 4 appears in A228085 (and is therefore the first term in A227915).

Examples

			The terms are a(1) = 0, a(2) = 2^2+0+1, a(3) = 2^7+0+1, a(4) = 2^12+5+1, a(5) = 2^136+5+1, a(6) = 2^160+129+1, a(7) = 2^4233+129+1, a(8) = 2^8206+4102+1, a(9) = 2^k+4102+1 with k=2^136+4110, ... .
The length (in bits) of the n-th term is A230302(n)+1.
		

Crossrefs

Smallest number m such that u + (sum of base-b digits of u) = m has exactly n solutions, for bases 2 through 10: A230303, A230640, A230638, A230867, A238840, A238841, A238842, A238843, A006064.

Programs

  • Maple
    f:=proc(n) option remember; local B, M;
    if n<=1 then RETURN([0,0]);
    else
    if (n mod 2) = 0 then B:=2*f(n/2)[2]+2;
    else B:=f((n+1)/2)[2]+f((n-1)/2)[2]+2; fi;
    M:=2^B+f(floor(n/2))[2]+1; RETURN([B,M]); fi;
    end proc;
    [seq(f(n)[2],n=1..6)];

Formula

Define i by 2^(i-1) < n <= 2^i. Then it appears that
a(n) = 2^2^2^...^2^x
a tower of height i+3, containing i+2 2's, where x is in the range 0 < x <= 1.
For example, if n=7, i=3, and
a(7) = 2^4233+130 = 2^2^2^2^2^.88303276...
Note also that i+2 = A230864(a(n)).

Extensions

a(1)-a(8) were found by Donovan Johnson, Oct 22 2013.

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..]

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 *)

A230094 Numbers that can be expressed as (m + sum of digits of m) in exactly two ways.

Original entry on oeis.org

101, 103, 105, 107, 109, 111, 113, 115, 117, 202, 204, 206, 208, 210, 212, 214, 216, 218, 303, 305, 307, 309, 311, 313, 315, 317, 319, 404, 406, 408, 410, 412, 414, 416, 418, 420, 505, 507, 509, 511, 513, 515, 517, 519, 521, 606, 608, 610, 612, 614, 616, 618, 620, 622, 707, 709, 711, 713, 715, 717, 719, 721, 723, 808
Offset: 1

Views

Author

N. J. A. Sloane, Oct 10 2013, Oct 24 2013

Keywords

Comments

Numbers n such that A230093(n) = 2.
The sequence "Numbers n such that A230093(n) = 3" starts at 10^13+1 (see A230092). This implies that changing the definition of A230094 to "Numbers n such that A230093(n) >= 2" (the so-called "junction numbers") would produce a sequence which agrees with A230094 up to 10^13.
Makowski shows that the sequence of junction numbers is infinite.

Examples

			a(1) = 101 = 91 + (9+1) = 100 + (1+0+0);
a(10) = 202 = 191 + (1+9+1) = 200 + (2+0+0);
a(100) = 1106 = 1093 + (1+0+9+3) = 1102 + (1+1+0+2);
a(1000) = 10312 = 10295 + (1+0+2+9+5) = 10304 + (1+0+3+0+4).
		

References

  • Joshi, V. S. A note on self-numbers. Volume dedicated to the memory of V. Ramaswami Aiyar. Math. Student 39 (1971), 327--328 (1972). MR0330032 (48 #8371)
  • D. R. Kaprekar, Puzzles of the Self-Numbers. 311 Devlali Camp, Devlali, India, 1959.
  • D. R. Kaprekar, The Mathematics of the New Self Numbers, Privately Printed, 311 Devlali Camp, Devlali, India, 1963.
  • Makowski, Andrzej. On Kaprekar's "junction numbers''. Math. Student 34 1966 77 (1967). MR0223292 (36 #6340)
  • Narasinga Rao, A. On a technique for obtaining numbers with a multiplicity of generators. Math. Student 34 1966 79--84 (1967). MR0229573 (37 #5147)

Crossrefs

Programs

  • Haskell
    a230094 n = a230094_list !! (n-1)
    a230094_list = filter ((== 2) . a230093) [0..]
    -- Reinhard Zumkeller, Oct 11 2013
  • Maple
    For Maple code see A230093.
  • Mathematica
    Position[#, 2][[All, 1]] - 1 &@ Sort[Join[#2, Map[{#, 0} &, Complement[Range[#1], #2[[All, 1]]]] ] ][[All, -1]] & @@ {#, Tally@ Array[# + Total@ IntegerDigits@ # &, # + 1, 0]} &[10^3] (* Michael De Vlieger, Oct 28 2020, after Harvey P. Dale at A230093 *)
Showing 1-10 of 11 results. Next