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”).

A332801
a(n) is the number of even results of n mod k, for 1 < k < n.
1
0, 0, 0, 1, 1, 3, 1, 4, 3, 5, 3, 7, 3, 9, 5, 8, 6, 11, 5, 13, 7, 13, 7, 15, 8, 16, 10, 16, 10, 20, 8, 21, 11, 21, 13, 22, 12, 24, 14, 24, 14, 28, 12, 30, 16, 28, 16, 30, 17, 32, 18, 32, 18, 36, 18, 36, 20, 36, 20, 40, 18, 42, 22, 39, 25, 41, 23, 43, 25, 45, 23, 48, 22, 50
OFFSET
1,6
LINKS
EXAMPLE
n(7) = 1 because only 7 mod 5 = 2 is even.
MATHEMATICA
Table[Total[Boole[EvenQ/@Mod[n, Range[2, n-1]]]], {n, 80}] (* Harvey P. Dale, Aug 09 2021 *)
PROG
(PARI) a(n) = sum(k=2, n-1, ((n % k) % 2)== 0); \\ Michel Marcus, Feb 24 2020
CROSSREFS
Sequence in context: A029151 A102595 A113415 * A054019 A333477 A230877
KEYWORD
nonn
AUTHOR
Thomas Kerscher, Feb 24 2020
STATUS
approved