login
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).
1
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,6
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?
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 }.
EXAMPLE
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
PROG
(PARI) s = 0; for (n=1, 87, print1 (s ", "); s += sign(omega(n+1)-omega(n)))
CROSSREFS
KEYWORD
sign
AUTHOR
Rémy Sigrist, Oct 26 2017
STATUS
approved