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 81-90 of 96 results. Next

A221146 Table read by antidiagonals: (m+n) - (m XOR n).

Original entry on oeis.org

0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 2, 4, 2, 0, 0, 0, 4, 4, 0, 0, 0, 2, 0, 6, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 4, 2, 8, 2, 4, 2, 0, 0, 0, 4, 4, 8, 8, 4, 4, 0, 0, 0, 2, 0, 6, 8, 10, 8, 6, 0, 2, 0, 0, 0, 0, 0, 8, 8, 8, 8, 0, 0, 0, 0, 0, 2, 4, 2, 0, 10, 12, 10, 0, 2, 4, 2, 0
Offset: 0

Views

Author

BOCUT Adrian Sebastian, Dec 12 2012

Keywords

Comments

Equals twice A004198.
This sequence is related to two fractals: the Sierpinski gasket fractal and Peano filigree.
For the Sierpinski fractal the procedure is the following:
- write the number stored in the position (i,j) as i+j + d, where d stands for difference.
The array of the differences is
0 0 0 0
0 2 0 2
0 0 4 4
0 2 4 6
If this matrix is represented by colors we obtain the Sierpinski gasket; coordinates (i,j) contain a pixel with the color i XOR j.
If we follow the odd and even numbers of the XOR table we obtain the Peano curve.

Examples

			Table begins:
0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0 ...
0   2   0   2   0   2   0   2   0   2   0   2   0   2   0   2 ...
0   0   4   4   0   0   4   4   0   0   4   4   0   0   4   4 ...
0   2   4   6   0   2   4   6   0   2   4   6   0   2   4   6 ...
0   0   0   0   8   8   8   8   0   0   0   0   8   8   8   8 ...
0   2   0   2   8  10   8  10   0   2   0   2   8  10   8  10 ...
0   0   4   4   8   8  12  12   0   0   4   4   8   8  12  12 ...
0   2   4   6   8  10  12  14   0   2   4   6   8  10  12  14 ...
0   0   0   0   0   0   0   0  16  16  16  16  16  16  16  16 ...
0   2   0   2   0   2   0   2  16  18  16  18  16  18  16  18 ...
0   0   4   4   0   0   4   4  16  16  20  20  16  16  20  20 ...
0   2   4   6   0   2   4   6  16  18  20  22  16  18  20  22 ...
0   0   0   0   8   8   8   8  16  16  16  16  24  24  24  24 ...
0   2   0   2   8  10   8  10  16  18  16  18  24  26  24  26 ...
0   0   4   4   8   8  12  12  16  16  20  20  24  24  28  28 ...
0   2   4   6   8  10  12  14  16  18  20  22  24  26  28  30 ...
...
		

Crossrefs

Programs

  • Mathematica
    Table[m-BitXor[n, m-n], {m, 0, 15}, {n, 0, m}] (* Paolo Xausa, Mar 14 2024 *)

Extensions

Edited by N. J. A. Sloane, Jan 03 2013

A256754 a(n) = bitwise AND of n and the reverse of n.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 11, 4, 13, 8, 3, 16, 1, 16, 19, 0, 4, 22, 0, 8, 16, 26, 8, 16, 28, 2, 13, 0, 33, 34, 33, 36, 1, 2, 5, 0, 8, 8, 34, 44, 36, 0, 10, 16, 16, 0, 3, 16, 33, 36, 55, 0, 9, 16, 27, 4, 16, 26, 36, 0, 0, 66, 64, 68, 64, 6, 1, 8, 1, 10
Offset: 0

Views

Author

Alois P. Heinz, Apr 09 2015

Keywords

Crossrefs

Programs

  • Maple
    a:= n-> Bits[And](n, (s-> parse(cat(s[-i]$i=1..length(s))))(""||n)):
    seq(a(n), n=0..80);
  • Mathematica
    Table[BitAnd[n,FromDigits[Reverse[IntegerDigits[n]]]],{n,0,74}] (* Ivan N. Ianakiev, Apr 10 2015 *)
  • PARI
    a(n) = bitand(n, subst(Polrev(digits(n)), x, 10)); \\ Michel Marcus, Apr 10 2015

Formula

a(n) = A004198(n,A004086(n)).

A336882 a(0) = 1; for k >= 0, 0 <= i < 2^k, a(2^k + i) = m_k * a(i), where m_k is the least odd number not in terms 0..2^k - 1.

Original entry on oeis.org

1, 3, 5, 15, 7, 21, 35, 105, 9, 27, 45, 135, 63, 189, 315, 945, 11, 33, 55, 165, 77, 231, 385, 1155, 99, 297, 495, 1485, 693, 2079, 3465, 10395, 13, 39, 65, 195, 91, 273, 455, 1365, 117, 351, 585, 1755, 819, 2457, 4095, 12285, 143, 429, 715, 2145, 1001
Offset: 0

Views

Author

Peter Munn, Aug 16 2020

Keywords

Comments

A permutation of the odd numbers.
Every positive integer, m, is the product of a unique subset of the terms of A050376. The members of the subset are often known as the Fermi-Dirac factors of m. In this sequence, the odd numbers appear lexicographically according to their Fermi-Dirac factors (with those factors listed in decreasing order). The equivalent sequence for all positive integers is A052330.
The sequence has a conditional exponential identity shown in the formula section. This relies on the offset being 0, as in related sequences, notably A019565 and A052330.

Examples

			a(0) = 1, as specified explicitly.
m_0 = 3, the least odd number not in terms 0..0.
So a(1) = a(2^0 + 0) = m_0 * a(0) = 3 * 1 = 3.
m_1 = 5, the least odd number not in terms 0..1.
So a(2) = a(2^1 + 0) = m_1 * a(0) = 5 * 1 = 5;
and a(3) = a(2^1 + 1) = m_1 * a(1) = 5 * 3 = 15.
The initial terms are tabulated below, equated with the product of their Fermi-Dirac factors to exhibit the lexicographic order. We start with 1, since 1 is factored as the empty product and the empty list is first in lexicographic order.
   n     a(n)
   0    1,
   1    3 = 3,
   2    5 = 5,
   3   15 = 5 * 3,
   4    7 = 7,
   5   21 = 7 * 3,
   6   35 = 7 * 5,
   7  105 = 7 * 5 * 3,
   8    9 = 9,
   9   27 = 9 * 3,
  10   45 = 9 * 5,
  11  135 = 9 * 5 * 3,
  12   63 = 9 * 7.
		

Crossrefs

Permutation of A005408.
Subsequence of A052330.
Subsequences: A062090, A332382 (squarefree terms).
A003986, A003987, A004198, A059896, A059897 are used to express relationship between terms of this sequence.

Formula

a(2^k) = min({ 2*m+1 : m >= 0, 2*m+1 <> a(j), 0 <= j < 2^k }) = A062090(k+2).
If x AND y = 0, a(x+y) = a(x) * a(y), where AND denotes the bitwise operation, A004198(.,.).
a(x XOR y) = A059897(a(x), a(y)), where XOR denotes bitwise exclusive-or, A003987(.,.).
a(x OR y) = A059896(a(x), a(y)), where OR denotes the bitwise operation, A003986(.,.).

A356325 Array A(n, k), n, k >= 0, read by antidiagonals; the terms in the negaFibonacci representation of A(n, k) are the terms in common in the negaFibonacci representations of n and k.

Original entry on oeis.org

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

Views

Author

Rémy Sigrist, Aug 03 2022

Keywords

Comments

This sequence has similarities with A334348.

Examples

			Array A(n, k) 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  1   0  0  1  0  1   0   0   1   0   0
    2|  0  0  2  2   0  0  0  2  2   0   0   0   0   0
    3|  0  1  2  3   0  0  1  2  3   0   0   1   0   0
    4|  0  0  0  0   4  5  5  5  5  -1   0   0  -1   0
    5|  0  0  0  0   5  5  5  5  5   0   0   0   0   0
    6|  0  1  0  1   5  5  6  5  6   0   0   1   0   0
    7|  0  0  2  2   5  5  5  7  7   0   0   0   0   0
    8|  0  1  2  3   5  5  6  7  8   0   0   1   0   0
    9|  0  0  0  0  -1  0  0  0  0   9  10  10  12  13
   10|  0  0  0  0   0  0  0  0  0  10  10  10  13  13
   11|  0  1  0  1   0  0  1  0  1  10  10  11  13  13
   12|  0  0  0  0  -1  0  0  0  0  12  13  13  12  13
   13|  0  0  0  0   0  0  0  0  0  13  13  13  13  13
.
For n = 14 and k = 43:
- using F(-k) = A039834(k):
- 14 = F(-1) + F(-7),
- 43 = F(-2) + F(-4) + F(-7) + F(-9),
- so A(14, 43) = F(-7) = 13.
		

Crossrefs

Programs

  • PARI
    See Links section.

Formula

A(n, k) = A(k, n).
A(n, n) = n.
A(n, 0) = 0.
A(n, k) = A356327(A215024(n) AND A215024(k)) (where AND denotes the bitwise AND operator).

A261078 Semiprimes p*q such that q = p + 2^k for some k >= 0.

Original entry on oeis.org

6, 15, 21, 33, 35, 57, 65, 77, 143, 161, 185, 201, 209, 221, 323, 377, 393, 437, 473, 497, 713, 899, 1073, 1457, 1517, 1529, 1577, 1763, 1769, 1841, 1961, 2021, 2537, 2993, 3233, 3473, 3497, 3599, 3713, 3737, 3953, 4553, 4601, 4757, 5183, 5561, 5609, 5753, 6497, 6557, 7217, 7313, 8633, 8777, 9593, 9797, 10001, 10265, 10403, 10841, 10961, 11009, 11021
Offset: 1

Views

Author

Antti Karttunen, Sep 22 2015

Keywords

Comments

Terms ending with digit 5 (in decimal) are very rare, because terms of A123250 are rare.

Examples

			6 = 2*3 is present as 3 = 2 + 2^0.
15 = 3*5 is present as 5 = 3 + 2^1.
35 = 5*7 is present as 7 = 5 + 2^1.
		

Crossrefs

Cf. also A261073, A261077 (subsequences).

Programs

  • PARI
    A020639(n) = if(1==n,n,vecmin(factor(n)[, 1]));
    isA261078(n) = { my(d); if(bigomega(n)!=2, return(0), d = (n/A020639(n)) - A020639(n); (d && !bitand(d,d-1))); };
    i=0; n=0; while(i < 10000, n++; if(isA261078(n), i++; write("b261078.txt", i, " ", n)));
    
  • Scheme
    ;; With Antti Karttunen's IntSeq-library.
    (define A261078 (MATCHING-POS 1 1 (lambda (n) (and (= 2 (A001222 n)) (pow2? (- (A006530 n) (A020639 n)))))))
    (define (pow2? n) (and (> n 0) (zero? (A004198bi n (- n 1))))) ;; A004198bi implements bitwise-AND (Cf. A004198)

A268040 Array y AND NOT x, read by antidiagonals.

Original entry on oeis.org

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

Views

Author

Peter Kagey, Jan 24 2016

Keywords

Comments

This is one of eight bitwise truth tables subject to the condition that (0, 0) implies 0.
# -------|---------|---------|---------|---------
# (0, 0) | 0 | 0 | 0 | 0
# (0, 1) | 0 | 0 | 0 | 0
# (1, 0) | 0 | 0 | 1 | 1
# (1, 1) | 0 | 1 | 0 | 1
#
# -------|---------|---------|---------|---------
# (0, 0) | 0 | 0 | 0 | 0
# (0, 1) | 1 | 1 | 1 | 1
# (1, 0) | 0 | 0 | 1 | 1
# (1, 1) | 0 | 1 | 0 | 1
Transpose of the array in A099026. - Michel Marcus, Jan 25 2016

Examples

			The array begins:
0, 1, 2, 3, 4, 5, ...
0, 0, 2, 2, 4, 4, ...
0, 1, 0, 1, 4, 5, ...
0, 0, 0, 0, 4, 4, ...
0, 1, 2, 3, 0, 1, ...
0, 0, 2, 2, 0, 0, ...
...
		

Crossrefs

Programs

A285720 Number of ways to write n as a sum of two unordered squarefree numbers so that their addition in base-2 does not produce carries.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, May 02 2017

Keywords

Crossrefs

Programs

  • Mathematica
    Table[Sum[Abs[MoebiusMu[i] MoebiusMu[n - i]] Boole[BitXor[i, n - i] == n], {i, Floor[n/2]}], {n, 120}] (* Michael De Vlieger, May 03 2017 *)
  • Python
    from sympy import mobius
    def a003987(n, i): return i^(n - i) == n
    def a(n): return sum([abs(mobius(i)*mobius(n - i))*(1*a003987(n, i)) for i in range(1, n//2 + 1)])
    print([a(n) for n in range(1,121)]) # Indranil Ghosh, May 02 2017
  • Scheme
    (define (A285720 n) (let loop ((k (A013928 n)) (s 0)) (if (or (zero? k) (< (A005117 k) (- n (A005117 k)))) s (loop (- k 1) (+ s (if (and (= 1 (A008966 (- n (A005117 k)))) (zero? (A004198bi (A005117 k) (- n (A005117 k))))) 1 0)))))) ;; Where A004198bi implements bitwise-AND (A004198).
    

Formula

a(n) = Sum_{i=1..floor(n/2)} abs(mu(i)*mu(n-i))*[A003987(i,n-i) == n]. (Here [] is Iverson bracket, giving in this case 1 only if (i XOR (n-i)) is equal to n, and 0 otherwise. mu is Moebius mu function, A008683.)
a(n) <= A071068(n).
a(n) <= A088512(n).

A335587 a(n) is the sum of the numbers k such that 0 <= k <= n and n AND k = 0 (where AND denotes the bitwise AND operator).

Original entry on oeis.org

0, 0, 1, 0, 6, 2, 1, 0, 28, 12, 10, 4, 6, 2, 1, 0, 120, 56, 52, 24, 44, 20, 18, 8, 28, 12, 10, 4, 6, 2, 1, 0, 496, 240, 232, 112, 216, 104, 100, 48, 184, 88, 84, 40, 76, 36, 34, 16, 120, 56, 52, 24, 44, 20, 18, 8, 28, 12, 10, 4, 6, 2, 1, 0, 2016, 992, 976, 480
Offset: 0

Views

Author

Rémy Sigrist, Apr 21 2021

Keywords

Comments

All terms can be written as m * 2^A000120(m) for some m >= 0.

Examples

			For n = 4:
- 4 AND 0 = 0,
- 4 AND 1 = 0,
- 4 AND 2 = 0,
- 4 AND 3 = 0,
- 4 AND 4 = 4,
- so a(4) = 0 + 1 + 2 + 3 = 6.
		

Crossrefs

Cf. A000120, A004198 (bitwise AND), A006516, A035327, A080100, A080791.

Programs

  • PARI
    a(n) = sum(k=0, n, if (bitand(n, k)==0, k, 0))
    
  • PARI
    a(n) = my (w=#binary(n)); ( (2^w-1-n) * 2^(w-hammingweight(n)) ) \ 2

Formula

a(n) = A035327(n) * A080100(n) / 2 for any n > 0.
a(2*n+1) = 2*a(n).
a(2^k-1) = 0 for any k >= 0.
a(2^k) = A006516(k) for any k >= 0.

A339601 Starting from x_0 = n, iterate by dividing with 3 (discarding any remainder), until zero is reached: x_1 = floor(x_0/3), x_2 = floor(x_1/3), etc. Then a(n) = Sum_{i=0..} (x_i AND 2^i), where AND is bitwise-and.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Dec 09 2020

Keywords

Crossrefs

Cf. also A332497.

Programs

  • Mathematica
    Array[Total@ MapIndexed[BitAnd[2^First[#2 - 1], #1] &, NestWhileList[Floor[#/3] &, #, # > 0 &]] &, 106, 0] (* Michael De Vlieger, Dec 10 2020 *)
  • PARI
    A339601(n) = { my(i=0, s=0); while(n, s += bitand(2^i,n); i++; n \= 3); (s); };
    
  • PARI
    A339601(n) = { my(m=1, s=0); while(n>=m, s += bitand(m,n); m <<= 1; n \= 3); (s); };

A352727 Square array A(n, k), n, k >= 0, read by antidiagonals: the binary expansion of A(n, k) contains the runs of consecutive 1's that appear both in the binary expansions of n and k.

Original entry on oeis.org

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

Views

Author

Rémy Sigrist, Mar 30 2022

Keywords

Comments

We only consider maximal runs of one or more consecutive 1's (as counted by A069010) that completely match in binary expansions of n and k, not simply single common 1's.

Examples

			Table A(n, k) begins:
  n\k|  0  1  2  3  4  5  6  7  8  9  10  11  12  13  14  15
  ---+------------------------------------------------------
    0|  0  0  0  0  0  0  0  0  0  0   0   0   0   0   0   0
    1|  0  1  0  0  0  1  0  0  0  1   0   0   0   1   0   0
    2|  0  0  2  0  0  0  0  0  0  0   2   0   0   0   0   0
    3|  0  0  0  3  0  0  0  0  0  0   0   3   0   0   0   0
    4|  0  0  0  0  4  4  0  0  0  0   0   0   0   0   0   0
    5|  0  1  0  0  4  5  0  0  0  1   0   0   0   1   0   0
    6|  0  0  0  0  0  0  6  0  0  0   0   0   0   0   0   0
    7|  0  0  0  0  0  0  0  7  0  0   0   0   0   0   0   0
    8|  0  0  0  0  0  0  0  0  8  8   8   8   0   0   0   0
    9|  0  1  0  0  0  1  0  0  8  9   8   8   0   1   0   0
   10|  0  0  2  0  0  0  0  0  8  8  10   8   0   0   0   0
   11|  0  0  0  3  0  0  0  0  8  8   8  11   0   0   0   0
   12|  0  0  0  0  0  0  0  0  0  0   0   0  12  12   0   0
   13|  0  1  0  0  0  1  0  0  0  1   0   0  12  13   0   0
   14|  0  0  0  0  0  0  0  0  0  0   0   0   0   0  14   0
   15|  0  0  0  0  0  0  0  0  0  0   0   0   0   0   0  15
		

Crossrefs

Programs

  • PARI
    A352724(n) = { my (r=[], o=0); while (n, my (v=valuation(n+n%2, 2)); if (n%2, r=concat(r, (2^v-1)*2^o)); o+=v; n\=2^v); r }
    A(n,k) = vecsum(setintersect(A352724(n), A352724(k)))

Formula

A(n, k) = A(k, n).
A(n, 0) = 0.
A(n, n) = n.
A(n, 2*n) = 0.
A(n, k) <= A004198(n, k) (bitwise AND operator).
A(n, n+1) = A352729(n).
Previous Showing 81-90 of 96 results. Next