login
A342724
a(n) = Sum_{primes p <= 2n} of g(frac(n/p)), where g(t) = [0 if t = 0, -1 if 0 < t < 1/2, 1 if t >= 1/2], and where frac(x) denotes the fractional part.
0
1, 1, 2, 1, 3, 1, 1, 3, 4, 2, 5, 3, 4, 3, 2, 0, 4, 5, 5, 6, 5, 2, 5, 3, 4, 5, 5, 6, 9, 6, 5, 7, 10, 7, 9, 6, 6, 7, 9, 6, 7, 4, 6, 7, 6, 6, 9, 10, 10, 11, 10, 7, 12, 10, 9, 9, 8, 8, 11, 11, 11, 12, 12, 10, 13, 9, 11, 12, 11, 7, 9, 10, 13, 14, 13, 10, 12, 11, 10
OFFSET
1,3
COMMENTS
The function a(n) is a measure of how many times n rounds up (assigned value +1), down (assigned value -1), or not at all (assigned value +0) when divided by incremental prime numbers (see below example.)
EXAMPLE
For n = 4, a(4) = 0 + (-1) + 1 + 1 = 2.
PROG
(PARI)
g(t) = {if(t==0, 0, if(t<1/2, -1, 1))}
a(n) = {sum(i=1, primepi(2*n), g(frac(n/prime(i))))} \\ Andrew Howroyd, Mar 20 2021
CROSSREFS
Cf. A337319.
Sequence in context: A256435 A367412 A279945 * A347046 A300322 A144220
KEYWORD
nonn
AUTHOR
Christoph B. Kassir, Mar 19 2021
STATUS
approved