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 31-33 of 33 results.

A372325 Numbers whose binary expansion has an even number of 1's among positions listed in this sequence.

Original entry on oeis.org

0, 2, 5, 7, 8, 10, 13, 15, 16, 18, 21, 23, 24, 26, 29, 31, 33, 35, 36, 38, 41, 43, 44, 46, 49, 51, 52, 54, 57, 59, 60, 62, 64, 66, 69, 71, 72, 74, 77, 79, 80, 82, 85, 87, 88, 90, 93, 95, 97, 99, 100, 102, 105, 107, 108, 110, 113, 115, 116, 118, 121, 123, 124
Offset: 1

Views

Author

David A. Madore, Apr 27 2024

Keywords

Examples

			118 is in the sequence because 118 = 2^6 + 2^5 + 2^4 + 2^2 + 2^1, and an even number of the exponents 6,5,4,2,1 (namely 2,5) are in the sequence.
8192 is not in the sequence because 8192 = 2^13, and 13 is in the sequence.
		

Crossrefs

Programs

  • Maple
    R:= 0: RL:= [1]: nextp:= 2: m:= 1: count:= 0:
    for i from 1 while count < 100 do
      L:= convert(i,base,2);
      if i = nextp then
        nextp:= 2*nextp;
        if R[1+nops(RL)] = m then RL:= [op(RL),m+1] fi;
        m:= m+1;
      fi;
      if convert(L[RL],`+`)::even
      then R:= R,i; count:= count+1
      fi
    od:
    R; # Robert Israel, May 28 2024
  • Python
    from itertools import count, islice
    def agen():  # generator of terms
        aset = 0 # stored as a bitmask
        for k in count(0):
            if (k&aset).bit_count()%2 == 0:
                yield k
                aset += (1<Michael S. Branicky, Apr 28 2024

A348175 Irregular table T(n,k) read by rows: T(n,k) = T(n-1,k/2) when k is even and 3*T(n-1,(k-1)/2) + 2^(n-1) when k is odd. T(0,0) = 0 and 0 <= k <= 2^n-1.

Original entry on oeis.org

0, 0, 1, 0, 2, 1, 5, 0, 4, 2, 10, 1, 7, 5, 19, 0, 8, 4, 20, 2, 14, 10, 38, 1, 11, 7, 29, 5, 23, 19, 65, 0, 16, 8, 40, 4, 28, 20, 76, 2, 22, 14, 58, 10, 46, 38, 130, 1, 19, 11, 49, 7, 37, 29, 103, 5, 31, 23, 85, 19, 73, 65, 211
Offset: 0

Views

Author

Ryan Brooks, Oct 04 2021

Keywords

Examples

			n\k 0  1  2  3  4  5  6  7
0   0
1   0  1
2   0  2  1  5
3   0  4  2 10  1  7  5 19
		

Crossrefs

Cf. A001047 (right diagonal), A002697 (row sums), A119733.
Cf. A133457 (binary exponents).

Programs

  • Mathematica
    T[0, 0] = 0; T[n_, k_] := T[n, k] = If[EvenQ[k], T[n - 1, k/2], 3*T[n - 1, (k - 1)/2] + 2^(n - 1)]; Table[T[n, k], {n, 0, 5}, {k, 0, 2^n - 1}] // Flatten (* Amiram Eldar, Oct 11 2021 *)
  • PARI
    T(n, k) = if ((n==0) && (k==0), 0, if (k%2, 3*T(n-1,(k-1)/2) + 2^(n-1), T(n-1,k/2)));
    tabf(nn) = for (n=0, nn, for (k=0, 2^n-1, print1(T(n,k), ", ")); print); \\ Michel Marcus, Oct 18 2021
    
  • PARI
    T(n,k) = my(ret=0); for(i=0,n-1, if(bittest(k,n-1-i), ret=3*ret+1<Kevin Ryde, Oct 22 2021

Formula

T(n,k) = T(n-1,k/2) for k being even.
T(n,k) = 3*T(n-1,(k-1)/2) + 2^(n-1) for k being odd.
T(n,k) = 2*T(n-1,k) for 0 <= k <= 2^(n-1) - 1.
T(n,k) = Sum_{i=0..r} 2^(n-1-e[i]) * 3^i where binary expansion k = 2^e[0] + 2^e[1] + ... + 2^e[r] with ascending e[0] < e[1] < ... < e[r] (A133457). - Kevin Ryde, Oct 22 2021

A365396 Inverse permutation to A243571.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 8, 7, 9, 10, 13, 11, 14, 15, 21, 12, 16, 17, 22, 18, 23, 24, 34, 19, 25, 26, 35, 27, 36, 37, 55, 20, 28, 29, 38, 30, 39, 40, 56, 31, 41, 42, 57, 43, 58, 59, 89, 32, 44, 45, 60, 46, 61, 62, 90, 47, 63, 64, 91, 65, 92, 93, 144, 33, 48, 49, 66
Offset: 1

Views

Author

Alexander Khudyakov, Sep 03 2023

Keywords

Crossrefs

Programs

  • PARI
    a(n) = my(L = logint(n, 2), wt = hammingweight(n), A = L + wt, m = 0); fibonacci(A+1) + sum(i=1, L, binomial(i-1, A-i)) + sum(j=0, L-1, if(bittest(n, j), m++; binomial(j, m)))

Formula

a(n) = A000045(b(n) + 1) + Sum_{i=1..A000523(n)} binomial(i-1, b(n) - i) + Sum_{j=1..A000120(n) - 1} binomial(A133457(n, j), j) where b(n) = A056792(n).
Previous Showing 31-33 of 33 results.