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.

A364258 a(n) = A163511(n) - n.

Original entry on oeis.org

1, 1, 2, 0, 4, 4, 0, -2, 8, 18, 8, 14, 0, 2, -4, -8, 16, 64, 36, 106, 16, 54, 28, 26, 0, 20, 4, 8, -8, -8, -16, -20, 32, 210, 128, 590, 72, 338, 212, 304, 32, 184, 108, 202, 56, 102, 52, 74, 0, 86, 40, 124, 8, 52, 16, 22, -16, 6, -16, -4, -32, -28, -40, -50, 64, 664, 420, 3058, 256, 1806, 1180, 2330, 144, 1052, 676
Offset: 0

Views

Author

Antti Karttunen, Jul 25 2023

Keywords

Comments

Compare also to the scatter plot of A364294.

Crossrefs

Cf. A007283, A163511, A364255 [= gcd(n,a(n))], A364287 (positions of negative terms), A364292 (of terms <= 0), A364288, A364294 [= -a(A364293(n))].

Programs

  • Mathematica
    f[n_] := Reverse@ Map[Ceiling[(Length@ # - 1)/2] &, DeleteCases[Split@ Join[Riffle[IntegerDigits[n, 2], 0], {0}], {k__} /; k == 1]]; {1}~Join~Table[-n + Function[t, Prime[t] Product[Prime[m]^(f[n][[m]]), {m, t}] ][DigitCount[n, 2, 1]], {n, 120}] (* Michael De Vlieger, Jul 25 2023 *)
  • Python
    from sympy import nextprime
    def A364258(n):
        c, p, k = 1, 1, n
        while k:
            c *= (p:=nextprime(p))**(s:=(~k&k-1).bit_length())
            k >>= s+1
        return c*p-n # Chai Wah Wu, Jul 25 2023

Formula

a(n) = A364288(A163511(n)).
For n >= 1, a(2*n) = 2*a(n).
For n >= 0, a(A007283(n)) = 0.