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

A352909 Pairs (i,j) of nonnegative integers with disjoint binary expansions sorted first by i+j then by i.

Original entry on oeis.org

0, 0, 0, 1, 1, 0, 0, 2, 2, 0, 0, 3, 1, 2, 2, 1, 3, 0, 0, 4, 4, 0, 0, 5, 1, 4, 4, 1, 5, 0, 0, 6, 2, 4, 4, 2, 6, 0, 0, 7, 1, 6, 2, 5, 3, 4, 4, 3, 5, 2, 6, 1, 7, 0, 0, 8, 8, 0, 0, 9, 1, 8, 8, 1, 9, 0, 0, 10, 2, 8, 8, 2, 10, 0, 0, 11, 1, 10, 2, 9, 3, 8, 8, 3, 9, 2, 10, 1, 11, 0, 0, 12, 4, 8, 8, 4, 12, 0, 0, 13, 1, 12, 4, 9, 5, 8, 8, 5, 9, 4, 12, 1, 13, 0
Offset: 1

Views

Author

N. J. A. Sloane, Apr 09 2022

Keywords

Comments

Pairs (i,j) with AND(i,j) = 0.
Allan C. Wechsler points out that when these points are plotted on a two-dimensional grid they form a rotated version of the Sierpinski Gasket (A047999).

Examples

			The first few pairs are [0, 0], [0, 1], [1, 0], [0, 2], [2, 0], [0, 3], [1, 2], [2, 1], [3, 0], [0, 4], [4, 0], [0, 5], [1, 4], [4, 1], [5, 0], [0, 6], [2, 4], [4, 2], [6, 0], [0, 7], [1, 6], [2, 5], [3, 4], [4, 3], [5, 2], [6, 1], [7, 0], ...
		

Crossrefs

Cf. A047999, A295989 (i values), A352910 (j values).

Programs

  • Maple
    with(Bits);
    M:=16; Nlis:=[];
    for s from 0 to M do for i from 0 to s do j:=s-i;
    if And(i,j)=0 then Nlis:=[op(Nlis),[i,j]]; fi;
    od: od:
    Nlis;
  • Mathematica
    A352909list[ij_] := Select[Array[{#, ij-#} &, ij+1, 0], BitAnd @@ # == 0 &];
    Flatten[Array[A352909list, 15, 0]] (* Paolo Xausa, Feb 24 2024 *)

A353174 Irregular table T(n, k), n >= 0, k = 0..A352502(n)-1; the n-th row lists in ascending order the numbers k in 0..n such that k and n-k can be added without carries in balanced ternary.

Original entry on oeis.org

0, 0, 1, 0, 2, 0, 1, 2, 3, 0, 1, 3, 4, 0, 5, 0, 1, 5, 6, 0, 1, 6, 7, 0, 2, 3, 5, 6, 8, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 3, 4, 6, 7, 9, 10, 0, 2, 3, 8, 9, 11, 0, 1, 2, 3, 4, 8, 9, 10, 11, 12, 0, 1, 3, 4, 9, 10, 12, 13, 0, 14, 0, 1, 14, 15, 0, 1, 15, 16, 0, 2, 3, 14, 15, 17
Offset: 0

Views

Author

Rémy Sigrist, Apr 28 2022

Keywords

Comments

Two integers can be added without carries in balanced ternary if they have no equal nonzero digit at the same position.
This sequence has connections with A295989; here we work with balanced ternary, there with binary.
The set of points {(n, T(n, k))} has interesting fractal features, with voids in the form of Koch snowflakes (see illustration in Links section).

Examples

			Irregular table T(n, k) begins:
    0: [0]
    1: [0, 1]
    2: [0, 2]
    3: [0, 1, 2, 3]
    4: [0, 1, 3, 4]
    5: [0, 5]
    6: [0, 1, 5, 6]
    7: [0, 1, 6, 7]
    8: [0, 2, 3, 5, 6, 8]
    9: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
		

Crossrefs

Programs

  • PARI
    ok(u,v) = { while (u && v, my (uu=[0,+1,-1][1+u%3], vv=[0,+1,-1][1+v%3]); if (abs(uu+vv)>1, return (0)); u=(u-uu)/3; v=(v-vv)/3); return (1) }
    row(n) = select(k -> ok(n-k, k), [0..n])

Formula

T(n, 0) = 0.
T(n, A352502(n)-1) = n.

Extensions

Index correction from Rémy Sigrist, Jan 18 2025

A374354 Irregular table T(n, k), n >= 0, 0 <= k < A277561(n), read by rows; the n-th row lists the fibbinary numbers f <= n such that n - f is also a fibbinary number whose binary expansion has no common 1's with that of f (where fibbinary numbers correspond to A003714).

Original entry on oeis.org

0, 0, 1, 0, 2, 1, 2, 0, 4, 0, 1, 4, 5, 2, 4, 2, 5, 0, 8, 0, 1, 8, 9, 0, 2, 8, 10, 1, 2, 9, 10, 4, 8, 4, 5, 8, 9, 4, 10, 5, 10, 0, 16, 0, 1, 16, 17, 0, 2, 16, 18, 1, 2, 17, 18, 0, 4, 16, 20, 0, 1, 4, 5, 16, 17, 20, 21, 2, 4, 18, 20, 2, 5, 18, 21, 8, 16, 8, 9, 16, 17
Offset: 0

Views

Author

Rémy Sigrist, Jul 06 2024

Keywords

Comments

In other words, we partition n into pairs of fibbinary numbers whose binary expansions have no common 1's and list the corresponding fibbinary numbers to get the n-th row.

Examples

			Triangle T(n, k) begins:
  n   n-th row
  --  -----------
   0  0
   1  0, 1
   2  0, 2
   3  1, 2
   4  0, 4
   5  0, 1, 4, 5
   6  2, 4
   7  2, 5
   8  0, 8
   9  0, 1, 8, 9
  10  0, 2, 8, 10
  11  1, 2, 9, 10
  12  4, 8
  13  4, 5, 8, 9
  14  4, 10
  15  5, 10
  16  0, 16
		

Crossrefs

See A295989 and A374361 for similar sequences.

Programs

  • PARI
    row(n) = { my (r = [0], e, x, y, b); while (n, x = y = 0; e = valuation(n, 2); for (k = 0, oo, if (bittest(n, e+k), n -= b = 2^(e+k); [x, y] = [y + b, x], r = concat([v + y | v <- r], [v + x | v <- r]); break;););); return (r); }

Formula

T(n, 0) = 0 iff n is a fibbinary number.
T(n, k) + T(n, A277561(n)-1-k) = n.
T(n, 0) = A374355(n).
T(n, A277561(n)-1) = A374356(n).
Sum_{k = 0..A277561(n)-1} T(n, k) = n * 2^A037800(n).

A380123 Irregular table T(n, k), n >= 0, k = 1..A380122(n), read by rows; the n-th row lists the integers m (possibly negative) such that the nonzero digits in the nonadjacent form for m appear in the nonadjacent form for n.

Original entry on oeis.org

0, 0, 1, 0, 2, -1, 0, 3, 4, 0, 4, 0, 1, 4, 5, -2, 0, 6, 8, -1, 0, 7, 8, 0, 8, 0, 1, 8, 9, 0, 2, 8, 10, -5, -4, -1, 0, 11, 12, 15, 16, -4, 0, 12, 16, -4, -3, 0, 1, 12, 13, 16, 17, -2, 0, 14, 16, -1, 0, 15, 16, 0, 16, 0, 1, 16, 17, 0, 2, 16, 18, -1, 0, 3, 4, 15, 16, 19, 20
Offset: 0

Views

Author

Rémy Sigrist, Jan 12 2025

Keywords

Examples

			Irregular table T(n, k) begins:
  n   n-th row
  --  -----------------------------
   0  0
   1  0, 1
   2  0, 2
   3  -1, 0, 3, 4
   4  0, 4
   5  0, 1, 4, 5
   6  -2, 0, 6, 8
   7  -1, 0, 7, 8
   8  0, 8
   9  0, 1, 8, 9
  10  0, 2, 8, 10
  11  -5, -4, -1, 0, 11, 12, 15, 16
  12  -4, 0, 12, 16
  13  -4, -3, 0, 1, 12, 13, 16, 17
  14  -2, 0, 14, 16
  15  -1, 0, 15, 16
  16  0, 16
.
Irregular table T(n, k) begins in nonadjacent form:
  n      n-th row
  -----  ------------------------------------------
      0  0
      1  0, 1
     10  0, 10
    10T  T, 0, 10T, 100
    100  0, 100
    101  0, 1, 100, 101
   10T0  T0, 0, 10T0, 1000
   100T  T, 0, 100T, 1000
   1000  0, 1000
   1001  0, 1, 1000, 1001
   1010  0, 10, 1000, 1010
  10T0T  T0T, T00, T, 0, 10T0T, 10T00, 1000T, 10000
  10T00  T00, 0, 10T00, 10000
		

Crossrefs

See A295989 for a similar sequence.

Programs

  • PARI
    row(n) = { my (r = [0], d, b = 1); while (n, if (n % 2, n -= d = 2 - (n%4); r = concat(r, [v + d*b | v <- r]);); n /= 2; b *= 2;); vecsort(r); }

Formula

T(n, 1) = A184616(n).
T(n, A380122(n)) = n.

A347204 a(n) = a(f(n)/2) + a(floor((n+f(n))/2)) for n > 0 with a(0) = 1 where f(n) = A129760(n).

Original entry on oeis.org

1, 2, 3, 5, 4, 7, 10, 15, 5, 9, 13, 20, 17, 27, 37, 52, 6, 11, 16, 25, 21, 34, 47, 67, 26, 43, 60, 87, 77, 114, 151, 203, 7, 13, 19, 30, 25, 41, 57, 82, 31, 52, 73, 107, 94, 141, 188, 255, 37, 63, 89, 132, 115, 175, 235, 322, 141, 218, 295, 409, 372, 523, 674
Offset: 0

Views

Author

Mikhail Kurkov, Aug 23 2021 [verification needed]

Keywords

Comments

Modulo 2 binomial transform of A243499(n).

Crossrefs

Programs

  • MATLAB
    function a = A347204(max_n)
        a(1) = 1;
        a(2) = 2;
        for nloop = 3:max_n
            n = nloop-1;
            s = 0;
            for k = 0:floor(log2(n))-1
                s = s + a(1+A053645(n)-2^k*(mod(floor(n/(2^k)),2)));
            end
            a(nloop) = 2*a(A053645(n)+1) + s;
        end
    end
    function a_n = A053645(n)
        a_n = n - 2^floor(log2(n));
    end % Thomas Scheuerle, Oct 25 2021
  • Mathematica
    f[n_] := BitAnd[n, n - 1]; a[0] = 1; a[n_] := a[n] = a[f[n]/2] + a[Floor[(n + f[n])/2]]; Array[a, 100, 0] (* Amiram Eldar, Nov 19 2021 *)
  • PARI
    f(n) = bitand(n, n-1); \\ A129760
    a(n) = if (n<=1, n+1, if (n%2, a(n\2)+a(n-1), a(f(n/2)) + a(n/2+f(n/2)))); \\ Michel Marcus, Oct 25 2021
    
  • PARI
    \\ Also see links.
    
  • PARI
    A129760(n) = bitand(n, n-1);
    memoA347204 = Map();
    A347204(n) = if (n<=1, n+1, my(v); if(mapisdefined(memoA347204,n,&v), v, v = if(n%2, A347204(n\2)+A347204(n-1), A347204(A129760(n/2)) + A347204(n/2+A129760(n/2))); mapput(memoA347204,n,v); (v))); \\ (Memoized version of Michel Marcus's program given above) - Antti Karttunen, Nov 20 2021
    

Formula

a(n) = a(n - 2^f(n)) + (1 + f(n))*a((n - 2^f(n))/2) for n > 0 with a(0) = 1 where f(n) = A007814(n).
a(2n+1) = a(n) + a(2n) for n >= 0.
a(2n) = a(n - 2^f(n)) + a(2n - 2^f(n)) for n > 0 with a(0) = 1 where f(n) = A007814(n).
a(n) = 2*a(f(n)) + Sum_{k=0..floor(log_2(n))-1} a(f(n) - 2^k*T(n,k)) for n > 1 with a(0) = 1, a(1) = 2, and where f(n) = A053645(n), T(n,k) = floor(n/2^k) mod 2.
Sum_{k=0..2^n - 1} a(k) = A035009(n+1) for n >= 0.
a((4^n - 1)/3) = A002720(n) for n >= 0.
a(2^n - 1) = A000110(n+1),
a(2*(2^n - 1)) = A005493(n),
a(2^2*(2^n - 1)) = A005494(n),
a(2^3*(2^n - 1)) = A045379(n),
a(2^4*(2^n - 1)) = A196834(n),
a(2^m*(2^n-1)) = T(n,m+1) is the n-th (m+1)-Bell number for n >= 0, m >= 0 where T(n,m) = m*T(n-1,m) + Sum_{k=0..n-1} binomial(n-1,k)*T(k,m) with T(0,m) = 1.
a(n) = Sum_{j=0..2^A000120(n)-1} A243499(A295989(n,j)) for n >= 0. Also A243499(n) = Sum_{j=0..2^f(n)-1} (-1)^(f(n)-f(j)) a(A295989(n,j)) for n >= 0 where f(n) = A000120(n). In other words, a(n) = Sum_{j=0..n} (binomial(n,j) mod 2)*A243499(j) and A243499(n) = Sum_{j=0..n} (-1)^(f(n)-f(j))*(binomial(n,j) mod 2)*a(j) for n >= 0 where f(n) = A000120(n).
Generalization:
b(n, x) = (1/x)*b((n - 2^f(n))/2, x) + (-1)^n*b(floor((2n - 2^f(n))/2), x) for n > 0 with b(0, x) = 1 where f(n) = A007814(n).
Sum_{k=0..2^n - 1} b(k, x) = (1/x)^n for n >= 0.
b((4^n - 1)/3, x) = (1/x)^n*n!*L_{n}(x) for n >= 0 where L_{n}(x) is the n-th Laguerre polynomial.
b((8^n - 1)/7, x) = (1/x)^n*Sum_{k=0..n} (-x)^k*A265649(n, k) for n >= 0.
b(2^n - 1, x) = (1/x)^n*Sum_{k=0..n} (-x)^k*A008277(n+1, k+1),
b(2*(2^n - 1), x) = (1/x)^n*Sum_{k=0..n} (-x)^k*A143494(n+2, k+2),
b(2^2*(2^n - 1), x) = (1/x)^n*Sum_{k=0..n} (-x)^k*A143495(n+3, k+3),
b(2^m*(2^n - 1), x) = (1/x)^n*Sum_{k=0..n} (-x)^k*T(n+m+1, k+m+1, m+1) for n >= 0, m >= 0 where T(n,k,m) is m-Stirling numbers of the second kind.

A361755 Irregular triangle T(n, k), n >= 0, k = 1..2^A007895(n), read by rows; the n-th row lists the numbers k such that the Fibonacci numbers that appear in the Zeckendorf representation of k also appear in that of n.

Original entry on oeis.org

0, 0, 1, 0, 2, 0, 3, 0, 1, 3, 4, 0, 5, 0, 1, 5, 6, 0, 2, 5, 7, 0, 8, 0, 1, 8, 9, 0, 2, 8, 10, 0, 3, 8, 11, 0, 1, 3, 4, 8, 9, 11, 12, 0, 13, 0, 1, 13, 14, 0, 2, 13, 15, 0, 3, 13, 16, 0, 1, 3, 4, 13, 14, 16, 17, 0, 5, 13, 18, 0, 1, 5, 6, 13, 14, 18, 19, 0, 2, 5, 7, 13, 15, 18, 20
Offset: 0

Views

Author

Rémy Sigrist, Mar 23 2023

Keywords

Comments

In other words, the n-th row lists the numbers k such that A003714(n) AND A003714(k) = A003714(k) (where AND denotes the bitwise AND operator).
The Zeckendorf representation is also known as the greedy Fibonacci representation (see A356771 for further details).

Examples

			Triangle T(n, k) begins:
  n   n-th row
  --  ------------------------
   0  0
   1  0, 1
   2  0, 2
   3  0, 3
   4  0, 1, 3, 4
   5  0, 5
   6  0, 1, 5, 6
   7  0, 2, 5, 7
   8  0, 8
   9  0, 1, 8, 9
  10  0, 2, 8, 10
  11  0, 3, 8, 11
  12  0, 1, 3, 4, 8, 9, 11, 12
		

Crossrefs

See A361756 for a similar sequence.

Programs

  • PARI
    See Links section.

Formula

T(n, 1) = 0.
T(n, 2) = A139764(n) for any n > 0.
T(n, 2^A007895(n)) = n.

A331533 Irregular table read by rows; for n >= 0, the n-th row corresponds to the nonnegative integers k such that (n^2) AND (k^2) = k^2, in ascending order (where AND denotes the bitwise AND operator).

Original entry on oeis.org

0, 0, 1, 0, 2, 0, 1, 3, 0, 4, 0, 1, 3, 4, 5, 0, 2, 6, 0, 1, 4, 7, 0, 8, 0, 1, 4, 8, 9, 0, 2, 6, 8, 10, 0, 1, 3, 4, 5, 7, 8, 9, 11, 0, 4, 12, 0, 1, 3, 13, 0, 2, 8, 14, 0, 1, 8, 15, 0, 16, 0, 1, 16, 17, 0, 2, 8, 16, 18, 0, 1, 3, 8, 16, 17, 19, 0, 4, 12, 16, 20
Offset: 0

Views

Author

Rémy Sigrist, Jan 19 2020

Keywords

Comments

The n-th row has A331532(n) terms, leading term 0 and last term n.

Examples

			Table begins:
    0;
    0, 1;
    0, 2;
    0, 1, 3;
    0, 4;
    0, 1, 3, 4, 5;
    0, 2, 6;
    0, 1, 4, 7;
    0, 8;
    ...
		

Crossrefs

Cf. A295989, A331532 (row lengths).

Programs

  • PARI
    row(n) = select(k -> bitand(n^2, k^2)==k^2, [0..n])

A343757 Irregular table read by rows; the n-th row contains the sums of distinct terms of the n-th row of table A343835, in ascending order.

Original entry on oeis.org

0, 0, 1, 0, 2, 0, 3, 0, 4, 0, 1, 4, 5, 0, 6, 0, 7, 0, 8, 0, 1, 8, 9, 0, 2, 8, 10, 0, 3, 8, 11, 0, 12, 0, 1, 12, 13, 0, 14, 0, 15, 0, 16, 0, 1, 16, 17, 0, 2, 16, 18, 0, 3, 16, 19, 0, 4, 16, 20, 0, 1, 4, 5, 16, 17, 20, 21, 0, 6, 16, 22, 0, 7, 16, 23, 0, 24
Offset: 0

Views

Author

Rémy Sigrist, May 01 2021

Keywords

Comments

In other words, the n-th row contains the numbers k whose runs of 1's in the binary expansion also appear in that of n.
The n-th row has 2^A069010(n) terms.
This sequence has similarities with A295989.

Examples

			Table begins:
     0:    [0]
     1:    [0, 1]
     2:    [0, 2]
     3:    [0, 3]
     4:    [0, 4]
     5:    [0, 1, 4, 5]
     6:    [0, 6]
     7:    [0, 7]
     8:    [0, 8]
     9:    [0, 1, 8, 9]
    10:    [0, 2, 8, 10]
    11:    [0, 3, 8, 11]
    12:    [0, 12]
    13:    [0, 1, 12, 13]
    14:    [0, 14]
    15:    [0, 15]
Table begins in binary:
       0:   [0]
       1:   [0, 1]
      10:   [0, 10]
      11:   [0, 11]
     100:   [0, 100]
     101:   [0, 1, 100, 101]
     110:   [0, 110]
     111:   [0, 111]
    1000:   [0, 1000]
    1001:   [0, 1, 1000, 1001]
    1010:   [0, 10, 1000, 1010]
    1011:   [0, 11, 1000, 1011]
    1100:   [0, 1100]
    1101:   [0, 1, 1100, 1101]
    1110:   [0, 1110]
    1111:   [0, 1111]
		

Crossrefs

Programs

  • PARI
    row(n) = { my (rr=[]); while (n, my (z=valuation(n, 2), o=valuation(n/2^z+1, 2), r=(2^o-1)*2^z); n-=r; rr = concat(rr, r)); vector(2^#rr, k, vecsum(vecextract(rr, k-1))) }

Formula

T(n, 0) = 0.
T(n, 1) = A342410(n) for any n > 0.
T(n, 2^A069010(n)-1) = n.

A352910 The j-values of pairs (i,j) listed in A352909.

Original entry on oeis.org

0, 1, 0, 2, 0, 3, 2, 1, 0, 4, 0, 5, 4, 1, 0, 6, 4, 2, 0, 7, 6, 5, 4, 3, 2, 1, 0, 8, 0, 9, 8, 1, 0, 10, 8, 2, 0, 11, 10, 9, 8, 3, 2, 1, 0, 12, 8, 4, 0, 13, 12, 9, 8, 5, 4, 1, 0, 14, 12, 10, 8, 6, 4, 2, 0, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, 16, 0
Offset: 1

Views

Author

N. J. A. Sloane, Apr 09 2022

Keywords

Comments

See A295989 for the i-values.

Crossrefs

Programs

  • Mathematica
    A352910list[ij_] := Select[Range[ij, 0, -1], BitAnd[#, ij-#] == 0 &];
    Flatten[Array[A352910list, 25, 0]] (* Paolo Xausa, Feb 24 2024 *)

A370727 Lexicographically earliest sequence of distinct positive integers such that for any n > 0, prime(n) AND a(n) = a(n) (where prime(n) denotes the n-th prime number and AND denotes the bitwise AND operator).

Original entry on oeis.org

2, 1, 4, 3, 8, 5, 16, 17, 6, 9, 7, 32, 33, 10, 11, 20, 18, 12, 64, 65, 72, 13, 19, 24, 96, 36, 34, 35, 37, 48, 14, 128, 129, 130, 21, 22, 25, 131, 38, 40, 49, 52, 15, 192, 68, 66, 67, 23, 97, 69, 41, 39, 80, 26, 256, 257, 260, 258, 261, 264, 27, 288, 50, 51
Offset: 1

Views

Author

Rémy Sigrist, Feb 28 2024

Keywords

Comments

In other words, the 1's in the binary expansion of the n-th term also appear in that of the n-th prime number.
This sequence is a permutation of the positive integers with inverse A370727: for any w > 0, there are infinitely many prime numbers whose binary expansions end with w 1's, and these are all occasions for an integer < 2^w to appear in the sequence.

Examples

			The first terms, alongside the corresponding binary expansions, are:
  n   a(n)  bin(a(n))  bin(prime(n))
  --  ----  ---------  -------------
   1     2         10             10
   2     1          1             11
   3     4        100            101
   4     3         11            111
   5     8       1000           1011
   6     5        101           1101
   7    16      10000          10001
   8    17      10001          10011
   9     6        110          10111
  10     9       1001          11101
		

Crossrefs

Cf. A295609, A295989, A370728 (inverse).

Programs

  • PARI
    See Links section.
Showing 1-10 of 14 results. Next