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

A306740 Numbers k such that A306607(k) = 0.

Original entry on oeis.org

0, 3, 7, 9, 15, 31, 33, 45, 51, 63, 127, 129, 153, 165, 189, 195, 219, 231, 255, 411, 435, 511, 513, 561, 585, 633, 645, 693, 717, 765, 771, 819, 843, 891, 903, 951, 975, 1023, 2047, 2049, 2145, 2193, 2289, 2313, 2409, 2457, 2553, 2565, 2661, 2709, 2805, 2829, 2925, 2973, 3069, 3075, 3171, 3219
Offset: 1

Views

Author

Robert Israel, Mar 07 2019

Keywords

Comments

The first even terms are 0, 68690167808, 68690561024, 68690757632, 68691150848, 68698560512, 68698953728, 68699150336, 68699543552, 68715331584, 68715724800, 68715921408, 68716314624. - Robert Israel, Mar 10 2019

Crossrefs

Cf. A306607. Includes A048701.

Programs

  • Maple
    f:= proc(n) local L;
      L:= convert(n, base, 2);
      while nops(L) > 1 do
        L:= L[2..-1]-L[1..-2]
      od;
      op(L)
    end proc:
    select(f=0, [$0..10000]);
  • Mathematica
    seqQ[n_] := NestWhile[Differences, Reverse[IntegerDigits[n, 2]], Length[#]>1&] == {0}; Select[Range[0, 3000], seqQ] (* Amiram Eldar, Mar 08 2019 *)

A306754 The bottom entry in the difference table of the positions of the ones in the binary representation of n.

Original entry on oeis.org

0, 0, 1, 1, 2, 2, 1, 0, 3, 3, 2, 1, 1, -1, 0, 0, 4, 4, 3, 2, 2, 0, 1, 1, 1, -2, -1, -2, 0, 1, 0, 0, 5, 5, 4, 3, 3, 1, 2, 2, 2, -1, 0, -1, 1, 2, 1, 1, 1, -3, -2, -4, -1, -1, -2, -3, 0, 2, 1, 3, 0, -1, 0, 0, 6, 6, 5, 4, 4, 2, 3, 3, 3, 0, 1, 0, 2, 3, 2, 2, 2, -2
Offset: 0

Views

Author

Rémy Sigrist, Mar 08 2019

Keywords

Comments

By convention, a(0) = 0.
For any n > 0:
- let (b_1, b_2, ..., b_h) be the positions of the ones in the binary representation of n,
- h = A000120(n) and 0 <= b_1 < b_2 < ... < b_h,
- n = Sum_{k = 1..h} 2^b_k,
- a(n) is the unique value remaining after taking successively the first differences of (b_1, ..., b_h) h-1 times.

Examples

			For n = 59:
- the binary representation of 59 is "111011",
- so h = 5 and b_1 = 0, b_2 = 1, b_3 = 3, b_4 = 4, b_5 = 5,
- the corresponding difference table is:
        0   1   3   4   5
          1   2   1   1
            1  -1   0
             -2   1
                3
- hence a(59) = 3.
		

Crossrefs

See A306607 for a similar sequence.

Programs

  • PARI
    a(n) = { my (h=hammingweight(n), o=0, v=0); forstep (k=h-1, 0, -1, my (w=valuation(n, 2)); o += w; v += (-1)^k * binomial(h-1, k) * o; o++; n\=2^(1+w)); v };

Formula

a(2^k) = k for any k >= 0.
a(2^k-1) = [k=2].
a(2*n) = a(n) + A209229(n).

A309776 Form a triangle: first row is n in base 2, next row is sums of pairs of adjacent digits of previous row, repeat until get a single number which is a(n).

Original entry on oeis.org

0, 1, 1, 2, 1, 2, 3, 4, 1, 2, 4, 5, 4, 5, 7, 8, 1, 2, 5, 6, 7, 8, 11, 12, 5, 6, 9, 10, 11, 12, 15, 16, 1, 2, 6, 7, 11, 12, 16, 17, 11, 12, 16, 17, 21, 22, 26, 27, 6, 7, 11, 12, 16, 17, 21, 22, 16, 17, 21, 22, 26, 27, 31, 32, 1, 2, 7, 8, 16, 17, 22, 23, 21, 22
Offset: 0

Views

Author

Cameron Musard, Aug 16 2019

Keywords

Comments

a(n) = 1 occurs at n = 2^k for nonnegative integers k.

Examples

			For n=5 the triangle is
  1 0 1
   1 1
    2
so a(5)=2.
For n=14 we get
  1 1 1 0
   2 2 1
    4 3
     7
so a(14)=7.
For n=26=11010_2; (n1+n2, n2+n3, n3+n4, n4+n5) = 2111; (n1'+n2', n2'+n3', n3'+n4') = 322; (n1''+n2'', n2''+n3'') = 54; (n1'''+n2''') = 9; a(26)= 9.
		

Crossrefs

Cf. A306607.

Programs

  • PARI
    a(n) = my (b=binary(n)); sum(k=1, #b, b[k]*binomial(#b-1,k-1)) \\ Rémy Sigrist, Aug 20 2019

Formula

From Bernard Schott, Sep 22 2019: (Start)
a(2^k + 1) = 2 for k >= 1 where 2^k+1 = 1000..0001_2.
a(2^k - 1) = 2^(k-1) for k >= 2 where 2^k-1 = 111..111_2.
a((4^k-1)/3) = 2^(2*k-3) for k >= 2 where (4^k-1)/3 = 10101..0101_2.
(End)

Extensions

Edited by N. J. A. Sloane, Sep 21 2019
Data corrected by Rémy Sigrist, Sep 22 2019
Showing 1-3 of 3 results.