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

A368276 Number of nonnegative representations of n = w*x + y*z with max(w, x) < min(y, z) and w <= x <= y <= z.

Original entry on oeis.org

1, 1, 1, 3, 2, 3, 2, 3, 5, 4, 3, 6, 4, 4, 5, 9, 4, 7, 5, 9, 6, 7, 4, 11, 11, 7, 7, 11, 7, 13, 7, 10, 9, 10, 9, 19, 9, 9, 10, 17, 9, 17, 8, 14, 14, 13, 7, 21, 17, 14, 13, 17, 10, 20, 13, 22, 14, 15, 10, 26, 14, 13, 18, 28, 15, 22, 13, 19, 17, 25, 12, 33, 15, 18
Offset: 1

Views

Author

Peter Luschny, Dec 19 2023

Keywords

Comments

Number of monotone Bacher representations (A368207) of n. We call a quadruple (w, x, y, z) of nonnegative integers a monotone Bacher representation of n if and only if n = w*x + y*z and w <= x < y <= z.

Examples

			For n = 13, the 4 solutions are (w, x, y, z) = (0, 0, 1, 13), (1, 1, 2, 6), (1, 1, 3, 4), (2, 2, 3, 3).
		

Crossrefs

Programs

  • Julia
    using Nemo
    function A368276(n)
        t(n) = (d for d in divisors(n) if d * d <= n)
        sum(sum(sum(1 for d in t(n - wx) if wx < d * dx; init=0)
                for dx in t(wx)) for wx in 1:div(n, 2); init=sum(t(n)))
    end
    println([A368276(n) for n in 1:74])  # Peter Luschny, Dec 19 2023
  • Mathematica
    t[n_]:=t[n]=Select[Divisors[n],#^2<=n&];
    A368276[n_]:=Total[t[n]]+Sum[Boole[wxA368276,100] (* Paolo Xausa, Jan 02 2024 *)
  • Python
    from itertools import takewhile
    from sympy import divisors
    def A368276(n):
        c = sum(takewhile(lambda x: x**2 <= n, divisors(n)))
        for wx in range(1, (n >> 1) + 1):
            for d1 in divisors(wx):
                if d1**2 > wx:
                    break
                m = n - wx
                c += sum(1
                    for d in takewhile(lambda x: x**2 <= m, divisors(n - wx))
                    if wx < d * d1)
        return c  # Chai Wah Wu, Dec 19 2023
    

A368580 a(n) = Sum_{d|n and d^2 <= n} (1 + [d^2 < n]) * (2*d - 1), where [.] denote the Iverson brackets.

Original entry on oeis.org

1, 2, 2, 5, 2, 8, 2, 8, 7, 8, 2, 18, 2, 8, 12, 15, 2, 18, 2, 22, 12, 8, 2, 32, 11, 8, 12, 22, 2, 36, 2, 22, 12, 8, 20, 43, 2, 8, 12, 40, 2, 40, 2, 22, 30, 8, 2, 54, 15, 26, 12, 22, 2, 40, 20, 48, 12, 8, 2, 72, 2, 8, 38, 37, 20, 40, 2, 22, 12, 52, 2, 84, 2, 8
Offset: 1

Views

Author

Peter Luschny, Dec 31 2023

Keywords

Comments

A quadruple (w, x, y, z) of nonnegative integers is a 'Bacher representation' of n if and only if n = w*x + y*z and max(w,x) < min(y,z).
A Bacher representation is 'monotone' if additionally w <= x <= y <= z.
A Bacher representation is 'degenerated' if w = 0. The weight of a Bacher representation is defined as
W(w, x, y, z) = max(1, 2*([w < x] + [y < z])).
a(n) is the sum of the weights of all degenerated monotone Bacher representations of n. The complementary sum of weights of nondegenerated monotone Bacher representations is A368581.

Examples

			Below are the monotone Bacher representations of n = 27 listed.
  W(0, 0, 1, 27) = 2;
  W(0, 0, 3,  9) = 2;
  W(0, 1, 3,  9) = 4;
  W(0, 2, 3,  9) = 4;
  W(1, 1, 2, 13) = 2;
  W(1, 2, 5,  5) = 2;
  W(1, 3, 4,  6) = 4.
Thus a(27) = 2 + 2 + 4 + 4 = 12. Adding all weights gives A368207(27) = 20.
For instance, the integers n = 6, 8, and 12 have only degenerated Bacher representation, so for these cases, a(n) = A368207(n).
		

Crossrefs

Programs

  • Julia
    using Nemo
    function A368580(n)
        sum(d * d == n ? d * 2 - 1 : d * 4 - 2
        for d in (d for d in divisors(n) if d * d <= n))
    end
    println([A368580(n) for n in 1:74])
  • Mathematica
    A368580[n_]:=DivisorSum[n,(1+Boole[#^2A368580,100] (* Paolo Xausa, Jan 01 2024 *)

Formula

a(p) = 2 for all prime p.
a(n) is odd if and only if n is a square.
a(n) + A368581(n) = A368207(n).
Showing 1-2 of 2 results.