A382630 a(n) is the number of ways that n can be written as b+c*d, where b, c and d are positive integers and b < c < d.
0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 2, 1, 1, 1, 2, 0, 2, 1, 2, 2, 3, 0, 3, 2, 2, 1, 3, 1, 4, 2, 3, 3, 3, 1, 4, 3, 3, 1, 4, 2, 5, 3, 3, 4, 5, 1, 5, 3, 4, 3, 5, 2, 4, 3, 5, 5, 6, 1, 6, 5, 4, 4, 5, 3, 6, 4, 5, 3, 6, 2, 7, 6, 5, 5, 6, 4, 7, 3, 6, 6, 7, 2, 6, 6, 6, 4, 7, 3, 7
Offset: 0
Keywords
Examples
13 can be written as 1 + 3 * 4 and as 1 + 2 * 6, so a(13) = 2.
Links
- Robert Israel, Table of n, a(n) for n = 0..10000
- Skolornas Matematiktävling, Finaltävling i Linköping den 20 november 2021 (Swedish)
Programs
-
Maple
N:= 100: # for a(0) .. a(N) V:= Array(0..N): for b from 1 while b + (b+1)*(b+2) <= N do for c from b+1 while b + c*(c+1) <= N do for d from c+1 do x:= b+c*d; if x > N then break fi; V[x]:= V[x]+1 od od od: convert(V,list); # Robert Israel, May 04 2025
-
PARI
a(n) = { my(res = 0); for(b = 1, sqrtint(n + 2) - 2, d = divisors(n - b); ind = setsearch(d, b+1, 1 - ((n-b) % (b+1) == 0)); res += max(0, #d\2 - ind + 1); ); res } \\ David A. Corneth, Apr 04 2025
-
PARI
first(n) = { my(res = vector(n)); for(b = 1, sqrtint(n + 2), for(c = b + 1, sqrtint(n - b - 1), for(d = c + 1, (n - b) \ c, res[b + c*d]++ ); ); ); concat(0, res) } \\ David A. Corneth, Apr 04 2025
-
Python
# returns the first 100 terms as a list import numpy as np terms = 100 a = np.zeros(terms) for d in range(3,terms // 2): for c in range(2,d): for b in range(1,c): val = b + c*d if val < terms: a[val] += 1 print(a)
Comments