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.

Previous Showing 11-20 of 38 results. Next

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

A233272 a(n) = n + 1 + number of nonleading zeros in binary representation of n (A080791).

Original entry on oeis.org

1, 2, 4, 4, 7, 7, 8, 8, 12, 12, 13, 13, 15, 15, 16, 16, 21, 21, 22, 22, 24, 24, 25, 25, 28, 28, 29, 29, 31, 31, 32, 32, 38, 38, 39, 39, 41, 41, 42, 42, 45, 45, 46, 46, 48, 48, 49, 49, 53, 53, 54, 54, 56, 56, 57, 57, 60, 60, 61, 61, 63, 63, 64, 64, 71, 71, 72
Offset: 0

Views

Author

Antti Karttunen, Dec 12 2013

Keywords

Comments

From Antti Karttunen, Jan 30 2022: (Start)
Write n in binary: 1ab..xyz, then a(n) = (1+1ab..xy) + (1+1ab..x) + ... + (1+1ab) + (1+1a) + (1+1) + (1+0) + 1. This method was found by LODA miner, see the assembly program at C. Krause link.
Proof: Compare to a similar formula given for A011371, with a(n) = a(floor(n/2)) + floor(n/2) to the new formula for this sequence which is a(n) = 1 + a(floor(n/2)) + floor(n/2), for n > 0 and a(0) = 1. It is easy to see that the difference between these, a(n) - A011371(n) = 1+A070939(n), for n > 0. As A011371(n) = n minus (number of 1's in binary expansion of n), then a(n) = 1 + (number of digits in binary expansion of n) + (n minus number of 1's in binary expansion of n) = 1 + n + (number of nonleading 0's in binary expansion of n), which indeed is the definition of this sequence.
(End)

Crossrefs

Programs

  • Mathematica
    DigitCount[#, 2, 0] + # + 1 & [Range[0, 100]] (* Paolo Xausa, Mar 01 2024 *)
  • PARI
    A233272(n) = { my(s=1); while(n, n>>=1; s+=(1+n)); (s); }; \\ (After a LODA-assembly program found by a miner) - Antti Karttunen, Jan 30 2022
    
  • Scheme
    (define (A233272 n) (+ 1 n (A080791 n)))
    ;; Alternatively:
    (define (A233272 n) (if (zero? n) 1 (+ n (A000120 (A054429 n)))))

Formula

a(n) = n + A080791(n) + 1.
For all n>=1, a(n) = n + A000120(A054429(n)).
a(0) = 1; for n > 1, a(n) = 1 + floor(n/2) + a(floor(n/2)). - (Found by LODA miner, see comments) - Antti Karttunen, Jan 30 2022

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

A243441 Primes p such that p + A000120(p) is also a prime, where A000120 = sum of digits in base 2 = Hamming weight.

Original entry on oeis.org

2, 3, 5, 17, 43, 163, 277, 311, 347, 373, 461, 479, 571, 643, 673, 821, 853, 857, 881, 977, 983, 1013, 1093, 1103, 1117, 1181, 1223, 1297, 1427, 1433, 1439, 1481, 1523, 1607, 1613, 1621, 1823, 1861, 1871, 1873, 2003, 2083, 2281, 2333, 2393, 2417, 2467, 2549
Offset: 1

Views

Author

Anthony Sand, Jun 05 2014

Keywords

Examples

			2 + digitsum(2,base=2) = 2 + digitsum(10) = 2 + 1 = 3, which is prime.
3 + digitsum(11) = 3 + 2 = 5.
5 + digitsum(101) = 5 + 2 = 7.
17 + digitsum(10001) = 17 + 2 = 19.
43 + digitsum(101011) = 43 + 4 = 47.
		

Crossrefs

Cf. A000120, A092391 (n + A000120(n)), A048519 (analog for base 10).
Cf. A243442 (analog for p - A000120(p)).

Programs

  • Mathematica
    Select[Prime@ Range@ 400, PrimeQ[# + Total@ IntegerDigits[#, 2]] &] (* Michael De Vlieger, Nov 06 2018 *)
  • PARI
    lista(lim) = forprime(p=2,lim, if (isprime(p+hammingweight(p)), print1(p, ", "))); \\ Michel Marcus, Jun 10 2014

Extensions

Name edited by M. F. Hasler, Nov 07 2018

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

A230058 Numbers of the form k + wt(k) for at least 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, 129, 131, 132, 134, 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
Offset: 1

Views

Author

Matthew C. Russell, Oct 07 2013

Keywords

Comments

The positions of entries greater than 1 in A228085, or numbers that appear multiple times in A092391.
Numbers that can be expressed as the sum of distinct terms of the form 2^n+1, n=0,1,... in multiple ways.

Examples

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

Crossrefs

Programs

  • Mathematica
    Sort[Transpose[Select[Tally[Table[k + Total[IntegerDigits[k, 2]], {k, 0, 300}]], #[[2]] > 1 &]][[1]]] (* T. D. Noe, Oct 09 2013 *)

A228091 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

4, 12, 16, 17, 20, 28, 32, 34, 36, 44, 48, 49, 52, 60, 65, 68, 76, 80, 81, 84, 92, 96, 98, 100, 108, 112, 113, 116, 124, 128, 129, 130, 131, 132, 140, 144, 145, 148, 156, 160, 162, 164, 172, 176, 177, 180, 188, 193, 196, 204, 208, 209, 212, 220, 224, 226, 228
Offset: 1

Views

Author

Antti Karttunen, Aug 09 2013

Keywords

Comments

In other words, all such terms A228236(n) which satisfy A228236(n) > A228086(A092391(A228236(n))), which means that the sequence contains all natural numbers n such that A228085(A092391(n)) > 1 and n > A228086(A092391(n)).
Note: 124 is the first term that occurs both here and in A228237.

Examples

			For cases 0 + A000120(0) = 0, 1 + A000120(1) = 2, 2 + A000120(2) = 3, 3 + A000120(3) = 5 there are no smaller solutions yielding the same result.
However, for 4 + A000120(4) = 5, we already saw the case 3+A000120(3) giving the same result, thus 4 is the first term of this sequence.
Next time this occurs for 12, as 12 + A000120(12) = 14 = 11 + A000120(11), and 11 < 12.
		

Crossrefs

Subset of A228236. Cf. also A228237. Complement of this sequence gives the nonzero terms of A228086 in ascending order.

A242403 Decimal expansion of the binary self-numbers density constant.

Original entry on oeis.org

2, 5, 2, 6, 6, 0, 2, 5, 9, 0, 0, 8, 8, 8, 2, 9, 2, 2, 1, 5, 5, 0, 6, 2, 7, 1, 4, 3, 2, 7, 8, 9, 4, 1, 4, 1, 8, 2, 5, 2, 1, 9, 3, 3, 9, 6, 2, 9, 7, 8, 4, 6, 1, 3, 0, 1, 6, 8, 6, 2, 1, 7, 2, 2, 9, 2, 2, 8, 0, 5, 4, 8, 4, 4, 7, 6, 6, 3, 2, 5, 6, 6, 9, 5, 9, 1, 4, 2, 4, 4, 7, 9, 3, 8, 6, 8, 8, 9, 4, 9
Offset: 0

Views

Author

Jean-François Alcover, May 13 2014

Keywords

Comments

This constant is transcendental (Troi and Zannier, 1999). - Amiram Eldar, Nov 28 2020

Examples

			0.2526602590088829221550627143278941418252...
		

References

  • Steven R. Finch, Mathematical Constants, Cambridge University Press, 2003, p. 179.
  • 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, Bollettino dell'Unione Matematica Italiana, Serie 7, Vol. 9-A, No. 1 (1995), pp. 143-148.

Crossrefs

Cf. A010061 (binary self numbers), A003052 (decimal self numbers), A010064, A010067, A010070, A092391, A228082.

Programs

  • Mathematica
    m0 = 100; dm = 100; digits = 100; Clear[lambda]; lambda[m_] := lambda[m] = Total[1/2^Union[Table[n + Total[IntegerDigits[n, 2]], {n, 0, m}]]]^2/8 // N[#, 2*digits]& // RealDigits[#, 10, 2*digits]& // First; lambda[m0]; lambda[m = m0 + dm]; While[lambda[m] != lambda[m - dm], Print["m = ", m]; m = m + dm]; lambda[m][[1 ;; digits]]

Formula

Equals (1/8)*(Sum_{n not a binary self-number} 1/2^n)^2.
Previous Showing 11-20 of 38 results. Next