A347028 a(1) = 1; a(n+1) = -Sum_{k=1..n} a(floor(n/k)).
1, -1, 0, -2, 1, -3, 1, -4, 4, -6, 2, -7, 8, -8, 5, -13, 13, -14, 9, -15, 19, -21, 12, -22, 32, -26, 18, -36, 33, -37, 31, -38, 57, -48, 32, -56, 66, -57, 44, -74, 83, -75, 65, -76, 100, -102, 68, -103, 140, -108, 94, -136, 140, -137, 119, -149, 193, -174, 125, -175, 228, -176, 161, -224, 256
Offset: 1
Keywords
Programs
-
Mathematica
a[1] = 1; a[n_] := a[n] = -Sum[a[Floor[(n - 1)/k]], {k, 1, n - 1}]; Table[a[n], {n, 1, 65}] nmax = 65; A[] = 0; Do[A[x] = x - (x/(1 - x)) Sum[(1 - x^k) A[x^k], {k, 1, nmax}] + O[x]^(nmax + 1) // Normal, nmax + 1]; CoefficientList[A[x], x] // Rest
-
Python
from functools import lru_cache @lru_cache(maxsize=None) def A347028(n): if n == 1: return 1 c, j, k1 = n, 1, n-1 while k1 > 1: j2 = (n-1)//k1 + 1 c += (j2-j)*A347028(k1) j, k1 = j2, (n-1)//j2 return j-c # Chai Wah Wu, Apr 29 2025
Formula
G.f. A(x) satisfies: A(x) = x - (x/(1 - x)) * Sum_{k>=1} (1 - x^k) * A(x^k).