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

A349830 Intersection of A228082 and A349829.

Original entry on oeis.org

0, 2, 5, 7, 9, 10, 11, 12, 14, 16, 17, 19, 22, 24, 26, 27, 28, 29, 31, 33, 34, 36, 38, 40, 41, 43, 44, 45, 49, 50, 53, 55, 57, 58, 60, 61, 62, 65, 66, 67, 68, 69, 70, 72, 74, 75, 76, 77, 79, 81, 82, 84, 87, 89, 91, 92, 93, 94, 96, 98, 99, 101, 103, 105, 106, 108, 109, 110, 114, 115, 118, 120, 122, 123
Offset: 1

Views

Author

N. J. A. Sloane, Jan 07 2022

Keywords

Comments

Numbers that are "generated" (in Kaprekar's sense) in both bases 2 and 4.

Crossrefs

A230624 is a subsequence.

A349831 Even numbers in the intersection of A228082 and A349829.

Original entry on oeis.org

0, 2, 10, 12, 14, 16, 22, 24, 26, 28, 34, 36, 38, 40, 44, 50, 58, 60, 62, 66, 68, 70, 72, 74, 76, 82, 84, 92, 94, 96, 98, 106, 108, 110, 114, 118, 120, 122, 126, 132, 134, 136, 140, 146, 154, 156, 158, 162, 164, 170, 174, 176, 178, 186, 188, 190, 196, 198, 202, 204, 206, 210, 214, 216, 218, 222
Offset: 1

Views

Author

N. J. A. Sloane, Jan 07 2022

Keywords

Comments

Even numbers that are "generated" (in Kaprekar's sense) in both bases 2 and 4.

Crossrefs

A230624 is a subsequence.
A row of A350601.

A370729 a(n) is the number of distinct length-n blocks occurring in the characteristic sequence of A228082.

Original entry on oeis.org

1, 2, 3, 5, 8, 11, 17, 24, 35, 51, 71
Offset: 0

Views

Author

Jeffrey Shallit, Feb 28 2024

Keywords

Comments

The characteristic sequence is the sequence (b(n)) where b(n) = 1 if n occurs in A228082, and 0 otherwise. The number of distinct length-n blocks is also called the "factor complexity" or "subword complexity" of (b(n)).

Examples

			For n = 4, the only blocks that occur are {0101, 0110, 0111, 1010, 1011, 1101, 1110, 1111}, so a(4) = 8.
		

Crossrefs

Cf. A228082.

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

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]

A227643 a(0)=1; for n > 0, a(n) = 1 + Sum_{i=A228086(n)..A228087(n)} [A092391(i) = n]*a(i), where [] is the Iverson bracket, resulting in 1 when i + A000120(i) = n and 0 otherwise.

Original entry on oeis.org

1, 1, 2, 3, 1, 5, 1, 6, 2, 3, 7, 4, 8, 1, 13, 1, 2, 16, 1, 18, 2, 1, 21, 1, 2, 22, 3, 2, 23, 4, 1, 26, 1, 6, 2, 7, 29, 1, 37, 1, 2, 38, 3, 2, 39, 4, 1, 42, 1, 5, 3, 1, 48, 4, 1, 50, 1, 5, 2, 2, 51, 6, 3, 1, 54, 55, 7, 59, 8, 2, 68, 1, 3, 69, 4, 2, 70, 5, 1, 73, 1
Offset: 0

Views

Author

Andres M. Torres, Jul 18 2013

Keywords

Comments

Each a(n) = 1 + the count of nodes in the finite subtree defined by the edge relation parent = child + A000120(child). In other words, one more than the count of n's descendants, by which we mean the whole transitive closure of all children emanating from the parent at n. The subtree is finite because successive descendant values get smaller and approach zero.

Examples

			0 has no children distinct from itself (we only have A092391(0)=0), so we define a(0) = (0+1) = 1,
1 has no children (it is one of the terms of A010061), so a(1) = (0+1) = 1,
4 and 6 are also members of A010061, so both a(4) and a(6) = (0+1) = 1,
7 has 1,2,3,4 and 5 among its descendants (as A092391(5)=7, A092391(3)=A092391(4)=5, A092391(2)=3, A092391(1)=2), so a(7) = (5+1) = 6,
8 has 6 as a child value,        so a(8) = (1+1) = 2,
9 has 6 and 8 as descendants,    so a(9) = (2+1) = 3,
10 has {1,2,3,4,5,7}             so a(10) = (6+1) = 7.
		

Crossrefs

Cf. A010061 (gives the positions of ones), A000120, A092391, A228082, A228083, A228085, A227359, A227361, A227408.
Cf. also A213727 for a descendant counts for a similar tree defined by the edge relation parent = child - A000120(child).

Programs

  • Scheme
    ;; A deficient definition which works only up to n=128:
    (definec (A227643deficient n) (cond ((zero? n) 1) ((zero? (A228085 n)) 1) ((= 1 (A228085 n)) (+ 1 (A227643deficient (A228086 n)))) ((= 2 (A228085 n)) (+ 1 (A227643deficient (A228086 n)) (A227643deficient (A228087 n)))) (else (error "Not yet implemented for cases where n has more than two immediate children!"))))
    ;; Another definition that works for all n, but is somewhat slower:
    (definec (A227643full n) (cond ((zero? n) 1) (else (+ 1 (add (lambda (i) (if (= (A092391 i) n) (A227643full i) 0)) (A228086 n) (A228087 n))))))
    ;; Auxiliary function add implements sum_{i=lowlim..uplim} intfun(i)
    (define (add intfun lowlim uplim) (let sumloop ((i lowlim) (res 0)) (cond ((> i uplim) res) (else (sumloop (1+ i) (+ res (intfun i)))))))
    ;; by Antti Karttunen, Aug 16 2013, macro definec can be found in his IntSeq-library.

Formula

From Antti Karttunen, Aug 16 2013: (Start)
a(0)=1; and for n > 0, if A228085(n)=0 then a(n)=1; if A228085(n)=1 then a(n)=1+a(A228086(n)); if A228085(n)=2 then a(n)=1+a(A228086(n))+a(A228087(n)); otherwise (when A228085(n)>2) cannot be computed with this formula, which works only up to n=128.
a(0)=1; and for n > 0, a(n) = 1+Sum_{i=A228086(n)..A228087(n)} [A092391(i) = n]*a(i). (Here [...] denotes the Iverson bracket, resulting in 1 when i+A000120(i) = n and 0 otherwise. This formula works with all n.) (End)

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

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.
Showing 1-10 of 14 results. Next