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.

User: Darío Clavijo

Darío Clavijo's wiki page.

Darío Clavijo has authored 125 sequences. Here are the ten most recent ones:

A385029 a(n) = Sum_{-n <= a, b, c <= n} (b^2 - 4*a*c).

Original entry on oeis.org

18, 250, 1372, 4860, 13310, 30758, 63000, 117912, 205770, 339570, 535348, 812500, 1194102, 1707230, 2383280, 3258288, 4373250, 5774442, 7513740, 9648940, 12244078, 15369750, 19103432, 23529800, 28741050, 34837218, 41926500, 50125572, 59559910, 70364110, 82682208, 96668000
Offset: 1

Author

Darío Clavijo, Jun 15 2025

Keywords

Comments

There are (2*n + 1)^3 combinations of a, b, c.

Programs

  • Mathematica
    A385029[n_] := (n*(n + 1)*(2*n + 1)^3)/3;
    Array[A385029, 50] (* Paolo Xausa, Jun 18 2025 *)
  • Python
    a = lambda n: ((n*n+n)*((n << 1)+1)**3)//3
    print([a(n) for n in range(1, 11)])

Formula

a(n) = (n*(n+1)*(2*n+1)^3)/3.
a(n) = (A055112(n)*A016754(n))/3.
a(n) = (A002378(n)*A016755(n))/3.
G.f.: 2*x*(9 + 71*x + 71*x^2 + 9*x^3)/(1 - x)^6. - Stefano Spezia, Jun 15 2025
From Amiram Eldar, Jun 18 2025; (Start)
Sum_{n>=1} 1/a(n) = 21*(1 - zeta(3)/2) - 12*log(2).
Sum_{n>=1} (-1)^(n+1)/a(n) = 3*Pi^3/8 + 3*Pi - 21. (End)

A384716 The totient of the product of unitary divisors of n.

Original entry on oeis.org

1, 1, 2, 2, 4, 12, 6, 4, 6, 40, 10, 48, 12, 84, 120, 8, 16, 108, 18, 160, 252, 220, 22, 192, 20, 312, 18, 336, 28, 216000, 30, 16, 660, 544, 840, 432, 36, 684, 936, 640, 40, 889056, 42, 880, 1080, 1012, 46, 768, 42, 1000, 1632, 1248, 52, 972, 2200, 1344, 2052
Offset: 1

Author

Darío Clavijo, Jun 11 2025

Keywords

Comments

a(n) is the totient of the product over all unitary divisors d of n; i.e., those divisors satisfying gcd(d, n/d) = 1.
Growth rate of a(n) is ~ n^O(log log n).
Also, a(n) is lower bounded by A000010(n).

Crossrefs

Programs

  • Mathematica
    f[p_, e_, m_] := (p-1)*p^(e*m-1); a[n_] := Module[{fct = FactorInteger[n]}, Times @@ (f[#1, #2, 2^(Length[fct]-1)] & @@@ fct)]; a[1] = 1; Array[a, 100] (* Amiram Eldar, Jun 11 2025 *)
  • Python
    from sympy import factorint
    def a(n):
        if n == 1: return 1
        factors = factorint(n)
        phi, w = 1, len(factors)
        for p, e in factors.items():
            phi *= (p - 1) * p**(e - 1)
        return n**((1 << (w-1)) - 1) * phi
    print([a(n) for n in range(1, 58)])

Formula

a(n) = phi(Product_{d|n} d if gcd(d, n/d) = 1).
a(n) = n^(2^(omega(n)-1)-1) * phi(n).
a(n) = A000010(A061537(n)).
a(p) = p-1 for p prime.

A384763 Product of the Euler totients of the unitary divisors of n.

Original entry on oeis.org

1, 1, 2, 2, 4, 4, 6, 4, 6, 16, 10, 16, 12, 36, 64, 8, 16, 36, 18, 64, 144, 100, 22, 64, 20, 144, 18, 144, 28, 4096, 30, 16, 400, 256, 576, 144, 36, 324, 576, 256, 40, 20736, 42, 400, 576, 484, 46, 256, 42, 400, 1024, 576, 52, 324, 1600, 576, 1296, 784, 58, 65536
Offset: 1

Author

Darío Clavijo, Jun 09 2025

Keywords

Comments

a(n) is the product of phi(d) over all unitary divisors d of n; i.e., those divisors satisfying gcd(d, n/d) = 1.
a(n) is upper bounded by A061537(n) (product of phi(d) over all divisors d of n).
The function is not multiplicative.
The sum of the totients over all unitary divisors d of n is A055653(n).

Examples

			For n = 6, a(6) = phi(1) * phi(2) * phi(3) * phi(6) = 1*1*2*2 = 4.
		

Crossrefs

Programs

  • Mathematica
    a[n_] := EulerPhi[n]^(2^(PrimeNu[n] - 1)); Array[a, 100] (* Amiram Eldar, Jun 09 2025 *)
  • PARI
    a(n) = my(p=1); fordiv(n, d, if (gcd(d,n/d) == 1, p*=eulerphi(d))); p; \\ Michel Marcus, Jun 09 2025
  • Python
    from sympy import totient, divisors, gcd
    def a(n):
       prod = 1
       for d in divisors(n):
          if gcd(d, n//d) == 1:
              prod *= totient(d)
       return prod
    print([a(n) for n in range(1, 61)])
    

Formula

a(n) = Product_{d|n} phi(d) if gcd(n,floor(n/d)) = 1.
a(p) = p-1 for p prime.
a(p^k) = p^k-p^(k-1).
a(n) = phi(n)^(2^(omega(n)-1)) = A000010(n)^(A034444(n)/2). - Amiram Eldar, Jun 09 2025

A384666 Number of distinct values of the quadratic discriminant D=b^2-4*a*c, for a,b,c in the range [-n,n].

Original entry on oeis.org

1, 6, 17, 35, 56, 90, 125, 178, 223, 282, 344, 436, 499, 608, 701, 804, 904, 1062, 1164, 1339, 1450, 1604, 1765, 1988, 2114, 2335, 2525, 2735, 2909, 3194, 3366, 3679, 3887, 4137, 4389, 4661, 4840, 5237, 5536, 5835, 6068, 6507, 6759, 7195, 7473, 7773, 8148, 8645
Offset: 0

Author

Darío Clavijo, Jun 06 2025

Keywords

Comments

a(n) is lower bounded by n log n for n > 0.
The number of distinct a*c is 2*A027384(n)-1.

Crossrefs

Programs

  • Python
    def a(n):
        D, ac = {0}, {0}
        SQ = [i*i for i in range(0, n+1)]
        for i in range(1, n+1):
            ac.add(i)
            if (s:= SQ[i]) > n:
                ac.add(s)
        for a_ in range(2, n):
            for c in range(a_+ 1, n+1):
                ac.add(a_* c)
        for b in range(n + 1):
            b2 = SQ[b]
            for v in ac:
                ac4 = v << 2
                D.add(b2 + ac4)
                if b2 < ac4:
                    D.add(b2 - ac4)
        return len(D)
    print([a(n) for n in range(0, 48)])

A384543 Number of distinct values from the bitwise operation i XOR j for all integers i and j in the range [1, n].

Original entry on oeis.org

1, 2, 4, 7, 8, 8, 8, 15, 16, 16, 16, 16, 16, 16, 16, 31, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 63, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 127, 128, 128
Offset: 1

Author

Darío Clavijo, Jun 02 2025

Keywords

Comments

For any n, the maximum value of (i XOR j) is < 2^floor(log_2(n))+1.

Examples

			For n=3, a(3) = 4 because:
 i | j | i XOR j
---+---+-------
 1 | 1 | 0
 1 | 2 | 3
 1 | 3 | 2
 2 | 1 | 3
 2 | 2 | 0
 2 | 3 | 1
 3 | 1 | 2
 3 | 2 | 1
 3 | 3 | 0
In total there are 4 unique values for i XOR j.
		

Crossrefs

Programs

  • Mathematica
    a[n_] := CountDistinct[Flatten[Table[BitXor[i, j], {i, 1, n}, {j, 1, i}]]]; Array[a, 100] (* Amiram Eldar, Jun 02 2025 *)
  • PARI
    a(n) = #setbinop((x,y)->bitxor(x,y), [1..n]); \\ Michel Marcus, Jun 02 2025
  • Python
    def a(n):
        if n < 4: return [1,1,2,4][n]
        k2 = 1 << n.bit_length()
        if (n & (n - 1)) == 0: return k2 - 1
        return k2
    print([a(n) for n in range(1, 68)])
    

Formula

a(2^k) = A000225(k+1) for k > 1.
a(2^k-1) = A151821(k).
a(2^k+1) = A000079(k+1).
a(n) = 2^k if 2^(k-1) < n < 2^k with k=2^floor(log_2(n))+1.

A384452 a(n) is the sum of squares of the unitary divisors of n!.

Original entry on oeis.org

1, 5, 50, 650, 16900, 547924, 27396200, 1746641000, 139773881000, 13460683752200, 1642203417768400, 236441876606410000, 40195119023089700000, 7723888546922636420000, 1735183690969722609168800, 444206919394766468845892000, 128820006624482275965308680000, 41737604550102658693597600532800
Offset: 1

Author

Darío Clavijo, Jun 02 2025

Keywords

Crossrefs

Programs

  • Mathematica
    f[p_, e_] := p^(2*e)+1; a[1] = 1; a[n_] := Times @@ f @@@ FactorInteger[n!]; Array[a, 18] (* Amiram Eldar, Jun 02 2025 *)
  • PARI
    row(n) = {my(d = divisors(n)); select(x->(gcd(x, n/x)==1), d); } \\ A077610
    a(n) = norml2(row(n!)); \\ Michel Marcus, Jun 02 2025
  • Python
    from sympy import nextprime
    def f(n,p):
      if n==0: return 0
      return f(n//p,p) + n//p
    def a(n):
      s,p = 1, 2
      while p<=n:
        s *= p**(f(n,p)<<1)+1
        p = nextprime(p)
      return s
    print([a(n) for n in range(1, 19)])
    

Formula

a(n) = Sum_{d|n!} (d^2 if gcd(d,n!//d) = 1).
a(n) = Product_{p <= n, p prime} (p^(2*f(n,p)))+1 with f(n,p) = f(floor(n/p)) + floor(n/p) and f(0,p) = 0 where f(n,p) is equivalent to the Legendre formula.
a(n) = A034676(n!).

A383752 Product of nonzero remainders n mod p, over all primes p < n.

Original entry on oeis.org

1, 1, 1, 1, 2, 1, 2, 6, 8, 3, 8, 10, 36, 24, 8, 30, 288, 420, 1920, 2268, 640, 270, 2880, 9240, 13824, 7560, 19200, 17820, 120960, 64064, 362880, 5054400, 1881600, 475200, 165888, 464100, 6386688, 4082400, 1228800, 2120580, 34836480, 23474880, 217728000
Offset: 1

Author

Darío Clavijo, May 28 2025

Keywords

Crossrefs

Programs

  • Mathematica
    A383752[n_] := Times @@ DeleteCases[Mod[n, Prime[Range[PrimePi[n - 2]]]], 0];
    Array[A383752, 50] (* Paolo Xausa, Jun 05 2025 *)
  • PARI
    a(n) = vecprod(select(x->(x!=0), apply(lift, apply(x->Mod(n, x), primes([2,n-1]))))); \\ Michel Marcus, May 28 2025
  • Python
    from sympy import primerange
    def a(n):
        s = 1
        for p in primerange(0, n):
            if p > (n >> 1): s *= (n-p)
            elif (x:= n % p) > 0: s*= x
        return s
    print([a(n) for n in range(1,41)])
    

Formula

a(p) = A102647(p) if p prime.

A382454 Number of solutions winning the Tchoukaillon game with n seeds and 2n pits.

Original entry on oeis.org

1, 2, 9, 49, 285, 1717, 10569, 66013, 416687, 2651355, 16976806, 109256095, 706071989, 4579020513, 29784426945, 194231327451, 1269457354069, 8313189986612, 54534379879411, 358298017624625, 2357331709694072, 15528887031395023, 102412421113465576, 676104332189192702
Offset: 0

Author

Darío Clavijo, May 26 2025

Keywords

Comments

a(n) is the number of permutations of [2n+1] with n inversions. a(2) = 9: 12453, 12534, 13254, 13425, 14235, 21354, 21435, 23145, 31245. - Alois P. Heinz, May 27 2025

Crossrefs

Programs

  • Maple
    a:= n-> coeff(series(mul((1-q^j)/(1-q), j=1..2*n+1), q, n+1), q, n):
    seq(a(n), n=0..23);  # Alois P. Heinz, May 27 2025
  • Mathematica
    a[n_]:=Coefficient[Series[Product[(1-q^j)/(1-q),{j,1,2*n+1}],{q,0,n+1}]//Normal,q,n];Array[a, 24, 0] (* Shenghui Yang, Jun 02 2025 *)
  • Python
    def a(n):
        if n == 0: return 1
        p = [1]
        for j in range(1, (n << 1) + 2):
            np = [0] * (len(p) + j - 1)
            for k in range(len(p)):
                for l in range(j):
                    if (kl:=k+l) <= n:
                        np[kl] += p[k]
            p = np[:n+1]
        return p[n]
    print([a(n) for n in range(1,24)])

Formula

a(n) = T(2n,n) with T(x,y) = Sum_{v=0..min(x,y)} T(x-1, y-v) and T(0,y) = 1 if y = 0 else 0.
a(n) = A008302(2n+1,n).

A384197 The Barret reducer reciprocal mod n.

Original entry on oeis.org

4, 8, 5, 16, 12, 10, 9, 32, 28, 25, 23, 21, 19, 18, 17, 64, 60, 56, 53, 51, 48, 46, 44, 42, 40, 39, 37, 36, 35, 34, 33, 128, 124, 120, 117, 113, 110, 107, 105, 102, 99, 97, 95, 93, 91, 89, 87, 85, 83, 81, 80, 78, 77, 75, 74, 73, 71, 70, 69, 68, 67, 66, 65, 256
Offset: 1

Author

Darío Clavijo, May 21 2025

Keywords

Comments

The aim of the Barret reducer is to compute x_i mod n for multiple i in an efficient manner in commodity hardware.
The reciprocal is a(n) = floor(4^k / n), with k = floor(log_2(n))+1 such that for any x_i where q_i = (x_i * a(n)) >> (2 * k) and x_i - q_i * k is congruent to x_i mod n.
This sequence contains no fixed points.

Examples

			For n = 97, a(97) = 168 because: k = floor(log_2(97))+1 = 6, so  a(97) = floor((4^6) / 97) = 168.
As an example application, let some x=65537 and q = (x * a(n)) >> (2 * 6) = (65537 * 168) >> (2 * 6) = 353, then 353 % 97 = 65537 % 97, where ">>" denotes right shift.
		

Crossrefs

Programs

  • Mathematica
    A384197[n_] := Floor[4^BitLength[n]/n]; Array[A384197, 100] (* Paolo Xausa, Jun 05 2025 *)
  • Python
    a = lambda n: (1 << (n.bit_length() << 1)) // n
    print([a(n) for n in range(1,65)])

Formula

a(n) = floor(4^k / n) where k = floor(log_2(n))+1.
a(2^j) = 2^(j+2).
a(2^j-1) = A143096(j+1).

A383036 The determinant of the matrix representing a totally anti-symmetric quasigroup of order 2*n+1.

Original entry on oeis.org

0, 9, 1250, 352947, 172186884, 129687123005, 139788510734886, 204350482177734375, 389289535005334947848, 937146152681201173795569, 2782184294469515486371964010, 9986310782535957929474146174619, 42632564145606011152267456054687500, 213501642487388555901009081409220318757
Offset: 0

Author

Darío Clavijo, May 21 2025

Keywords

Comments

A totally antisymmetric quasigroup of order 2*n+1 is constructed in a way such that M[i][j] != M[j][i] for i!=j with m = 2*n+1, k = 2 and M[j][i] = k*(j-i) mod m for 0 <= j,i < m.
For any k != 0 mod m the resulting matrix M has the same determinant for each n.
Also the resulting matrix M is circulant and a Latin square.

Examples

			For n = 1, a(1) = 9 because:
The resulting totally anti-symetric quasigroup has a matrix:
with k = 1:
  0, 1, 2,
  2, 0, 1,
  1, 2, 0
which has a determinant: 9.
with k = 2:
  0, 2, 1,
  1, 0, 2,
  2, 1, 0
has also the same determinant 9.
		

Crossrefs

Programs

Formula

a(n) = n*(2*n+1)^(2*n) = A081131(2*n+1).