login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A359953
a(1) = 0, a(2) = 1. For n >= 3, if the greatest prime dividing n is greater than the greatest prime dividing n-1, then a(n) = a(n-1) + 1. Otherwise a(n) = a(n-1) - 1.
1
0, 1, 2, 1, 2, 1, 2, 1, 2, 3, 4, 3, 4, 3, 2, 1, 2, 1, 2, 1, 2, 3, 4, 3, 4, 5, 4, 5, 6, 5, 6, 5, 6, 7, 6, 5, 6, 5, 4, 3, 4, 3, 4, 3, 2, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 5, 6, 5, 6, 5, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 2, 3, 2, 3, 4, 3, 2, 3, 4, 3
OFFSET
1,3
COMMENTS
The first negative value is at a(3888). Within the first 1000000 values are the negative record values a(n) = -4 at n = {3913, 3915, 3927, 3933}. - Thomas Scheuerle, Jan 20 2023
FORMULA
For n >= 2, if A006530(n) > A006530(n-1), then a(n) = a(n-1) + 1; a(n) = a(n-1) - 1 otherwise.
a(n) = (-1)*Sum_{i=1..n-1} (-1)^A087429(i).
a(1 + A070089(n)) = 1 + a(A070089(n)). - Thomas Scheuerle, Jan 20 2023
EXAMPLE
a(5) = a(4) + 1 = 1 + 1 = 2 because A006530(5) = 5 > A006530(4) = 2.
MATHEMATICA
Join[{0}, Accumulate@ Sign@ Differences@ Table[FactorInteger[n][[-1, 1]], {n, 1, 100}]] (* Amiram Eldar, Jan 20 2023, after the MATLAB code *)
PROG
(MATLAB)
function a = A359953(max_n)
a = [0 cumsum(sign(diff([0 arrayfun(@(x)(max(factor(x))), [2:max_n])])))];
end % Thomas Scheuerle, Jan 20 2023
(PARI) lista(nn) = my(va = vector(nn)); va[1] = 0; va[2] = 1; for (n=3, nn, if (vecmax(factor(n)[, 1]) > vecmax(factor(n-1)[, 1]), va[n] = va[n-1] + 1, va[n] = va[n-1] - 1); ); va; \\ Michel Marcus, Jan 31 2023
CROSSREFS
KEYWORD
easy,sign
AUTHOR
Tamas Sandor Nagy, Jan 19 2023
STATUS
approved