cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

User: Jonatan Djurachkovitch

Jonatan Djurachkovitch's wiki page.

Jonatan Djurachkovitch has authored 1 sequences.

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.

Original entry on oeis.org

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

Author

Jonatan Djurachkovitch, Apr 01 2025

Keywords

Comments

24 is the largest number for which a(n) = 0.
From David A. Corneth, Apr 04 2025: (Start)
As b + c*d = n where b < c < d we have b is at its largest when c = b+1 and d = b+2 and so b <= sqrt(n + 2) - 2.
Proof: c = b + 1 and d = b + 2 gives b + c*d = b + (b + 1)*(b + 2) = b^2 + 4*b + 2 <= n.
Adding two to both sides gives b^2 + 4*b + 4 = (b + 2)^2 <= n + 2 and so b <= sqrt(n + 2) - 2.
Once b is chosen, c*d = n - b and so we can look at divisor pairs (c, d) of n - b having b < c < d. (End)

Examples

			13 can be written as 1 + 3 * 4 and as 1 + 2 * 6, so a(13) = 2.
		

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)