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

A324819 a(n) = 2*A156552(n) OR A323243(n), where OR is bitwise-OR, A003986.

Original entry on oeis.org

0, 3, 7, 6, 15, 14, 31, 14, 12, 31, 63, 30, 127, 50, 22, 30, 255, 30, 511, 54, 39, 114, 1023, 62, 28, 214, 28, 118, 2047, 42, 4095, 62, 118, 434, 42, 62, 8191, 770, 148, 126, 16383, 110, 32767, 198, 44, 1826, 65535, 126, 60, 63, 508, 390, 131071, 62, 91, 206, 532, 3350, 262143, 126, 524287, 6834, 124, 126, 254, 234, 1048575, 822
Offset: 1

Views

Author

Antti Karttunen, Mar 18 2019

Keywords

Crossrefs

Programs

  • PARI
    A156552(n) = {my(f = factor(n), p2 = 1, res = 0); for(i = 1, #f~, p = 1 << (primepi(f[i, 1]) - 1); res += (p * p2 * (2^(f[i, 2]) - 1)); p2 <<= f[i, 2]); res}; \\ From A156552
    A324819(n) = bitor(2*A156552(n),A323243(n)); \\ Needs code also from A323243.

Formula

a(A000040(n)) = A000225(1+n).

A324821 Xor-Moebius transform of A324819, where A324819(n) = bitor(2*A156552(n), A323243(n)), where bitor is A003986.

Original entry on oeis.org

0, 3, 7, 5, 15, 10, 31, 8, 11, 19, 63, 21, 127, 46, 30, 16, 255, 27, 511, 44, 63, 78, 1023, 40, 19, 170, 16, 65, 2047, 38, 4095, 32, 78, 334, 58, 48, 8191, 766, 236, 64, 16383, 110, 32767, 177, 49, 1246, 65535, 80, 35, 51, 260, 341, 131071, 48, 107, 176, 1004, 2794, 262143, 104, 524287, 5454, 80, 64, 142, 219, 1048575, 641, 1278, 110
Offset: 1

Views

Author

Antti Karttunen, Mar 18 2019

Keywords

Comments

It seems that the records, which are A000225(1+n) = 2^(1+n) - 1 occur at primes, as occur also the records for the width of terms, A000523(a(n)), and the records for the binary weight of terms, A000120(a(n)).

Crossrefs

Programs

  • PARI
    A156552(n) = {my(f = factor(n), p2 = 1, res = 0); for(i = 1, #f~, p = 1 << (primepi(f[i, 1]) - 1); res += (p * p2 * (2^(f[i, 2]) - 1)); p2 <<= f[i, 2]); res}; \\ From A156552 by David A. Corneth
    A324819(n) = bitor(2*A156552(n),A323243(n)); \\ Needs code also from A323243.
    A324821(n) = { my(v=0); fordiv(n, d, if(issquarefree(n/d), v=bitxor(v, A324819(d)))); (v); };

Formula

a(A000040(n)) = A000225(1+n).

A283976 a(2n) = A002487(n), a(2n+1) = A002487(n) OR A002487(n+1), where OR is bitwise-or (A003986).

Original entry on oeis.org

0, 1, 1, 1, 1, 3, 2, 3, 1, 3, 3, 3, 2, 3, 3, 3, 1, 5, 4, 7, 3, 7, 5, 7, 2, 7, 5, 7, 3, 7, 4, 5, 1, 5, 5, 5, 4, 7, 7, 7, 3, 11, 8, 13, 5, 7, 7, 7, 2, 7, 7, 7, 5, 13, 8, 11, 3, 7, 7, 7, 4, 5, 5, 5, 1, 7, 6, 7, 5, 13, 9, 13, 4, 15, 11, 15, 7, 15, 10, 11, 3, 11, 11, 11, 8, 13, 13, 13, 5, 13, 12, 15, 7, 15, 9, 11, 2, 11, 9, 15, 7, 15, 12, 13, 5, 13, 13, 13, 8
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, a[n/2], BitOr[a[#], a[# + 1]] &[(n - 1)/2]], {n, 0, 108}] (* 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, n, if(n%2, bitor(A(n\2), A((n + 1)/2)), A(n\2)));
    for(n=0, 101, print1(a(n),", ")) \\ Indranil Ghosh, Mar 23 2017
  • Scheme
    (define (A283976 n) (if (even? n) (A002487 n) (A003986bi (A002487 (/ (- n 1) 2)) (A002487 (/ (+ n 1) 2))))) ;; Where A003986bi implements bitwise-OR (A003986).
    

Formula

a(2n) = A002487(2n) = A002487(n), a(2n+1) = A002487(n) OR A002487(n+1), where OR is bitwise-or (A003986).
a(n) = A283977(n) + A283978(n).
a(n) = A002487(n) - A283978(n).

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

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 3, 3, 1, 1, 3, 3, 3, 1, 1, 5, 6, 6, 5, 1, 1, 5, 15, 10, 15, 5, 1, 1, 7, 15, 31, 31, 15, 7, 1, 1, 7, 23, 55, 35, 55, 23, 7, 1, 1, 9, 28, 60, 126, 126, 60, 28, 9, 1, 1, 9, 45, 116, 126, 126, 126, 116, 45, 9, 1, 1, 11, 47, 125, 250, 254, 254, 250, 125, 47, 11, 1, 1, 11, 63, 183, 495, 462, 462, 462, 495, 183, 63, 11, 1
Offset: 0

Views

Author

Antti Karttunen, Apr 16 2017

Keywords

Examples

			Rows 0 - 12 of the triangle:
  1,
  1, 1,
  1, 1, 1,
  1, 3, 3, 1,
  1, 3, 3, 3, 1,
  1, 5, 6, 6, 5, 1,
  1, 5, 15, 10, 15, 5, 1,
  1, 7, 15, 31, 31, 15, 7, 1,
  1, 7, 23, 55, 35, 55, 23, 7, 1,
  1, 9, 28, 60, 126, 126, 60, 28, 9, 1,
  1, 9, 45, 116, 126, 126, 126, 116, 45, 9, 1,
  1, 11, 47, 125, 250, 254, 254, 250, 125, 47, 11, 1,
  1, 11, 63, 183, 495, 462, 462, 462, 495, 183, 63, 11, 1
		

Crossrefs

Cf. A285113 (row sums).

Programs

  • Mathematica
    T[n_, k_]:= If[n==0 || n==k, 1, BitOr[Binomial[n - 1, k - 1], Binomial[n - 1, k]]]; Table[T[n, k], {n, 0, 12}, {k, 0, n}] // Flatten (* Indranil Ghosh, Apr 16 2017 *)
  • PARI
    T(n, k) = if (n==0 || n==k, 1, bitor(binomial(n - 1, k - 1), binomial(n - 1, k)));
    for(n=0, 12, for(k=0, n, print1(T(n, k),", ");); print();) \\ Indranil Ghosh, Apr 16 2017
  • Scheme
    (define (A285116 n) (A285116tr (A003056 n) (A002262 n)))
    (define (A285116tr n k) (cond ((zero? k) 1) ((= k n) 1) (else (A003986tr (A007318tr (- n 1) (- k 1)) (A007318tr (- n 1) k))))) ;; Where A003986bi implements bitwise-OR (A003986) and A007318tr gives the binomial coefficients (A007318).
    

Formula

T(0,n) = T(n,n) = 1; and for n > 0, 0 < k < n, T(n,k) = C(n-1,k-1) OR C(n-1,k), where C(n,k) is binomial coefficient (A007318) and OR is bitwise-OR (A003986).
T(n,k) = A285117(n,k) + A285118(n,k).
C(n,k) = T(n,k) + A285118(n,k). [Where C(n,k) = A007318.]

A318461 a(n) = Sum_{d|n, d <= n/d} (d OR n/d), where OR is bitwise-or (A003986).

Original entry on oeis.org

1, 3, 3, 7, 5, 10, 7, 15, 12, 18, 11, 26, 13, 22, 22, 31, 17, 37, 19, 36, 28, 34, 23, 56, 30, 42, 38, 50, 29, 64, 31, 63, 44, 54, 42, 89, 37, 58, 54, 90, 41, 88, 43, 82, 73, 70, 47, 120, 56, 93, 70, 92, 53, 116, 70, 116, 76, 90, 59, 156, 61, 94, 101, 127, 78, 140, 67, 124, 92, 136, 71, 183, 73, 114, 117, 138, 92, 160, 79
Offset: 1

Views

Author

Antti Karttunen, Aug 28 2018

Keywords

Crossrefs

Programs

  • PARI
    A318461(n) = { my(ors=0); fordiv(n,d,if(d<=(n/d), ors += bitor(d,n/d))); (ors); };

Formula

a(n) = A000203(n) - A318463(n).

A324726 Numbers k such that 2*k is equal to 2*k OR sigma(k), where OR is bitwise-or, A003986, and sigma is the sum of divisors function.

Original entry on oeis.org

3, 6, 7, 14, 15, 21, 22, 28, 31, 46, 55, 57, 62, 63, 86, 92, 93, 94, 105, 110, 111, 124, 127, 154, 170, 171, 188, 189, 190, 201, 213, 215, 217, 231, 237, 248, 249, 250, 253, 254, 255, 310, 315, 316, 351, 357, 363, 369, 374, 376, 381, 382, 393, 430, 434, 447, 465, 469, 473, 483, 489, 494, 496, 497, 501, 506, 508, 511, 602
Offset: 1

Views

Author

Antti Karttunen, Mar 15 2019

Keywords

Comments

Intersection with A324652 gives A000396.
These are all nonabundant (in A263837) because of the "monotonic property" of bitwise-or. - Antti Karttunen, Jan 08 2025

Crossrefs

Cf. A000396, A003986, A318466, A324652, A324723, A324727 (the odd terms).
Subsequence of A263837.

Programs

  • Mathematica
    Select[Range[1000], 2*# == BitOr[2*#, DivisorSigma[1, #]] &] (* Paolo Xausa, Mar 11 2024 *)
  • PARI
    for(n=1, oo, if(((2*n)==bitor(2*n, sigma(n))), print1(n, ", ")));

Formula

{k such that 2*k = A318466(k)}.

A350093 a(n) = Sum_{k=0..n} n OR k where OR is the bitwise logical OR operator (A003986).

Original entry on oeis.org

0, 2, 7, 12, 26, 34, 45, 56, 100, 114, 131, 148, 174, 194, 217, 240, 392, 418, 447, 476, 514, 546, 581, 616, 684, 722, 763, 804, 854, 898, 945, 992, 1552, 1602, 1655, 1708, 1770, 1826, 1885, 1944, 2036, 2098, 2163, 2228, 2302, 2370, 2441, 2512, 2712, 2786, 2863
Offset: 0

Views

Author

Kevin Ryde, Dec 14 2021

Keywords

Comments

The effect of n OR k is to force a 1-bit at all bit positions where n has a 1-bit, which means n*(n+1) in the sum. Bits of k where n has a 0-bit are NOT(n) AND k = n CNIMPL k so that a(n) = A350094(n) + n*(n+1).

Crossrefs

Cf. A003986 (bitwise OR), A001196 (bit doubling).
Row sums of A080098.
Other sums: A222423 (AND), A224915 (XOR), A265736 (IMPL), A350094 (CNIMPL).

Programs

  • PARI
    a(n) = (3*(n^2 + fromdigits(binary(n),4)) + 2*n) >> 2;

Formula

a(n) = ((3*n+2)*n + A001196(n)) / 4.
a(2*n) = 4*a(n) - n.
a(2*n+1) = 4*a(n) + 2*n + 2.
a(n) = A222423(n) + A224915(n), being OR = AND + XOR.

A276010 a(0) = 0, for n >= 1, a(n) = A275736(n) OR a(A257684(n)), where OR is given by A003986.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Aug 17 2016

Keywords

Crossrefs

Formula

a(0) = 0, for n >= 1, a(n) = A275736(n) OR a(A257684(n)), where OR is given by A003986.
a(n) = A087207(A275734(n)).
Other identities. For all n >= 1:
A000120(a(n)) = A060502(n).

A283996 a(n) = n OR A005187(floor(n/2)), where OR is bitwise-or (A003986).

Original entry on oeis.org

0, 1, 3, 3, 7, 7, 6, 7, 15, 15, 10, 11, 14, 15, 15, 15, 31, 31, 18, 19, 22, 23, 23, 23, 30, 31, 31, 31, 29, 29, 30, 31, 63, 63, 34, 35, 38, 39, 39, 39, 46, 47, 47, 47, 45, 45, 46, 47, 62, 63, 63, 63, 53, 53, 54, 55, 61, 61, 62, 63, 60, 61, 63, 63, 127, 127, 66, 67, 70, 71, 71, 71, 78, 79, 79, 79, 77, 77, 78, 79, 94, 95, 95, 95, 85, 85, 86, 87, 93, 93, 94, 95
Offset: 0

Views

Author

Antti Karttunen, Mar 19 2017

Keywords

Crossrefs

Programs

  • Mathematica
    A[n_]:=2*n - DigitCount[2*n, 2, 1]; Table[BitOr[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(bitor(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 (A283996 n) (A003986bi n (A005187 (floor->exact (/ n 2))))) ;; Where A003986bi implements bitwise-OR (A003986).
    

Formula

a(n) = n OR A005187(floor(n/2)), where OR is bitwise-or (A003986).
a(n) = A283997(n) + A283998(n).
a(n) = A005187(n) - A283998(n).

A325316 a(n) = A048250(n) OR A162296(n), where OR is the bitwise-OR, A003986.

Original entry on oeis.org

1, 3, 4, 7, 6, 12, 8, 15, 13, 18, 12, 28, 14, 24, 24, 31, 18, 31, 20, 26, 32, 36, 24, 60, 31, 42, 36, 56, 30, 72, 32, 63, 48, 54, 48, 79, 38, 60, 56, 90, 42, 96, 44, 52, 62, 72, 48, 124, 57, 91, 72, 58, 54, 108, 72, 120, 80, 90, 60, 104, 62, 96, 104, 127, 84, 144, 68, 126, 96, 144, 72, 191, 74, 114, 124, 124, 96, 168, 80
Offset: 1

Views

Author

Antti Karttunen, Apr 21 2019

Keywords

Crossrefs

Programs

  • Mathematica
    Array[BitOr @@ Map[Total, {#3, Complement[#2, #3]}] & @@ {#1, #2, Select[#2, SquareFreeQ]} & @@ {#, Divisors[#]} &, 79] (* Michael De Vlieger, Apr 21 2019 *)
  • PARI
    A048250(n) = factorback(apply(p -> p+1,factor(n)[,1]));
    A162296(n) = sumdiv(n, d, d*(1-issquarefree(d)));
    A325316(n) = bitor(A048250(n),A162296(n));

Formula

a(n) = A003986(A048250(n), A162296(n)).
a(n) = A000203(n) - A325318(n) = A325317(n) + A325318(n).
Previous Showing 11-20 of 82 results. Next