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

A318458 a(n) = n AND A001065(n), where AND is bitwise-and (A004198) & A001065 = sum of proper divisors.

Original entry on oeis.org

0, 0, 1, 0, 1, 6, 1, 0, 0, 8, 1, 0, 1, 10, 9, 0, 1, 16, 1, 20, 1, 6, 1, 0, 0, 16, 9, 28, 1, 10, 1, 0, 1, 0, 1, 36, 1, 6, 1, 32, 1, 34, 1, 40, 33, 10, 1, 0, 0, 34, 17, 36, 1, 2, 17, 0, 17, 32, 1, 44, 1, 34, 41, 0, 1, 66, 1, 0, 1, 66, 1, 72, 1, 8, 1, 64, 1, 74, 1, 64, 0, 0, 1, 4, 21, 6, 1, 88, 1, 16, 17, 76, 1, 18, 25, 0, 1, 64, 33, 100, 1, 98, 1, 104, 65
Offset: 1

Views

Author

Antti Karttunen, Aug 26 2018

Keywords

Comments

The peculiar look of the scatterplot is partly an artifact of the logarithmic scale. Compare also to the scatterplot of A318468.

Crossrefs

Programs

  • Magma
    [SumOfDivisors(n)-BitwiseOr(n, SumOfDivisors(n)-n): n in [1..100]]; // Vincenzo Librandi, Aug 29 2018
  • Mathematica
    Table[BitAnd[n, DivisorSigma[1, n] - n], {n, 100}] (* Vincenzo Librandi, Aug 29 2018 *)
  • PARI
    A318458(n) = bitand(n,sigma(n)-n);
    

Formula

a(n) = A004198(n, A001065(n)).
a(n) = A000203(n) - A318456(n) = (A000203(n)-A318457(n))/2.

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

Original entry on oeis.org

0, 0, 0, 1, 0, 0, 2, 3, 0, 0, 0, 1, 4, 4, 6, 7, 0, 0, 0, 1, 0, 0, 2, 3, 8, 8, 8, 9, 12, 12, 14, 15, 0, 0, 0, 1, 0, 0, 2, 3, 0, 0, 0, 1, 4, 4, 6, 7, 16, 16, 16, 17, 16, 16, 18, 19, 24, 24, 24, 25, 28, 28, 30, 31, 0, 0, 0, 1, 0, 0, 2, 3, 0, 0, 0, 1, 4, 4, 6, 7, 0
Offset: 0

Views

Author

Antti Karttunen, Apr 26 1999

Keywords

Comments

To prove that (n AND floor(n/2)) = (3n-(n XOR 2n))/4 (= A048728(n)/4), we first multiply both sides by 4, to get 2*(n AND 2n) = (3n - (n XOR 2n)) and then rearrange terms: 3n = (n XOR 2n) + 2*(n AND 2n), which fits perfectly to the identity A+B = (A XOR B) + 2*(A AND B) (given by Schroeppel in HAKMEM link).
The number of 1's through 4*2^n appears to yield A000045(n+1). - Ben Burns, Jun 12 2017

Crossrefs

Cf. A003714 (positions of zeros), A003188, A050600.

Programs

  • Maple
    seq(Bits:-And(n,floor(n/2)), n=0..200); # Robert Israel, Feb 29 2016
  • Mathematica
    Table[BitAnd[n, Floor[n/2]], {n, 0, 127}] (* T. D. Noe, Aug 13 2012 *)
  • PARI
    a(n) = bitand(n, n\2); \\ Michel Marcus, Feb 29 2016
    
  • Python
    def a(n): return n&int(n/2) # Indranil Ghosh, Jun 13 2017

Formula

a(n) = A048728(n)/4. (This was the original definition. AND-formula found Jan 01 2007).

Extensions

New formula and more terms added by Antti Karttunen, Jan 01 2007

A318468 a(n) = 2*n AND A000203(n), where AND is bitwise-and (A004198) and A000203 = sum of divisors.

Original entry on oeis.org

0, 0, 4, 0, 2, 12, 8, 0, 0, 16, 4, 24, 10, 24, 24, 0, 2, 36, 4, 40, 32, 36, 8, 48, 18, 32, 32, 56, 26, 8, 32, 0, 0, 4, 0, 72, 2, 12, 8, 80, 2, 64, 4, 80, 74, 72, 16, 96, 32, 68, 64, 96, 34, 104, 72, 112, 80, 80, 52, 40, 58, 96, 104, 0, 0, 128, 4, 8, 0, 128, 8, 128, 2, 16, 20, 136, 0, 136, 16, 160, 32, 36, 4, 160, 40, 132, 40, 176, 18, 160, 48
Offset: 1

Views

Author

Antti Karttunen, Aug 26 2018

Keywords

Crossrefs

Programs

  • Mathematica
    Array[BitAnd[2 #, DivisorSigma[1, #]] &, 91] (* Michael De Vlieger, Apr 21 2019 *)
  • PARI
    A318468(n) = bitand(2*n,sigma(n));

Formula

a(n) = A004198(2*n, A000203(n)).
a(n) = A224880(n) - A318466(n) = (A224880(n)-A318467(n))/2.

A283988 a(n) = A002487(n-1) AND A002487(n), where AND is bitwise-and (A004198).

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Mar 21 2017

Keywords

Crossrefs

Odd bisection of A283978.
Cf. A283973 (positions of zeros), A283974 (nonzeros).

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[BitAnd[a[n - 1], a@ n], {n, 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)));
    for(n=1, 120, print1(bitand(A(n - 1), A(n)),", ")) \\ Indranil Ghosh, Mar 23 2017
    
  • Python
    from functools import reduce
    def A283988(n): return sum(reduce(lambda x,y:(x[0],x[0]+x[1]) if int(y) else (x[0]+x[1],x[1]),bin(n)[-1:2:-1],(1,0)))&sum(reduce(lambda x,y:(x[0],x[0]+x[1]) if int(y) else (x[0]+x[1],x[1]),bin(n-1)[-1:2:-1],(1,0))) if n>1 else 0 # Chai Wah Wu, May 05 2023
  • Scheme
    (define (A283988 n) (A004198bi (A002487 (- n 1)) (A002487 n)))  ;; Where A004198bi implements bitwise-AND (A004198).
    

Formula

a(n) = A002487(n-1) AND A002487(n), where AND is bitwise-and (A004198).
a(n) = A283986(n) - A283987(n).
a(n) = A007306(n) - A283986(n) = (A007306(n) - A283987(n))/2.
a(n) = A283978((2*n)-1).

A286108 Square array read by antidiagonals: A(n,k) = T(2*(n AND k), n XOR k), where T(n,k) is sequence A001477 considered as a two-dimensional table, AND is bitwise-and (A004198) and XOR is bitwise-xor (A003987).

Original entry on oeis.org

0, 1, 1, 3, 5, 3, 6, 6, 6, 6, 10, 12, 14, 12, 10, 15, 15, 19, 19, 15, 15, 21, 23, 21, 27, 21, 23, 21, 28, 28, 28, 28, 28, 28, 28, 28, 36, 38, 40, 38, 44, 38, 40, 38, 36, 45, 45, 49, 49, 53, 53, 49, 49, 45, 45, 55, 57, 55, 61, 63, 65, 63, 61, 55, 57, 55, 66, 66, 66, 66, 74, 74, 74, 74, 66, 66, 66, 66, 78, 80, 82, 80, 78, 88, 90, 88, 78, 80, 82, 80, 78
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,  1,   3,   6,  10,  15,  21,  28,  36,  45,  55,  66,  78
   1,  5,   6,  12,  15,  23,  28,  38,  45,  57,  66,  80,  91
   3,  6,  14,  19,  21,  28,  40,  49,  55,  66,  82,  95, 105
   6, 12,  19,  27,  28,  38,  49,  61,  66,  80,  95, 111, 120
  10, 15,  21,  28,  44,  53,  63,  74,  78,  91, 105, 120, 144
  15, 23,  28,  38,  53,  65,  74,  88,  91, 107, 120, 138, 161
  21, 28,  40,  49,  63,  74,  90, 103, 105, 120, 140, 157, 179
  28, 38,  49,  61,  74,  88, 103, 119, 120, 138, 157, 177, 198
  36, 45,  55,  66,  78,  91, 105, 120, 152, 169, 187, 206, 226
  45, 57,  66,  80,  91, 107, 120, 138, 169, 189, 206, 228, 247
  55, 66,  82,  95, 105, 120, 140, 157, 187, 206, 230, 251, 269
  66, 80,  95, 111, 120, 138, 157, 177, 206, 228, 251, 275, 292
  78, 91, 105, 120, 144, 161, 179, 198, 226, 247, 269, 292, 324
		

Crossrefs

Cf. A000217 (row 0 & column 0), A014106 (main diagonal).

Programs

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

Formula

A(n,k) = T(2*A004198(n,k), A003987(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, ...].

A286109 Square array read by antidiagonals: A(n,k) = T(n XOR k, 2*(n AND k)), where T(n,k) is sequence A001477 considered as a two-dimensional table, AND is bitwise-and (A004198) and XOR is bitwise-xor (A003987).

Original entry on oeis.org

0, 2, 2, 5, 3, 5, 9, 9, 9, 9, 14, 12, 10, 12, 14, 20, 20, 16, 16, 20, 20, 27, 25, 27, 21, 27, 25, 27, 35, 35, 35, 35, 35, 35, 35, 35, 44, 42, 40, 42, 36, 42, 40, 42, 44, 54, 54, 50, 50, 46, 46, 50, 50, 54, 54, 65, 63, 65, 59, 57, 55, 57, 59, 65, 63, 65, 77, 77, 77, 77, 69, 69, 69, 69, 77, 77, 77, 77, 90, 88, 86, 88, 90, 80, 78, 80, 90, 88, 86, 88, 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,   3,   9,  12,  20,  25,  35,  42,  54,  63,  77,  88, 104
   5,   9,  10,  16,  27,  35,  40,  50,  65,  77,  86, 100, 119
   9,  12,  16,  21,  35,  42,  50,  59,  77,  88, 100, 113, 135
  14,  20,  27,  35,  36,  46,  57,  69,  90, 104, 119, 135, 144
  20,  25,  35,  42,  46,  55,  69,  80, 104, 117, 135, 150, 162
  27,  35,  40,  50,  57,  69,  78,  92, 119, 135, 148, 166, 181
  35,  42,  50,  59,  69,  80,  92, 105, 135, 150, 166, 183, 201
  44,  54,  65,  77,  90, 104, 119, 135, 136, 154, 173, 193, 214
  54,  63,  77,  88, 104, 117, 135, 150, 154, 171, 193, 212, 236
  65,  77,  86, 100, 119, 135, 148, 166, 173, 193, 210, 232, 259
  77,  88, 100, 113, 135, 150, 166, 183, 193, 212, 232, 253, 283
  90, 104, 119, 135, 144, 162, 181, 201, 214, 236, 259, 283, 300
		

Crossrefs

Cf. A000096 (row 0 & column 0), A014105 (main diagonal).

Programs

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

Formula

A(n,k) = T(A003987(n,k), 2*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, ...].

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

Original entry on oeis.org

0, 0, 0, 0, 0, 3, 0, 0, 1, 1, 0, 2, 0, 3, 4, 0, 0, 8, 0, 8, 4, 3, 0, 8, 1, 1, 0, 14, 0, 11, 0, 0, 0, 1, 6, 0, 0, 3, 4, 20, 0, 1, 0, 18, 2, 3, 0, 16, 1, 16, 0, 16, 0, 3, 2, 4, 0, 1, 0, 14, 0, 3, 20, 0, 4, 33, 0, 0, 4, 35, 0, 4, 0, 1, 24, 2, 8, 35, 0, 0, 9, 1, 0, 34, 0, 3, 4, 32, 0, 33, 8, 14, 4, 3, 2, 32, 0, 16, 0, 2, 0, 51, 0, 52, 32
Offset: 1

Views

Author

Antti Karttunen, Aug 28 2018

Keywords

Crossrefs

Programs

Formula

a(n) = A004198(A032742(n), A318505(n)).
For n > 1, a(n) = A001065(n) - A318506(n) = (A001065(n) - A318507(n))/2.

A324718 Odd numbers n for which bitand(2n,sigma(n)) = 2*bitand(n,sigma(n)-n), where bitand is bitwise-AND, A004198.

Original entry on oeis.org

1, 5, 9, 17, 37, 41, 73, 137, 149, 153, 257, 261, 277, 293, 337, 405, 521, 529, 549, 577, 593, 641, 661, 673, 677, 1025, 1033, 1061, 1093, 1097, 1109, 1153, 1193, 1289, 1297, 1301, 1321, 1361, 2053, 2069, 2081, 2089, 2097, 2113, 2129, 2209, 2213, 2225, 2309, 2341, 2377, 2389, 2593, 2633, 2689, 2693, 2729, 2825, 4129, 4133, 4177, 4229
Offset: 1

Views

Author

Antti Karttunen, Mar 14 2019

Keywords

Comments

Odd numbers n for which 2*A318458(n) = A318468(n). If there are no common terms with A324719, then there are no odd perfect numbers.
This is not a subsequence of A191218, because terms 1, 9, 529, 2209, 10609, 77841, 83521, 263169, 279841, 330625, 528529, ... are not present in A191218.

Crossrefs

Programs

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

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

Original entry on oeis.org

0, 0, 0, 4, 0, 2, 0, 8, 12, 0, 0, 4, 0, 2, 16, 24, 0, 10, 0, 4, 36, 0, 0, 8, 24, 0, 24, 0, 0, 32, 0, 32, 4, 0, 40, 32, 0, 2, 128, 8, 0, 2, 0, 4, 36, 0, 0, 16, 48, 18, 4, 4, 0, 26, 72, 8, 512, 2, 0, 4, 0, 0, 12, 104, 8, 0, 0, 0, 4, 2, 0, 72, 0, 0, 32, 0, 80, 0, 0, 16, 8, 0, 0, 20, 256, 0, 2048, 0, 0, 74, 128, 0, 0, 0, 520, 56, 0, 32, 128, 64, 0, 2, 0, 8, 64
Offset: 1

Views

Author

Antti Karttunen, Mar 17 2019

Keywords

Crossrefs

Programs

Formula

a(n) = 2*A156552(n) AND A323243(n), where AND is A004198.
a(n) = 2*A156552(n) - A324716(n) = 2*A156552(n) XOR A324716(n), where XOR is A003987.
For n > 1, a(n) = A318468(A156552(n)).
a(p) = 0 for all primes p.
a(A324201(n)) = A139256(n).
A000120(a(n)) = A324816(n).

A286098 Square array read by antidiagonals: A(n,k) = T(n AND k, n OR 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, 1, 1, 3, 4, 3, 6, 6, 6, 6, 10, 11, 12, 11, 10, 15, 15, 17, 17, 15, 15, 21, 22, 21, 24, 21, 22, 21, 28, 28, 28, 28, 28, 28, 28, 28, 36, 37, 38, 37, 40, 37, 38, 37, 36, 45, 45, 47, 47, 49, 49, 47, 47, 45, 45, 55, 56, 55, 58, 59, 60, 59, 58, 55, 56, 55, 66, 66, 66, 66, 70, 70, 70, 70, 66, 66, 66, 66, 78, 79, 80, 79, 78, 83, 84, 83, 78, 79, 80, 79, 78
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,  1,   3,   6,  10,  15,  21,  28,  36,  45,  55,  66,  78
   1,  4,   6,  11,  15,  22,  28,  37,  45,  56,  66,  79,  91
   3,  6,  12,  17,  21,  28,  38,  47,  55,  66,  80,  93, 105
   6, 11,  17,  24,  28,  37,  47,  58,  66,  79,  93, 108, 120
  10, 15,  21,  28,  40,  49,  59,  70,  78,  91, 105, 120, 140
  15, 22,  28,  37,  49,  60,  70,  83,  91, 106, 120, 137, 157
  21, 28,  38,  47,  59,  70,  84,  97, 105, 120, 138, 155, 175
  28, 37,  47,  58,  70,  83,  97, 112, 120, 137, 155, 174, 194
  36, 45,  55,  66,  78,  91, 105, 120, 144, 161, 179, 198, 218
  45, 56,  66,  79,  91, 106, 120, 137, 161, 180, 198, 219, 239
  55, 66,  80,  93, 105, 120, 138, 155, 179, 198, 220, 241, 261
  66, 79,  93, 108, 120, 137, 155, 174, 198, 219, 241, 264, 284
  78, 91, 105, 120, 140, 157, 175, 194, 218, 239, 261, 284, 312
		

Crossrefs

Cf. A000217 (row 0 & column 0), A084263 (seems to be row 1 & column 1), A046092 (main diagonal).
Cf. also arrays A286099, A286101, A286102, A286108.

Programs

  • Mathematica
    T[a_, b_]:=((a + b)^2 + 3a + b)/2; A[n_, k_]:=T[BitAnd[n, k],BitOr[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 (A286098 n) (A286098bi (A002262 n) (A025581 n)))
    (define (A286098bi row col) (let ((a (A004198bi row col)) (b (A003986bi 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(A004198(n,k), A003986(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, ...].
Showing 1-10 of 96 results. Next