login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A330926 a(n) = Sum_{k=1..n} (ceiling(n/k) mod 2). 3
1, 1, 2, 1, 3, 2, 3, 2, 5, 3, 4, 3, 6, 5, 6, 3, 7, 6, 7, 6, 9, 6, 7, 6, 11, 9, 10, 7, 10, 9, 10, 9, 14, 11, 12, 9, 13, 12, 13, 10, 15, 14, 15, 14, 17, 12, 13, 12, 19, 17, 18, 15, 18, 17, 18, 15, 20, 17, 18, 17, 22, 21, 22, 17, 23, 20, 21, 20, 23, 20, 21, 20, 27, 26, 27, 22, 25, 22, 23, 22 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,3
COMMENTS
a(n) = number of terms among {ceiling(n/k)}, 1 <= k <= n, that are odd.
LINKS
FORMULA
G.f.: (x/(1 - x)) * (1 + Sum_{k>=1} x^(2*k) / (1 + x^k)).
a(n) = n - Sum_{k=1..n-1} A048272(k).
a(n) = A075997(n-1) + 1.
MAPLE
b:= n-> add((-1)^d, d=numtheory[divisors](n)):
a:= proc(n) option remember; `if`(n>0, 1+b(n-1)+a(n-1), 0) end:
seq(a(n), n=1..80); # Alois P. Heinz, May 25 2020
MATHEMATICA
Table[Sum[Mod[Ceiling[n/k], 2], {k, 1, n}], {n, 1, 80}]
Table[n - Sum[DivisorSum[k, (-1)^(# + 1) &], {k, 1, n - 1}], {n, 1, 80}]
nmax = 80; CoefficientList[Series[x/(1 - x) (1 + Sum[x^(2 k)/(1 + x^k), {k, 1, nmax}]), {x, 0, nmax}], x] // Rest
PROG
(PARI) a(n) = sum(k=1, n, ceil(n/k) % 2); \\ Michel Marcus, May 25 2020
(Python)
from math import isqrt
def A330926(n): return n+(s:=isqrt(n-1))**2-((t:=isqrt(m:=n-1>>1))**2<<1)-(sum((n-1)//k for k in range(1, s+1))-(sum(m//k for k in range(1, t+1))<<1)<<1) # Chai Wah Wu, Oct 23 2023
CROSSREFS
Sequence in context: A078709 A023022 A177501 * A323273 A100677 A188637
KEYWORD
nonn
AUTHOR
Ilya Gutkovskiy, May 25 2020
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified May 7 00:25 EDT 2024. Contains 372298 sequences. (Running on oeis4.)