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!)
A346457 a(n) is the smallest number k such that |Sum_{j=1..k} (-1)^omega(j)| = n, where omega(j) is the number of distinct primes dividing j. 3
1, 4, 5, 8, 9, 32, 77, 88, 93, 94, 95, 96, 99, 100, 119, 124, 147, 148, 161, 162, 189, 206, 207, 208, 209, 210, 213, 214, 215, 216, 217, 218, 219, 226, 329, 330, 333, 334, 335, 394, 395, 416, 417, 424, 425, 428, 489, 514, 515, 544, 545, 546, 549, 554, 579, 584, 723, 724, 725, 800 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
LINKS
FORMULA
a(n) = min {k : |Sum_{j=1..k} mu(rad(j))| = n}, where mu is the Moebius function and rad is the squarefree kernel.
MAPLE
N:= 10000: # for values <= N
omega:= n -> nops(numtheory:-factorset(n)):
R:= map(n -> (-1)^omega(n), [$1..10000]):
S:= map(abs, ListTools:-PartialSums(R)):
m:= max(S):
V:= Vector(m):
for i from 1 to N do if S[i] > 0 and V[S[i]] = 0 then V[S[i]]:= i fi od:
convert(V, list); # Robert Israel, Oct 30 2023
MATHEMATICA
Table[k=1; While[Abs[Sum[(-1)^PrimeNu@j, {j, k}]]!=n, k++]; k, {n, 30}] (* Giorgos Kalogeropoulos, Jul 19 2021 *)
PROG
(PARI) a(n) = my(k=1); while (abs(sum(j=1, k, (-1)^omega(j))) != n, k++); k; \\ Michel Marcus, Jul 19 2021
CROSSREFS
Sequence in context: A067271 A268128 A064394 * A141220 A340762 A092022
KEYWORD
nonn
AUTHOR
Ilya Gutkovskiy, Jul 19 2021
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 4 13:55 EDT 2024. Contains 372243 sequences. (Running on oeis4.)