OFFSET
1,2
LINKS
Michael De Vlieger, Table of n, a(n) for n = 1..10000
EXAMPLE
Let f(x) = A007814(x).
a(1) = 1 because k = 0 and f(2*1) = 1; since 0 < 1, a(1) = k = 0 + 1 = 1.
a(2) = 3 because k = 1 and f(2*2) = 2; since 1 < 2, a(2) = k = 1 + 2 = 3.
a(3) = 2 because k = 3 and f(2*3) = 1; since 3 > 2, a(3) = k = 3 - 1 = 2, etc.
MATHEMATICA
nn = 120; k = 0; q = 2; Reap[Do[If[k < #, k += #, k -= #] &@ IntegerExponent[q*n, q]; Sow[k], {n, nn}]][[-1, 1]]
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Michael De Vlieger, Apr 11 2024
STATUS
approved