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 11-20 of 96 results. Next

A286099 Square array read by antidiagonals: A(n,k) = T(n OR k, n AND k), where T(n,k) is sequence A001477 considered as a two-dimensional table, AND is bitwise-and (A004198) and OR is bitwise-or (A003986).

Original entry on oeis.org

0, 2, 2, 5, 4, 5, 9, 9, 9, 9, 14, 13, 12, 13, 14, 20, 20, 18, 18, 20, 20, 27, 26, 27, 24, 27, 26, 27, 35, 35, 35, 35, 35, 35, 35, 35, 44, 43, 42, 43, 40, 43, 42, 43, 44, 54, 54, 52, 52, 50, 50, 52, 52, 54, 54, 65, 64, 65, 62, 61, 60, 61, 62, 65, 64, 65, 77, 77, 77, 77, 73, 73, 73, 73, 77, 77, 77, 77, 90, 89, 88, 89, 90, 85, 84, 85, 90, 89, 88, 89, 90
Offset: 0

Views

Author

Antti Karttunen, May 03 2017

Keywords

Comments

The array is read by descending antidiagonals as A(0,0), A(0,1), A(1,0), A(0,2), A(1,1), A(2,0), ...

Examples

			The top left 0 .. 12 x 0 .. 12 corner of the array:
   0,   2,   5,   9,  14,  20,  27,  35,  44,  54,  65,  77,  90
   2,   4,   9,  13,  20,  26,  35,  43,  54,  64,  77,  89, 104
   5,   9,  12,  18,  27,  35,  42,  52,  65,  77,  88, 102, 119
   9,  13,  18,  24,  35,  43,  52,  62,  77,  89, 102, 116, 135
  14,  20,  27,  35,  40,  50,  61,  73,  90, 104, 119, 135, 148
  20,  26,  35,  43,  50,  60,  73,  85, 104, 118, 135, 151, 166
  27,  35,  42,  52,  61,  73,  84,  98, 119, 135, 150, 168, 185
  35,  43,  52,  62,  73,  85,  98, 112, 135, 151, 168, 186, 205
  44,  54,  65,  77,  90, 104, 119, 135, 144, 162, 181, 201, 222
  54,  64,  77,  89, 104, 118, 135, 151, 162, 180, 201, 221, 244
  65,  77,  88, 102, 119, 135, 150, 168, 181, 201, 220, 242, 267
  77,  89, 102, 116, 135, 151, 168, 186, 201, 221, 242, 264, 291
  90, 104, 119, 135, 148, 166, 185, 205, 222, 244, 267, 291, 312
		

Crossrefs

Cf. A000096 (row 0 & column 0), A162761 (seems to be row 1 & column 1), A046092 (main diagonal).
Cf. also arrays A286098, A286101, A286102, A286109.

Programs

  • Mathematica
    T[a_, b_]:=((a + b)^2 + 3a + b)/2; A[n_, k_]:=T[BitOr[n, k],BitAnd[n,  k]]; Table[A[n - k, k], {n, 0, 20}, {k, 0, n}] // Flatten (* Indranil Ghosh, May 21 2017 *)
  • Python
    def T(a, b): return ((a + b)**2 + 3*a + b)//2
    def A(n, k): return T(n|k, n&k)
    for n in range(0, 21): print([A(k, n - k) for k in range(0, n + 1)]) # Indranil Ghosh, May 21 2017
  • Scheme
    (define (A286099 n) (A286099bi (A002262 n) (A025581 n)))
    (define (A286099bi row col) (let ((a (A003986bi row col)) (b (A004198bi row col))) (/ (+ (expt (+ a b) 2) (* 3 a) b) 2))) ;; Here A003986bi and A004198bi implement bitwise-OR (A003986) and bitwise-AND (A004198).
    

Formula

A(n,k) = T(A003986(n,k), A004198(n,k)), where T(n,k) is sequence A001477 considered as a two-dimensional table, that is, as a pairing function from [0, 1, 2, 3, ...] x [0, 1, 2, 3, ...] to [0, 1, 2, 3, ...].

A318463 a(n) = Sum_{d|n, d < n/d} (d AND n/d), where AND is bitwise-and (A004198).

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Aug 28 2018

Keywords

Crossrefs

Programs

  • PARI
    A318463(n) = { my(ands=0); fordiv(n,d,if(d<(n/d), ands += bitand(d,n/d))); (ands); };

Formula

a(n) = A000203(n) - A318461(n) = (A000203(n)-A318462(n))/2.

A318518 a(n) = A032742(n) AND n-A032742(n), where AND is bitwise-and (A004198) and A032742 = the largest proper divisor of n.

Original entry on oeis.org

0, 1, 0, 2, 0, 3, 0, 4, 2, 5, 0, 6, 0, 7, 0, 8, 0, 9, 0, 10, 6, 11, 0, 12, 4, 13, 0, 14, 0, 15, 0, 16, 2, 17, 4, 18, 0, 19, 8, 20, 0, 21, 0, 22, 14, 23, 0, 24, 2, 25, 0, 26, 0, 27, 8, 28, 2, 29, 0, 30, 0, 31, 0, 32, 4, 33, 0, 34, 6, 35, 0, 36, 0, 37, 16, 38, 2, 39, 0, 40, 18, 41, 0, 42, 0, 43, 24, 44, 0, 45, 12, 46, 30, 47, 0, 48, 0, 49, 0, 50, 0, 51, 0
Offset: 1

Views

Author

Antti Karttunen, Aug 28 2018

Keywords

Crossrefs

Programs

Formula

a(n) = A004198(A032742(n), A060681(n)).
a(n) = n - A318516(n) = (n - A318517(n))/2.

A283978 a(2n) = 0, a(2n+1) = A002487(n) AND A002487(n+1), where AND is bitwise-and (A004198).

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Mar 21 2017

Keywords

Crossrefs

Programs

  • Mathematica
    a[0] = 0; a[1] = 1; a[n_] := If[EvenQ@ n, a[n/2], a[(n - 1)/2] + a[(n + 1)/2]]; Table[If[EvenQ@ n, 0, BitAnd[a[#], a[# + 1]] &[(n - 1)/2]], {n, 0, 120}] (* Michael De Vlieger, Mar 22 2017 *)
  • PARI
    A(n) = if(n<2, n, if(n%2, A(n\2) + A((n + 1)/2), A(n/2)));
    a(n) = if(n<2, 0, if(n%2, bitand(A(n\2), A((n + 1)/2)), 0));
    for(n=0, 120, print1(a(n), ", ")) \\ Indranil Ghosh, Mar 23 2017
  • Scheme
    (define (A283978 n) (if (even? n) 0 (A004198bi (A002487 (/ (- n 1) 2)) (A002487 (/ (+ n 1) 2))))) ;; Where A004198bi implements bitwise-AND (A004198).
    

Formula

a(2n) = 0, a(2n+1) = A002487(n) AND A002487(n+1), where AND is bitwise-and (A004198).
a(n) = A283976(n) - A283977(n).
a(n) = A002487(n) - A283976(n) = (A002487(n) - A283977(n))/2.

A285118 Triangle read by rows: T(0,n) = T(n,n) = 0; and for n > 0, 0 < k < n, T(n,k) = C(n-1,k-1) AND C(n-1,k), where C(n,k) is binomial coefficient (A007318) & AND is bitwise-AND (A004198).

Original entry on oeis.org

0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 3, 1, 0, 0, 0, 4, 4, 0, 0, 0, 1, 0, 10, 0, 1, 0, 0, 0, 6, 4, 4, 6, 0, 0, 0, 1, 5, 1, 35, 1, 5, 1, 0, 0, 0, 8, 24, 0, 0, 24, 8, 0, 0, 0, 1, 0, 4, 84, 126, 84, 4, 0, 1, 0, 0, 0, 8, 40, 80, 208, 208, 80, 40, 8, 0, 0, 0, 1, 3, 37, 0, 330, 462, 330, 0, 37, 3, 1, 0, 0, 0, 0, 64, 204, 264, 792, 792, 264, 204, 64, 0, 0, 0
Offset: 0

Views

Author

Antti Karttunen, Apr 16 2017

Keywords

Examples

			Rows 0-13 of array:
  0,
  0, 0,
  0, 1, 0,
  0, 0, 0, 0,
  0, 1, 3, 1, 0,
  0, 0, 4, 4, 0, 0,
  0, 1, 0, 10, 0, 1, 0,
  0, 0, 6, 4, 4, 6, 0, 0,
  0, 1, 5, 1, 35, 1, 5, 1, 0,
  0, 0, 8, 24, 0, 0, 24, 8, 0, 0,
  0, 1, 0, 4, 84, 126, 84, 4, 0, 1, 0,
  0, 0, 8, 40, 80, 208, 208, 80, 40, 8, 0, 0,
  0, 1, 3, 37, 0, 330, 462, 330, 0, 37, 3, 1, 0,
  0, 0, 0, 64, 204, 264, 792, 792, 264, 204, 64, 0, 0, 0
		

Crossrefs

Cf. A285115 (row sums).

Programs

  • Mathematica
    T[n_, k_]:= If[n==0 || n==k, 0, BitAnd[Binomial[n - 1, k - 1], Binomial[n - 1, k]]]; Table[T[n, k], {n, 0, 13}, {k, 0, n}] // Flatten (* Indranil Ghosh, Apr 16 2017 *)
  • PARI
    T(n, k) = if (n==0 || n==k, 0, bitand(binomial(n - 1, k - 1), binomial(n - 1, k)));
    for(n=0, 13, for(k=0, n, print1(T(n, k),", ");); print();) \\ Indranil Ghosh, Apr 16 2017
  • Scheme
    (define (A285118 n) (A285118tr (A003056 n) (A002262 n)))
    (define (A285118tr n k) (cond ((zero? k) 0) ((= k n) 0) (else (A004198bi (A007318tr (- n 1) (- k 1)) (A007318tr (- n 1) k))))) ;; Where A004198bi implements bitwise-AND (A004198) and A007318tr gives the binomial coefficients (A007318).
    

Formula

T(0,n) = T(n,n) = 0; and for n > 0, 0 < k < n, T(n,k) = C(n-1,k-1) AND C(n-1,k), where C(n,k) is binomial coefficient (A007318) & AND is bitwise-AND (A004198).
T(n,k) = A285116(n,k) - A285117(n,k).
A007318(n,k) = C(n,k) = A285116(n,k) + T(n,k) = A285117(n,k) + 2*T(n,k).

A324643 Numbers k such that bitand(2k,sigma(k))/2 = k = bitand(k,sigma(k)-k), where bitand is bitwise-AND, A004198.

Original entry on oeis.org

6, 20, 28, 36, 88, 100, 104, 264, 272, 304, 368, 392, 464, 496, 550, 784, 1032, 1040, 1044, 1056, 1068, 1104, 1120, 1184, 1232, 1312, 1376, 1504, 1696, 1888, 1952, 2140, 3222, 4100, 4128, 4160, 4288, 4512, 4544, 4624, 4640, 4672, 5056, 5312, 5696, 6208, 6328, 6464, 6592, 6808, 6848, 6976, 7232, 7304, 8128, 8288, 8968, 9256, 10184
Offset: 1

Views

Author

Antti Karttunen, Mar 14 2019

Keywords

Comments

Numbers k for which k = A318458(k)/2 = A318468(k).
Intersection of A324649 and A324652.
It is conjectured that there are no odd terms in this sequence, which is equivalent to the conjecture that there are no odd perfect numbers.
Question: Where do the densest clusters of terms occur? See also the scatter plot. - Antti Karttunen, Mar 12 2024
As A324649 and A324652 are both subsequences of nondeficient numbers (A023196), also this sequence is, which stems from the "monotonic property" of bitwise-and. - Antti Karttunen, Jan 08 2025

Crossrefs

Intersection of A324649 and A324652.
Subsequence of A023196 and of A324639.

Programs

  • Mathematica
    Select[Range[10^4], Block[{s = DivisorSigma[1, #]}, # == BitAnd[#, s-#] && 2*# == BitAnd[2*#, s]] &] (* Paolo Xausa, Mar 11 2024 *)
  • PARI
    for(n=1,oo,if( (bitand(n, sigma(n)-n)==n) && (bitand(n+n, sigma(n))==2*n),print1(n,", ")))

A324716 a(n) = 2*A156552(n) - bitand(2*A156552(n), A323243(n)), where bitand is bitwise-AND, A004198.

Original entry on oeis.org

0, 2, 4, 2, 8, 8, 16, 6, 0, 18, 32, 18, 64, 32, 4, 6, 128, 16, 256, 34, 0, 66, 512, 38, 0, 130, 4, 70, 1024, 10, 2048, 30, 64, 258, 0, 22, 4096, 512, 4, 70, 8192, 72, 16384, 130, 8, 1026, 32768, 78, 0, 32, 256, 258, 65536, 32, 0, 134, 4, 2048, 131072, 82, 262144, 4098, 64, 22, 128, 138, 524288, 518, 1024, 80, 1048576, 38, 2097152, 8194, 20, 1030, 0, 266
Offset: 1

Views

Author

Antti Karttunen, Mar 15 2019

Keywords

Comments

Equivalently, a(n) = 2*A156552(n) XOR (2*A156552(n) AND A323243(n)).

Crossrefs

Cf. A003987, A004198, A156552, A323243, A324717, A324722 (positions of zeros).

Programs

A283974 Numbers n for which A002487(n-1) AND A002487(n) > 0 where AND is bitwise-and (A004198).

Original entry on oeis.org

2, 5, 6, 7, 8, 11, 14, 17, 18, 19, 20, 23, 24, 25, 26, 29, 30, 31, 32, 34, 35, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 62, 63, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 79, 80, 81, 82, 83, 86, 89, 92, 95, 96, 97, 98, 101, 104, 107, 110, 111, 112, 113, 114, 116, 117, 118, 119, 120
Offset: 1

Views

Author

Antti Karttunen, Mar 21 2017

Keywords

Comments

Numbers n such that the binary representations of A002487(n-1) and A002487(n) have at least one 1-bit in a common shared position.

Crossrefs

Cf. A283973 (complement).
Positions of nonzeros in A283988.

Programs

  • Mathematica
    a[0] = 0; a[1] = 1; a[n_] := If[EvenQ@ n, a[n/2], a[(n - 1)/2] + a[(n + 1)/2]]; Flatten@ Position[Table[BitAnd[a[n - 1], a@ n], {n, 120}], k_ /; k > 0] (* Michael De Vlieger, Mar 22 2017 *)
  • PARI
    A(n) = if(n<2, n, if(n%2, A(n\2) + A((n + 1)/2), A(n/2)));
    D(n) = if(n<1, 1, sum(k=0, n, binomial(n + k - 1, 2*k)%2))
    for(n=1, 120, if(bitor(A(n - 1), A(n)) != D(n), print1(n, ", "))) \\ Indranil Ghosh, Mar 23 2017

A283998 a(n) = n AND A005187(floor(n/2)), where AND is bitwise-and (A004198).

Original entry on oeis.org

0, 0, 0, 1, 0, 1, 4, 4, 0, 1, 8, 8, 8, 8, 10, 11, 0, 1, 16, 16, 16, 16, 18, 19, 16, 16, 18, 19, 24, 25, 26, 26, 0, 1, 32, 32, 32, 32, 34, 35, 32, 32, 34, 35, 40, 41, 42, 42, 32, 32, 34, 35, 48, 49, 50, 50, 48, 49, 50, 50, 56, 56, 56, 57, 0, 1, 64, 64, 64, 64, 66, 67, 64, 64, 66, 67, 72, 73, 74, 74, 64, 64, 66, 67, 80, 81, 82, 82, 80, 81, 82, 82, 88, 88, 88, 89
Offset: 0

Views

Author

Antti Karttunen, Mar 19 2017

Keywords

Crossrefs

Programs

  • Mathematica
    A[n_]:=2*n - DigitCount[2*n, 2, 1];Table[BitAnd[n, A[Floor[n/2]]], {n, 0, 100}] (* Indranil Ghosh, Mar 25 2017 *)
  • PARI
    b(n) = if(n<1, 0, b(n\2) + n%2);
    A(n) = 2*n - b(2*n);
    for(n=0, 100, print1(bitand(n, A(floor(n/2))),", ")) \\ Indranil Ghosh, Mar 25 2017
    
  • Python
    def A(n): return 2*n - bin(2*n)[2:].count("1")
    print([n&A(n//2) for n in range(101)]) # Indranil Ghosh, Mar 25 2017
  • Scheme
    (define (A283998 n) (A004198bi n (A005187 (floor->exact (/ n 2))))) ;; Where A004198bi implements bitwise-AND (A004198).
    

Formula

a(n) = n AND A005187(floor(n/2)), where AND is bitwise-and (A004198).
a(n) = A283996(n) - A283997(n).
a(n) = A005187(n) - A283996(n) = (A005187(n) - A283997(n))/2.

A318515 a(n) = n AND A032742(n), where AND is bitwise-and (A004198) and A032742 = the largest proper divisor of n.

Original entry on oeis.org

1, 0, 1, 0, 1, 2, 1, 0, 1, 0, 1, 4, 1, 6, 5, 0, 1, 0, 1, 0, 5, 2, 1, 8, 1, 8, 9, 12, 1, 14, 1, 0, 1, 0, 3, 0, 1, 2, 5, 0, 1, 0, 1, 4, 13, 6, 1, 16, 1, 16, 17, 16, 1, 18, 3, 24, 17, 24, 1, 28, 1, 30, 21, 0, 1, 0, 1, 0, 5, 2, 1, 0, 1, 0, 9, 4, 9, 6, 1, 0, 17, 0, 1, 0, 17, 2, 21, 8, 1, 8, 9, 12, 29, 14, 19, 32, 1, 32, 33, 32, 1, 34, 1, 32, 33
Offset: 1

Views

Author

Antti Karttunen, Aug 28 2018

Keywords

Crossrefs

Programs

Formula

a(n) = A004198(n, A032742(n)).
a(n) = n + A032742(n) - A318514(n) = (n+A032742(n)-A106409(n))/2.
Previous Showing 11-20 of 96 results. Next