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.

A366144 a(n) = n/d(n) if d(n) | n, otherwise a(n) = n*d(n), where d(n) = A000005(n) is the number of divisors of n.

Original entry on oeis.org

1, 1, 6, 12, 10, 24, 14, 2, 3, 40, 22, 2, 26, 56, 60, 80, 34, 3, 38, 120, 84, 88, 46, 3, 75, 104, 108, 168, 58, 240, 62, 192, 132, 136, 140, 4, 74, 152, 156, 5, 82, 336, 86, 264, 270, 184, 94, 480, 147, 300, 204, 312, 106, 432, 220, 7, 228, 232, 118, 5, 122, 248, 378, 448, 260, 528, 134
Offset: 1

Views

Author

Neal Gersh Tolunsky, Sep 30 2023

Keywords

Examples

			n=3 has d(3) = 2 divisors (like all primes) and 3 is not divisible by 2, so we multiply: a(3) = 3*2 = 6.
n=8 has d(8) = 4 divisors and 8 is divisible by 4, so we divide: a(8) = 8/4 = 2.
		

Crossrefs

Cf. A366067 (iterate starting 578).

Programs

  • Mathematica
    a[n_] := n * If[Divisible[n, d = DivisorSigma[0, n]], 1/d, d]; Array[a, 100] (* Amiram Eldar, Oct 01 2023 *)
  • PARI
    a(n) = my(d=numdiv(n)); if (n % d, n*d, n/d); \\ Michel Marcus, Oct 01 2023
    
  • Python
    from sympy import divisor_count
    def A366144(n): return n*d if (q:=divmod(n,d:=int(divisor_count(n))))[1] else q[0] # Chai Wah Wu, Oct 02 2023

Formula

sqrt(n)/2 <= a(n) <= 2*n*sqrt(n). - Yifan Xie, Oct 01 2023