A360659 a(n) is the minimum sum of a completely multiplicative sign sequence of length n.
0, 1, 0, -1, 0, -1, 0, -1, -2, -1, 0, -1, -2, -3, -4, -3, -2, -3, -4, -5, -4, -5, -4, -5, -6, -5, -6, -7, -8, -9, -8, -9, -8, -7, -8, -7, -6, -7, -8, -7, -8, -9, -10, -11, -12, -13, -14, -15, -14, -13, -12, -13, -14, -15, -14, -13, -14, -15, -16, -17, -18, -19
Offset: 0
Keywords
Examples
There are eight completely multiplicative sign sequences of length 5: +--+-, +--++, +-++-, +-+++, ++-+-, ++-++, ++++- and +++++. The sums of those sequences are, respectively, -1, 1, 1, 3, 1, 3, 3 and 5. Hence, the minimum sum is equal to -1 and so a(5) = -1.
Links
- David A. Corneth, Table of n, a(n) for n = 0..181 (terms to n = 99 from Bartlomiej Pawlik)
Programs
-
PARI
F(n, b)={vector(n, k, my(f=factor(k)); prod(i=1, #f~, if(bittest(b, primepi(f[i, 1])-1), 1, -1)^f[i, 2]))} a(n)={my(m=oo); for(b=0, 2^primepi(n)-1, m=min(m, vecsum(F(n,b)))); m} \\ Andrew Howroyd, Feb 16 2023
-
Python
from itertools import product from sympy import primerange, primepi, factorint def A360659(n): a = dict(zip(primerange(n+1),range(c:=primepi(n)))) return (min(sum(sum(e for p,e in factorint(m).items() if b[a[p]])&1^1 for m in range(1,n+1)) for b in product((0,1),repeat=c))<<1)-n # Chai Wah Wu, May 31 2024
Formula
a(n) <= A002819(n).
Conjecture: a(n) < A002819(n) for n > 20.
|a(n) - a(n-1)| = 1 for n > 0. - Andrew Howroyd, Feb 16 2023
From David A. Corneth, May 28 2024: (Start)
a(k^2) = a(k^2-1) + 1 for k >= 1.
a(p) = a(p-1) - 1 for prime p. (End)
Comments