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

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

A228083 Table of binary Self-numbers and their descendants; square array T(r,c), with row r>=1, column c>=1, read by antidiagonals.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Aug 09 2013

Keywords

Examples

			The top-left corner of the square array:
   1,  2,  3,  5,  7, 10, 12, 14, ...
   4,  5,  7, 10, 12, 14, 17, 19, ...
   6,  8,  9, 11, 14, 17, 19, 22, ...
  13, 16, 17, 19, 22, 25, 28, 31, ...
  15, 19, 22, 25, 28, 31, 36, 38, ...
  18, 20, 22, 25, 28, 31, 36, 38, ...
  21, 24, 26, 29, 33, 35, 38, 41, ...
  23, 27, 31, 36, 38, 41, 44, 47, ...
  ...
The non-initial terms on each row are obtained by adding to the preceding term the number of 1-bits in its binary representation (A000120).
		

Crossrefs

First column: A010061. First row: A010062. Transpose: A228084. See A151942 for decimal analog.

Programs

  • Mathematica
    nmax0 = 100;
    nmax := Length[col[1]];
    col[1] = Table[n + DigitCount[n, 2, 1], {n, 0, nmax0}] // Complement[Range[Last[#]], #]&;
    col[k_] := col[k] = col[k - 1] + DigitCount[col[k-1], 2, 1];
    T[n_, k_] := col[k][[n]];
    Table[T[n-k+1, k], {n, 1, nmax}, {k, n, 1, -1}] // Flatten (* Jean-François Alcover, Nov 28 2020 *)

Formula

T(r,1) are those numbers not of form n + sum of binary digits of n (binary Self numbers) = A010061(r);
T(r,c) = T(r,c-1) + sum of binary digits of T(r,c-1) = A092391(T(r,c-1)).

A228236 Numbers k for which a sum k+bitcount(k) can be also obtained as a sum k2 +bitcount(k2) for some other k2<>k . Here bitcount(k) (A000120) gives the number of 1's in binary representation of nonnegative integer k.

Original entry on oeis.org

3, 4, 11, 12, 14, 15, 16, 17, 19, 20, 27, 28, 29, 31, 32, 34, 35, 36, 43, 44, 46, 47, 48, 49, 51, 52, 59, 60, 62, 65, 67, 68, 75, 76, 78, 79, 80, 81, 83, 84, 91, 92, 93, 95, 96, 98, 99, 100, 107, 108, 110, 111, 112, 113, 115, 116, 123, 124, 125, 126, 127, 128
Offset: 1

Views

Author

Antti Karttunen, Aug 17 2013

Keywords

Comments

In other words, numbers k such that A228085(A092391(k)) > 1.

Examples

			0 is not in this sequence because the sum 0+A000120(0)=0 cannot be obtained with any other value of k than k=0.
1 is not in this sequence because the sum 1+A000120(1)=2 cannot be obtained with any other value of k than k=1.
2 is not in this sequence because the sum 2+A000120(2)=3 cannot be obtained with any other value of k than k=2.
3 IS in this sequence because the sum 3+A000120(3)=5 can also be obtained with value k=4, as also 4+A000120(4)=5, and thus also 4 is in this sequence.
		

Crossrefs

Complement: A228090. Subsets: A228091, A228237. Cf. also A092391, A228085.

A228237 Numbers n for which there exists such a natural number k > n that k + bitcount(k) = n + bitcount(n), where bitcount(k) (A000120) gives the number of 1's in binary representation of nonnegative integer k.

Original entry on oeis.org

3, 11, 14, 15, 19, 27, 29, 31, 35, 43, 46, 47, 51, 59, 62, 67, 75, 78, 79, 83, 91, 93, 95, 99, 107, 110, 111, 115, 123, 124, 125, 126, 127, 131, 139, 142, 143, 147, 155, 157, 159, 163, 171, 174, 175, 179, 187, 190, 195, 203, 206, 207, 211, 219, 221, 223, 227
Offset: 1

Views

Author

Antti Karttunen, Sep 11 2013

Keywords

Comments

In other words, all such terms A228236(n) which satisfy A228236(n) < A228087(A092391(A228236(n))).
Note: 124 is the first term that occurs both here and in A228091.

Examples

			For cases 0 + A000120(0) = 0, 1 + A000120(1) = 2, 2 + A000120(2) = 3 there are no larger solutions yielding the same result.
However, for 3 + A000120(3) = 5 there is a larger solution yielding the same result, namely 4 + A000120(4) = 5, thus 3 is the first term of this sequence.
Next time this occurs for 11, as 11 + A000120(11) = 14 = 12 + A000120(12), and 12 > 11.
		

Crossrefs

Subset of A228236. Cf. also A228091.
Showing 1-5 of 5 results.