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-4 of 4 results.

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).

A353292 a(n) is the number of positive integers k <= n that have at least one common 1-bit with n.

Original entry on oeis.org

0, 1, 1, 3, 1, 4, 5, 7, 1, 6, 7, 10, 9, 12, 13, 15, 1, 10, 11, 16, 13, 18, 19, 22, 17, 22, 23, 26, 25, 28, 29, 31, 1, 18, 19, 28, 21, 30, 31, 36, 25, 34, 35, 40, 37, 42, 43, 46, 33, 42, 43, 48, 45, 50, 51, 54, 49, 54, 55, 58, 57, 60, 61, 63, 1, 34, 35, 52, 37
Offset: 0

Views

Author

Rémy Sigrist, Apr 09 2022

Keywords

Comments

See A353293 for the corresponding k's.

Examples

			For n = 10:
- we have:
      k   10 AND k
      --  --------
       1         0
       2         2
       3         2
       4         0
       5         0
       6         2
       7         2
       8         8
       9         8
      10        10
- so a(10) = #{2, 3, 6, 7, 8, 9, 10} = 7.
		

Crossrefs

Programs

  • PARI
    a(n) = { my (h=hammingweight(n), w=#binary(n)); n-2^(w-1)+1 + (2^(h-1)-1)*2^(w-h) }

Formula

a(n) = n - A115378(n) for any n > 0.
a(n) = A062050(n) + A088512(n) * A080100(n) for any n > 0.
a(2^k) = 1 for any k >= 0.
a(2^k - 1) = 2^k - 1 for any k >= 0.

A262260 Number of triangles formed by the positions of odd numbers in the first n rows of Pascal's triangle, also known as Tartaglia's triangle.

Original entry on oeis.org

0, 1, 1, 4, 4, 6, 6, 13, 13, 15, 15, 21, 21, 25, 25, 40, 40, 42, 42, 48, 48, 52, 52, 66, 66, 70, 70, 82, 82, 90, 90, 121, 121, 123, 123, 129, 129, 133, 133, 147, 147, 151, 151, 163, 163, 171, 171, 201, 201, 205, 205, 217, 217, 225, 225, 253, 253, 261, 261, 285, 285, 301, 301, 364, 364
Offset: 0

Views

Author

Emmanuele Villa, Nov 09 2016

Keywords

Comments

Named Tartaglia's triangle after the Italian mathematician Niccolò Fontana Tartaglia (1500-1577). - Amiram Eldar, Jun 11 2021

Examples

			Taking Pascal's triangle, removing the even terms and replacing each odd term with a dot, will give you this illustration (the circles are connected with lines to show the sub-triangles):
                                        triangle counts
                                        ---------------
   row                                     new total
   ===                                     === =====
    0                  o                    0    0
                      / \
    1                o---o                  1    1
                    /     \
    2              o       o                0    1
                  / \     / \
    3            o---o---o---o              3    4
                /             \
    4          o               o            0    4
              / \             / \
    5        o---o           o---o          2    6
            /     \         /     \
    6      o       o       o       o        0    6
          / \     / \     / \     / \
    7    o---o---o---o---o---o---o---o      7   13
        /                             \
    8  o                               o    0   13
.
.
Formula example:
given a(46) = 171, a(47) is computed as follows:
A = A001316(46) = 16
B = A001316(44) = 8
C = A001316(44) - 1 = 7
D = A001316((47+1-32)/8) - 1 = 1
a(47) = 171 + 16 + 8 + 7 - 1 = 201
.
.
You can find results for a(n), A, B, C and D in the links section for the first 500 rows.
		

Crossrefs

Formula

Empirical formula:
a(0)=0; a(1)=1; for n>1, a(n) = a(n-1) + A + B + C - D
where
A = A001316(n-1) if n = 2x+1, 0 otherwise
B = A001316(n-3) if n = 4x+1, 0 otherwise
C = B-1 if n = 8x+1, 0 otherwise
D = A088512(n+1) = A001316((n+1-m)/8)-1 if n = 8x+1, 0 otherwise, where m is the highest power of 2 less than n.

A335979 Number of partitions of n into exactly two parts with no decimal carries.

Original entry on oeis.org

0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 2, 4, 5, 7, 8, 10, 11, 13, 14, 1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 2, 4, 7, 9, 12, 14, 17, 19, 22, 24, 2, 5, 8, 11, 14, 17, 20, 23, 26, 29, 3, 6, 10, 13, 17, 20, 24, 27, 31, 34, 3, 7, 11, 15, 19, 23
Offset: 0

Views

Author

Jason Zimba, Jul 02 2020

Keywords

Comments

a(m) = a(n) if m and n have the same nonzero digits, irrespective of order. For example, a(6044005) = a(45604).

Examples

			a(31) = 3 because there are three partitions of 31 into exactly two parts with no decimal carries: 30 + 1, 21 + 10, and 20 + 11.
a(100) = 0 because every partition of 100 into exactly two parts has at least one decimal carry.
		

Crossrefs

Cf. A088512 (analogous sequence for base 2), A089898.

Programs

  • Mathematica
    Ceiling[(1/2) Times @@ (IntegerDigits[n, 10] + 1)] - 1

Formula

If n has digits n_1, n_2, ..., n_k and all digits n_i are even, then a(n) = (1/2)(n_1 + 1)(n_2 + 1)...(n_k + 1) - 1/2. Otherwise, a(n) = (1/2)(n_1 + 1)(n_2 + 1)...(n_k + 1) - 1. Equivalently, a(n) = ceiling((1/2)(n_1 + 1)(n_2 + 1)...(n_k + 1)) - 1 for all n.
a(n) = ceiling((1/2)*A089898(n)) - 1.
Showing 1-4 of 4 results.