%I #56 Feb 19 2019 10:22:00
%S 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,
%T 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,
%U 3,4,3,4,3,4,4,4,4,5,4,5,4,5,4,5,4,4,4
%N a(n) = Sum_{k=1..n} sign(omega(n+1) - omega(n)) (where omega(m) = A001221(m), the number of distinct primes dividing m).
%C The sign function is defined by:
%C - sign(0) = 0,
%C - sign(n) = +1 for any n > 0,
%C - sign(n) = -1 for any n < 0.
%C a(n) corresponds to the number of integers up to n in A294277 minus the number of integers up to n in A294278.
%C The first negative value occurs at a(178) = -1.
%C Will this sequence change sign indefinitely?
%H Georg Fischer, <a href="/A293460/b293460.txt">Table of n, a(n) for n = 0..1000</a>
%H Rémy Sigrist, <a href="/A293460/a293460.png">Line graph of the first 10000 terms</a>
%H Rémy Sigrist, <a href="/A293460/a293460_1.png">Line graph of the first 100000000 terms</a>
%H Rémy Sigrist, <a href="/A293460/a293460_2.png">Line graph of the first 1000000000 terms</a>
%H Rémy Sigrist, <a href="/A293460/a293460_3.png">Line graph of the first 10000000000 terms</a>
%F a(0) = 0, and for any n > 0:
%F - a(A294277(n)) = a(A294277(n)-1) + 1,
%F - a(A006049(n)) = a(A006049(n)-1),
%F - a(A294278(n)) = a(A294278(n)-1) - 1.
%F Also: a(n) = #{ k / A294277(k) <= n } - #{ k / A294278(k) <= n }.
%e The following table shows the first terms of the sequence, alongside sign(omega(n+1)-omega(n)), omega(n+1) and omega(n):
%e n a(n) sign w(n+1) w(n)
%e - ---- ---- ------ ----
%e 0 0
%e 1 1 1 1 0
%e 2 1 0 1 1
%e 3 1 0 1 1
%e 4 1 0 1 1
%e 5 2 1 2 1
%e 6 1 -1 1 2
%e 7 1 0 1 1
%e 8 1 0 1 1
%e 9 2 1 2 1
%e 10 1 -1 1 2
%e 11 2 1 2 1
%e 12 1 -1 1 2
%e 13 2 1 2 1
%e 14 2 0 2 2
%e 15 1 -1 1 2
%e 16 1 0 1 1
%e 17 2 1 2 1
%e 18 1 -1 1 2
%e 19 2 1 2 1
%e 20 2 0 2 2
%o (PARI) s = 0; for (n=1, 87, print1 (s ", "); s += sign(omega(n+1)-omega(n)))
%Y Cf. A001221, A006049, A294277, A294278.
%K sign
%O 0,6
%A _Rémy Sigrist_, Oct 26 2017
|