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

A063787 a(2^k) = k + 1 and a(2^k + i) = 1 + a(i) for k >= 0 and 0 < i < 2^k.

Original entry on oeis.org

1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7, 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7, 3, 4, 4, 5, 4, 5, 5, 6, 4
Offset: 1

Views

Author

Reinhard Zumkeller, Aug 16 2001

Keywords

Comments

Hamming weights of odd numbers. - Friedjof Tellkamp, Jan 11 2024

Examples

			k = 3: a(2^3) = a(8) = 4 = 3 + 1.
k = 3, i = 5: a(2^3 + 5) = a(13) = 3 = 1 + 2 = 1 + a(5).
From _Omar E. Pol_, Jun 12 2009: (Start)
Triangle begins:
  1;
  2,2;
  3,2,3,3;
  4,2,3,3,4,3,4,4;
  5,2,3,3,4,3,4,4,5,3,4,4,5,4,5,5;
  6,2,3,3,4,3,4,4,5,3,4,4,5,4,5,5,6,3,4,4,5,4,5,5,6,4,5,5,6,5,6,6;
  7,2,3,3,4,3,4,4,5,3,4,4,5,4,5,5,6,3,4,4,5,4,5,5,6,4,5,5,6,5,6,6,7,3,4,4,5,...
(End)
		

Crossrefs

Cf. A330038 (partial sums).

Programs

  • Mathematica
    Table[DigitCount[2 n - 1, 2, 1], {n, 1, 105}] (* Friedjof Tellkamp, Jan 11 2024 *)
  • PARI
    a(n) = hammingweight(n-1) + 1; \\ Michel Marcus, Nov 23 2022
  • Python
    def a(n): return bin(n-1).count('1') + 1
    print([a(n) for n in range(1, 106)]) # Michael S. Branicky, Dec 16 2021
    

Formula

a(n) = A000120(n-1) + 1.
a(n) = log(A131136)/log(2). - Stephen Crowley, Aug 25 2008
a(n) = A007814(n) + A000120(n). - Gary W. Adamson, Jun 04 2009
a(n) = A000120(A086799(n)). - Reinhard Zumkeller, Jul 31 2010
a(n) = A000120(A047457(n)-1) = A000120(A047457(n)+1). - Ilya Lopatin, Mar 16 2014
a(n) = A000120(2n-1). - Friedjof Tellkamp, Jan 11 2024

A386971 Numbers k >= 1 such that w(k-r) + ... + w(k-1) = w(k+1) + ... + w(k+r) for some r >= 1 where w(i) is the binary weight of i (A000120).

Original entry on oeis.org

3, 4, 7, 8, 11, 12, 14, 15, 16, 17, 19, 20, 23, 24, 27, 28, 29, 31, 32, 34, 35, 36, 39, 40, 43, 44, 46, 47, 48, 49, 51, 52, 55, 56, 58, 59, 60, 63, 64, 67, 68, 69, 71, 72, 75, 76, 78, 79, 80, 81, 83, 84, 87, 88, 91, 92, 93, 95, 96, 98, 99, 100, 103, 104, 107
Offset: 1

Views

Author

Ctibor O. Zizka, Aug 11 2025

Keywords

Comments

r = 1 for k from A047457, k = 8*x - 5 or k = 8*x - 4, x >= 1.
r = 2 for k = 32*x - 18, (2* 7th row of A097586) or k = 32*x - 15, (10th row of A097586), x >= 1.

Examples

			For k = 7: A000120(4) + A000120(5) + A000120(6) = A000120(8) + A000120(9) + A000120(10), thus 7 is a term.
		

Crossrefs

Programs

  • Mathematica
    q[k_] := Module[{s = 0, r = 1}, While[r < k && (r == 1 || s != 0), s += (DigitSum[k-r, 2] - DigitSum[k+r, 2]); r++]; 1 < r <= k && s ==0]; Select[Range[120], q] (* Amiram Eldar, Aug 12 2025 *)

A322261 Square array T(n, k) (n >= 0, k >= 0) read by antidiagonals upwards: the lengths of runs in binary expansion of T(n, k) correspond to the lengths of runs in binary expansion of n followed by the lengths of runs in binary expansion of k.

Original entry on oeis.org

0, 1, 1, 2, 2, 2, 3, 5, 5, 3, 4, 6, 10, 4, 4, 5, 9, 13, 11, 11, 5, 6, 10, 18, 12, 20, 10, 6, 7, 13, 21, 19, 27, 21, 9, 7, 8, 14, 26, 20, 36, 26, 22, 8, 8, 9, 17, 29, 27, 43, 37, 25, 23, 23, 9, 10, 18, 34, 28, 52, 42, 38, 24, 40, 22, 10, 11, 21, 37, 35, 59, 53
Offset: 0

Views

Author

Rémy Sigrist, Dec 01 2018

Keywords

Comments

The array T is associative.

Examples

			Array T(n, k) begins (in decimal):
  n\k|  0   1   2   3   4   5   6   7    8    9   10   11   12
  ---+--------------------------------------------------------
    0|  0   1   2   3   4   5   6   7    8    9   10   11   12
    1|  1   2   5   4  11  10   9   8   23   22   21   20   19
    2|  2   5  10  11  20  21  22  23   40   41   42   43   44
    3|  3   6  13  12  27  26  25  24   55   54   53   52   51
    4|  4   9  18  19  36  37  38  39   72   73   74   75   76
    5|  5  10  21  20  43  42  41  40   87   86   85   84   83
    6|  6  13  26  27  52  53  54  55  104  105  106  107  108
    7|  7  14  29  28  59  58  57  56  119  118  117  116  115
    8|  8  17  34  35  68  69  70  71  136  137  138  139  140
Array T(n, k) begins (in binary):
  n\k |     0      1      10      11      100      101      110      111      1000
  ----+---------------------------------------------------------------------------
     0|     0      1      10      11      100      101      110      111      1000
     1|     1     10     101     100     1011     1010     1001     1000     10111
    10|    10    101    1010    1011    10100    10101    10110    10111    101000
    11|    11    110    1101    1100    11011    11010    11001    11000    110111
   100|   100   1001   10010   10011   100100   100101   100110   100111   1001000
   101|   101   1010   10101   10100   101011   101010   101001   101000   1010111
   110|   110   1101   11010   11011   110100   110101   110110   110111   1101000
   111|   111   1110   11101   11100   111011   111010   111001   111000   1110111
  1000|  1000  10001  100010  100011  1000100  1000101  1000110  1000111  10001000
		

Crossrefs

Programs

  • PARI
    torl(n) = my (r=[]); while (n, r = concat(valuation(n+(n%2),2), r); n \= 2^r[1];); r
    fromrl(r) = my (v=0); for (i=1, #r, v = (v + (i%2))*2^r[i]-(i%2)); v
    T(n,k) = fromrl(concat(torl(n), torl(k)))

Formula

T(n, 0) = T(0, n) = n.
T(n, 1) = A042963(n+1).
T(n, 2) = A047617(n+1).
T(n, 3) = A047457(n+1).
T(1, n) = A010078(n+1).
T(2, n) = A004757(n) for any n > 0.
A005811(T(n, k)) = A005811(n) + A005811(k).
T(2*n, k) = A163621(2*n, k) for any n > 0 and k > 0.
T(2*n, 2*n) = A020330(2*n) for any n > 0.

A372718 Triangular numbers that are 2 mod 4, halved.

Original entry on oeis.org

3, 5, 33, 39, 95, 105, 189, 203, 315, 333, 473, 495, 663, 689, 885, 915, 1139, 1173, 1425, 1463, 1743, 1785, 2093, 2139, 2475, 2525, 2889, 2943, 3335, 3393, 3813, 3875, 4323, 4389, 4865, 4935, 5439, 5513, 6045, 6123, 6683, 6765, 7353, 7439, 8055, 8145, 8789, 8883, 9555, 9653
Offset: 1

Views

Author

Tanya Khovanova and the PRIMES STEP senior group, May 11 2024

Keywords

Comments

The sum of the first 2*a(n) numbers of any Fibonacci-like sequence equals its (a(n)+2)-nd term times the a(n)-th Lucas number.

Examples

			10 is a triangular number that has a remainder of 2 when divided by 4. Therefore, its half, 5, is in this sequence. Moreover, the sum of the first 5*2 Fibonacci numbers is 143 (not counting zero). This sum is a product of 13, which is the (5+2 = 7)-th term of the Fibonacci sequence times 11, which is the fifth Lucas number.
		

Crossrefs

Programs

  • Mathematica
    Select[Table[n (n + 1)/2, {n, 200}], Mod[#, 4] == 2 &]/2

Formula

a(n) = A000217(A047457(n))/2 = A372070(n)/2.
Showing 1-4 of 4 results.