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.

A293460 a(n) = Sum_{k=1..n} sign(omega(n+1) - omega(n)) (where omega(m) = A001221(m), the number of distinct primes dividing m).

Original entry on oeis.org

0, 1, 1, 1, 1, 2, 1, 1, 1, 2, 1, 2, 1, 2, 2, 1, 1, 2, 1, 2, 2, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 1, 2, 2, 2, 2, 1, 2, 2, 2, 1, 2, 1, 2, 2, 2, 1, 2, 1, 2, 2, 2, 1, 2, 2, 2, 2, 2, 1, 2, 1, 2, 2, 1, 2, 3, 2, 3, 3, 4, 3, 4, 3, 4, 4, 4, 4, 5, 4, 5, 4, 5, 4, 5, 4, 4, 4
Offset: 0

Views

Author

Rémy Sigrist, Oct 26 2017

Keywords

Comments

The sign function is defined by:
- sign(0) = 0,
- sign(n) = +1 for any n > 0,
- sign(n) = -1 for any n < 0.
a(n) corresponds to the number of integers up to n in A294277 minus the number of integers up to n in A294278.
The first negative value occurs at a(178) = -1.
Will this sequence change sign indefinitely?

Examples

			The following table shows the first terms of the sequence, alongside sign(omega(n+1)-omega(n)), omega(n+1) and omega(n):
n       a(n)    sign    w(n+1)  w(n)
-       ----    ----    ------  ----
0       0
1       1       1       1       0
2       1       0       1       1
3       1       0       1       1
4       1       0       1       1
5       2       1       2       1
6       1       -1      1       2
7       1       0       1       1
8       1       0       1       1
9       2       1       2       1
10      1       -1      1       2
11      2       1       2       1
12      1       -1      1       2
13      2       1       2       1
14      2       0       2       2
15      1       -1      1       2
16      1       0       1       1
17      2       1       2       1
18      1       -1      1       2
19      2       1       2       1
20      2       0       2       2
		

Crossrefs

Programs

  • Mathematica
    Accumulate[Join[{0},Sign[Differences[PrimeNu[Range[90]]]]]] (* Harvey P. Dale, Dec 25 2024 *)
  • PARI
    s = 0; for (n=1, 87, print1 (s ", "); s += sign(omega(n+1)-omega(n)))

Formula

a(0) = 0, and for any n > 0:
- a(A294277(n)) = a(A294277(n)-1) + 1,
- a(A006049(n)) = a(A006049(n)-1),
- a(A294278(n)) = a(A294278(n)-1) - 1.
Also: a(n) = #{ k / A294277(k) <= n } - #{ k / A294278(k) <= n }.