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 71-80 of 96 results. Next

A324658 a(n) = n - A324659(n), where A324659(n) is half of bitwise-AND of 2*n and sigma(n).

Original entry on oeis.org

1, 2, 1, 4, 4, 0, 3, 8, 9, 2, 9, 0, 8, 2, 3, 16, 16, 0, 17, 0, 5, 4, 19, 0, 16, 10, 11, 0, 16, 26, 15, 32, 33, 32, 35, 0, 36, 32, 35, 0, 40, 10, 41, 4, 8, 10, 39, 0, 33, 16, 19, 4, 36, 2, 19, 0, 17, 18, 33, 40, 32, 14, 11, 64, 65, 2, 65, 64, 69, 6, 67, 8, 72, 66, 65, 8, 77, 10, 71, 0, 65, 64, 81, 4, 65, 20, 67, 0, 80
Offset: 1

Views

Author

Antti Karttunen, Mar 14 2019

Keywords

Crossrefs

Cf. A324652 (positions of zeros).

Programs

  • Mathematica
    Array[# - BitAnd[2*#, DivisorSigma[1, #]]/2 &, 100] (* Paolo Xausa, Mar 13 2024 *)
  • PARI
    A324658(n) = (n-(bitand(2*n,sigma(n))/2));

Formula

a(n) = n - A324659(n) = n - A318468(n)/2 = n - ((2*n AND sigma(n))/2).

A351559 a(n) = A048675(gcd(sigma(n), A019565(n))).

Original entry on oeis.org

0, 2, 1, 0, 1, 2, 1, 0, 0, 2, 3, 8, 9, 2, 3, 0, 1, 2, 1, 0, 1, 2, 3, 0, 0, 10, 1, 8, 5, 2, 1, 0, 1, 2, 3, 32, 1, 6, 1, 0, 9, 2, 1, 8, 33, 2, 3, 0, 0, 2, 3, 0, 1, 6, 3, 0, 1, 2, 3, 8, 1, 2, 33, 0, 1, 2, 65, 0, 1, 2, 3, 0, 1, 2, 1, 12, 1, 10, 5, 0, 16, 2, 3, 0, 1, 18, 7, 0, 1, 2, 9, 8, 1, 2, 7, 0, 1, 2, 35, 0, 65, 2, 33
Offset: 1

Views

Author

Antti Karttunen, Feb 19 2022

Keywords

Crossrefs

Programs

  • Mathematica
    Table[If[# == 1, 0, Total[#2*2^PrimePi[#1] & @@@ FactorInteger[#]]/2] &@ GCD[DivisorSigma[1, n], Times @@ Prime@ Flatten@ Position[Reverse@ IntegerDigits[n, 2], 1]], {n, 103}] (* Michael De Vlieger, Feb 20 2022 *)
  • PARI
    A019565(n) = { my(m=1, p=1); while(n>0, p = nextprime(1+p); if(n%2, m *= p); n >>= 1); (m); };
    A048675(n) = { my(f = factor(n)); sum(k=1, #f~, f[k, 2]*2^primepi(f[k, 1]))/2; };
    A351559(n) = A048675(gcd(sigma(n), A019565(n)));

Formula

a(n) = A048675(A351557(n)) = A048675(gcd(sigma(n), A019565(n))).
a(n) = n AND A351560(n), where AND is bitwise-and, A004198.

A082856 Recursive binary interleaving code for rooted plane binary trees, as ordered by A014486.

Original entry on oeis.org

0, 1, 3, 5, 11, 35, 7, 21, 69, 139, 2059, 43, 547, 8227, 15, 39, 23, 277, 4117, 71, 85, 1093, 16453, 32907, 8388747, 2187, 526347, 134219787, 171, 2091, 555, 131619, 33554979, 8235, 8739, 2105379, 536879139, 143, 2063, 47, 551, 8231, 31, 55, 279, 65813, 16777493, 4119, 4373, 1052693, 268439573, 79, 103, 87, 341, 4181, 1095, 1109
Offset: 0

Views

Author

Antti Karttunen, May 06 2003

Keywords

Comments

This encoding has a property that the greatest common subtree i.e. the intersect (or the least common supertree, the union) of any two trees can be obtained by simply computing the binary-AND (A004198) (or respectively: binary-OR, A003986) of the corresponding codes. See A082858-A082860.

Examples

			The empty tree . has code 0, the tree of two edges (and leaves) \/ has code 1 and in general tree's code is obtained by interleaving into odd and even bits (above bit-0, which is always 1 for nonempty trees) the codes for the left and right hand side subtrees of the tree.
		

Crossrefs

A285115 Row sums of A285118: a(n) = Sum_{k=1..(n-1)} (C(n-1,k-1) bitwise-and C(n-1,k)), a(0) = a(1) = 0.

Original entry on oeis.org

0, 0, 1, 0, 5, 8, 12, 20, 49, 64, 304, 672, 1204, 2648, 3852, 9320, 18297, 32960, 75472, 146392, 304920, 577336, 1211144, 2034072, 4801892, 7637392, 18795944, 33811680, 71566612, 139144320, 285508328, 569229920, 1069209737, 2314296064, 4167725024, 8567738280, 16894013736, 33135107200, 68279466472, 121133055024
Offset: 0

Views

Author

Antti Karttunen, Apr 16 2017

Keywords

Crossrefs

Programs

  • Mathematica
    a[n_]:=If[n<2, 0, Sum[BitAnd[Binomial[n - 1,k - 1], Binomial[n - 1, k]], {k, n - 1}]]; Table[a[n], {n, 0, 100}] (* Indranil Ghosh, Apr 16 2017 *)
  • PARI
    A285115(n) = if(n<2,0,sum(k=1,(n-1),bitand(binomial(n-1,k-1),binomial(n-1,k))));
    
  • Scheme
    (define (A285115 n) (add A285118 (A000217 n) (+ -1 (A000217 (+ 1 n)))))
    (define (add intfun lowlim uplim) (let sumloop ((i lowlim) (res 0)) (cond ((> i uplim) res) (else (sumloop (+ 1 i) (+ res (intfun i)))))))

Formula

a(0) = a(1) = 0, and for n > 1, a(n) = Sum_{k=1..(n-1)} C(n-1,k-1) AND C(n-1,k), where C(n,k) is a binomial coefficient & AND is bitwise-AND (A004198).
a(n) = A285113(n) - A285114(n).
a(n) = A000079(n) - A285113(n) = (A000079(n) - A285114(n))/2.

A324648 a(n) = n - A318458(n), where A318458(n) is bitwise-AND of n and the sum of proper divisors of n (sigma(n)-n).

Original entry on oeis.org

1, 2, 2, 4, 4, 0, 6, 8, 9, 2, 10, 12, 12, 4, 6, 16, 16, 2, 18, 0, 20, 16, 22, 24, 25, 10, 18, 0, 28, 20, 30, 32, 32, 34, 34, 0, 36, 32, 38, 8, 40, 8, 42, 4, 12, 36, 46, 48, 49, 16, 34, 16, 52, 52, 38, 56, 40, 26, 58, 16, 60, 28, 22, 64, 64, 0, 66, 68, 68, 4, 70, 0, 72, 66, 74, 12, 76, 4, 78, 16, 81, 82, 82, 80, 64, 80, 86, 0, 88
Offset: 1

Views

Author

Antti Karttunen, Mar 14 2019

Keywords

Crossrefs

Cf. A001065, A004198, A318458, A324658, A324649 (positions of zeros).

Programs

  • Mathematica
    Array[# - BitAnd[#, DivisorSigma[1, #] - #] &, 100] (* Paolo Xausa, Mar 12 2024 *)
  • PARI
    A318458(n) = bitand(n,sigma(n)-n);
    A324648(n) = (n-A318458(n));
    
  • PARI
    A324648(n) = (n-bitand(n,sigma(n)-n));

Formula

a(n) = n - A318458(n).

A324659 a(n) = (1/2)*A318468(n), where A318468(n) is bitwise-AND of 2*n and sigma(n).

Original entry on oeis.org

0, 0, 2, 0, 1, 6, 4, 0, 0, 8, 2, 12, 5, 12, 12, 0, 1, 18, 2, 20, 16, 18, 4, 24, 9, 16, 16, 28, 13, 4, 16, 0, 0, 2, 0, 36, 1, 6, 4, 40, 1, 32, 2, 40, 37, 36, 8, 48, 16, 34, 32, 48, 17, 52, 36, 56, 40, 40, 26, 20, 29, 48, 52, 0, 0, 64, 2, 4, 0, 64, 4, 64, 1, 8, 10, 68, 0, 68, 8, 80, 16, 18, 2, 80, 20, 66, 20, 88, 9, 80
Offset: 1

Views

Author

Antti Karttunen, Mar 14 2019

Keywords

Crossrefs

Cf. A324652 (fixed points).

Programs

  • Mathematica
    Array[BitAnd[2*#, DivisorSigma[1, #]]/2 &, 100] (* Paolo Xausa, Mar 11 2024 *)
  • PARI
    A324659(n) = (bitand(2*n,sigma(n))/2);

Formula

a(n) = A318468(n)/2.
a(n) = n - A324658(n).

A334348 The terms in the Zeckendorf representation of T(n, k) correspond to the terms in common in the Zeckendorf representations of n and of k; square array T(n, k) read by antidiagonals, n, k >= 0.

Original entry on oeis.org

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

Views

Author

Rémy Sigrist, Apr 24 2020

Keywords

Comments

This array has connections with the bitwise AND operator (A004198).

Examples

			Square array begins:
  n\k|  0  1  2  3  4  5  6  7  8  9  10  11  12  13
  ---+----------------------------------------------
    0|  0  0  0  0  0  0  0  0  0  0   0   0   0   0
    1|  0  1  0  0  1  0  1  0  0  1   0   0   1   0
    2|  0  0  2  0  0  0  0  2  0  0   2   0   0   0
    3|  0  0  0  3  3  0  0  0  0  0   0   3   3   0
    4|  0  1  0  3  4  0  1  0  0  1   0   3   4   0
    5|  0  0  0  0  0  5  5  5  0  0   0   0   0   0
    6|  0  1  0  0  1  5  6  5  0  1   0   0   1   0
    7|  0  0  2  0  0  5  5  7  0  0   2   0   0   0
    8|  0  0  0  0  0  0  0  0  8  8   8   8   8   0
    9|  0  1  0  0  1  0  1  0  8  9   8   8   9   0
   10|  0  0  2  0  0  0  0  2  8  8  10   8   8   0
   11|  0  0  0  3  3  0  0  0  8  8   8  11  11   0
   12|  0  1  0  3  4  0  1  0  8  9   8  11  12   0
   13|  0  0  0  0  0  0  0  0  0  0   0   0   0  13
		

Crossrefs

Programs

  • PARI
    See Links section.

Formula

T(n, k) = A022290(A003714(n) AND A003714(k)) (where AND denotes the bitwise AND operator, A004198).
T(n, 0) = 0.
T(n, n) = n.
T(n, k) = T(k, n).
T(m, T(n, k)) = T(T(m, n), k).

A351558 a(n) = A048675(gcd(n, A019565(n))).

Original entry on oeis.org

0, 0, 0, 2, 0, 4, 2, 0, 0, 0, 0, 0, 0, 0, 8, 6, 0, 0, 2, 0, 4, 0, 16, 0, 0, 0, 0, 2, 8, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 34, 0, 0, 10, 0, 0, 4, 0, 0, 0, 0, 0, 2, 32, 0, 2, 20, 8, 0, 0, 0, 4, 0, 0, 10, 0, 0, 2, 0, 64, 0, 4, 0, 0, 0, 0, 2, 0, 8, 2, 0, 0, 0, 0, 0, 0, 68, 0, 2, 16, 0, 2, 8, 0, 0, 0, 4, 0, 0, 0, 2, 4, 0, 66
Offset: 0

Views

Author

Antti Karttunen, Feb 19 2022

Keywords

Crossrefs

Programs

  • Mathematica
    Table[If[# == 1, 0, Total[#2*2^PrimePi[#1] & @@@ FactorInteger[#]]/2] &@ GCD[n, Times @@ Prime@ Flatten@ Position[Reverse@ IntegerDigits[n, 2], 1]], {n, 102}] (* Michael De Vlieger, Feb 20 2022 *)
  • PARI
    A019565(n) = { my(m=1, p=1); while(n>0, p = nextprime(1+p); if(n%2, m *= p); n >>= 1); (m); };
    A048675(n) = { my(f = factor(n)); sum(k=1, #f~, f[k, 2]*2^primepi(f[k, 1]))/2; };
    A351558(n) = A048675(gcd(n, A019565(n)));

Formula

a(n) = A048675(A351556(n)) = A048675(gcd(n, A019565(n))).
a(n) = n AND A087207(n), where AND is bitwise-and, A004198.

A353296 Pairs (i,j) of positive integers with at least one common 1-bit sorted first by i+j then by i.

Original entry on oeis.org

1, 1, 1, 3, 2, 2, 3, 1, 2, 3, 3, 2, 1, 5, 3, 3, 5, 1, 1, 7, 2, 6, 3, 5, 4, 4, 5, 3, 6, 2, 7, 1, 2, 7, 3, 6, 4, 5, 5, 4, 6, 3, 7, 2, 1, 9, 3, 7, 4, 6, 5, 5, 6, 4, 7, 3, 9, 1, 4, 7, 5, 6, 6, 5, 7, 4, 1, 11, 2, 10, 3, 9, 5, 7, 6, 6, 7, 5, 9, 3, 10, 2, 11, 1
Offset: 1

Views

Author

Rémy Sigrist and N. J. A. Sloane, Apr 09 2022

Keywords

Comments

Pairs (i,j) with AND(i,j) <> 0.
See A352909 for the other pairs.
There are A048967(n) pairs (i,j) with n = i+j.

Examples

			The first pairs are:
    [1, 1],
    [1, 3], [2, 2], [3, 1],
    [2, 3], [3, 2],
    [1, 5], [3, 3], [5, 1],
    [1, 7], [2, 6], [3, 5], [4, 4], [5, 3], [6, 2], [7, 1],
    [2, 7], [3, 6], [4, 5], [5, 4], [6, 3], [7, 2],
    [1, 9], [3, 7], [4, 6], [5, 5], [6, 4], [7, 3], [9, 1],
    ...
		

Crossrefs

Cf. A004198, A048967, A352909, A353297 (i values), A353298 (j values).

Programs

  • Mathematica
    A353296row[ij_] := Select[Array[{#, ij-#} &, ij], BitAnd @@ # > 0 &];
    Array[A353296row, 15] (* Paolo Xausa, Feb 24 2024 *)
  • PARI
    for (ij=1, 12, for (i=1, ij, j=ij-i; if (bitand(i,j), print1(i", "j", "))))

A213540 Numbers k such that k AND k*2 = 2, where AND is the bitwise AND operator.

Original entry on oeis.org

3, 11, 19, 35, 43, 67, 75, 83, 131, 139, 147, 163, 171, 259, 267, 275, 291, 299, 323, 331, 339, 515, 523, 531, 547, 555, 579, 587, 595, 643, 651, 659, 675, 683, 1027, 1035, 1043, 1059, 1067, 1091, 1099, 1107, 1155, 1163, 1171, 1187, 1195, 1283, 1291, 1299, 1315
Offset: 1

Views

Author

Alex Ratushnyak, Jun 14 2012

Keywords

Examples

			In binary, 19 is 10011, while 2 * 19 = 38 is of course 100110. Since 010011 AND 100110 = 000010 (in decimal, 2), 19 is in the sequence.
20 is not in the sequence, since 010100 AND 101000 = 000000.
		

Crossrefs

Programs

  • Maple
    F:= combinat[fibonacci]:
    b:= proc(n) local j;
          if n=0 then 0
        else for j from 2 while F(j+1)<=n do od;
             b(n-F(j))+2^(j-2)
          fi
        end:
    a:= n-> 8*b(n-1)+3:
    seq(a(n), n=1..60);  # Alois P. Heinz, Jun 17 2012
  • Mathematica
    Select[Range[1024], BitAnd[#, 2#] == 2 &] (* Alonso del Arte, Jun 18 2012 *)
  • PARI
    is(n)=bitand(n,2*n)==2 \\ Charles R Greathouse IV, Jun 18 2012
  • Python
    for n in range(1777):
        a = 2*n & n
        if a==2:
            print(n, end=',')
    

Formula

a(n) = A003714(n-1)*8 + 3.
Previous Showing 71-80 of 96 results. Next