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.

Showing 1-7 of 7 results.

A072670 Number of ways to write n as i*j + i + j, 0 < i <= j.

Original entry on oeis.org

0, 0, 0, 1, 0, 1, 0, 1, 1, 1, 0, 2, 0, 1, 1, 2, 0, 2, 0, 2, 1, 1, 0, 3, 1, 1, 1, 2, 0, 3, 0, 2, 1, 1, 1, 4, 0, 1, 1, 3, 0, 3, 0, 2, 2, 1, 0, 4, 1, 2, 1, 2, 0, 3, 1, 3, 1, 1, 0, 5, 0, 1, 2, 3, 1, 3, 0, 2, 1, 3, 0, 5, 0, 1, 2, 2, 1, 3, 0, 4, 2, 1, 0, 5, 1, 1, 1, 3, 0, 5, 1, 2, 1, 1, 1, 5, 0, 2, 2, 4, 0, 3, 0, 3, 3
Offset: 0

Views

Author

Reinhard Zumkeller, Jun 30 2002

Keywords

Comments

a(n) is the number of partitions of n+1 with summands in arithmetic progression having common difference 2. For example a(29)=3 because there are 3 partitions of 30 that are in arithmetic progressions: 2+4+6+8+10, 8+10+12 and 14+16. - N-E. Fahssi, Feb 01 2008
From Daniel Forgues, Sep 20 2011: (Start)
a(n) is the number of nontrivial factorizations of n+1, in two factors.
a(n) is the number of ways to write n+1 as i*j + i + j + 1 = (i+1)(j+1), 0 < i <= j. (End)
a(n) is the number of ways to write n+1 as i*j, 1 < i <= j. - Arkadiusz Wesolowski, Nov 18 2012
For a generalization, see comment in A260804. - Vladimir Shevelev, Aug 04 2015
Number of partitions of n into 3 parts whose largest part is equal to the product of the other two. - Wesley Ivan Hurt, Jan 04 2022

Examples

			a(11)=2: 11 = 1*5 + 1 + 5 = 2*3 + 2 + 3.
From _Daniel Forgues_, Sep 20 2011 (Start)
Number of nontrivial factorizations of n+1 in two factors:
  0 for the unit 1 and prime numbers
  1 for a square: n^2 = n*n
  1 for 6 (2*3), 10 (2*5), 14 (2*7), 15 (3*5)
  1 for a cube: n^3 = n*n^2
  2 for 12 (2*6, 3*4), for 18 (2*9, 3*6) (End)
		

Crossrefs

Programs

  • Maple
    0, seq(ceil(numtheory:-tau(n+1)/2)-1, n=1..100); # Robert Israel, Aug 04 2015
  • Mathematica
    p2[n_] := 1/2 (Length[Divisors[n]] - 2 + ((-1)^(Length[Divisors[n]] + 1) + 1)/2); Table[p2[n + 1], {n, 0, 104}] (* N-E. Fahssi, Feb 01 2008 *)
    Table[Ceiling[DivisorSigma[0, n + 1]/2] - 1, {n, 0, 104}] (* Arkadiusz Wesolowski, Nov 18 2012 *)
  • PARI
    is_ok(k,i,j)=0=i&&k===i*j+i+j;
    first(m)=my(v=vector(m,z,0));for(l=1,m,for(j=1,l,for(i=1,j,if(is_ok(l,i,j),v[l]++))));concat([0],v); /* Anders Hellström, Aug 04 2015 */
    
  • PARI
    a(n)=(numdiv(n+1)+issquare(n+1))/2-1 \\ Charles R Greathouse IV, Jul 14 2017

Formula

a(n) = A038548(n+1) - 1.
From N-E. Fahssi, Feb 01 2008: (Start)
a(n) = p2(n+1), where p2(n) = (1/2)*(d(n) - 2 + ((-1)^(d(n)+1)+1)/2); d(n) is the number of divisors of n: A000005.
G.f.: Sum_{n>=1} a(n) x^n = 1/x Sum_{k>=2} x^(k^2)/(1-x^k). (End)
lim_{n->infinity} a(A002110(n)-1) = infinity. - Vladimir Shevelev, Aug 04 2015
a(n) = A161840(n+1)/2. - Omar E. Pol, Feb 27 2019
Sum_{k=1..n} a(k) ~ n * (log(n) + 2*gamma - 3) / 2, where gamma is Euler's constant (A001620). - Amiram Eldar, Jan 14 2024

A261029 Number of ways to write n in the form F(x,y,z) = x^3 + y^3 + z^3 - 3xyz, where 0 <= x <= y <= z and z >= x+1.

Original entry on oeis.org

0, 1, 1, 0, 1, 1, 0, 1, 2, 1, 1, 1, 0, 1, 1, 0, 2, 1, 1, 1, 2, 0, 1, 1, 0, 1, 1, 2, 3, 1, 0, 1, 2, 0, 1, 2, 1, 1, 1, 0, 2, 1, 0, 1, 2, 1, 1, 1, 0, 2, 1, 0, 2, 1, 3, 1, 3, 0, 1, 1, 0, 1, 1, 1, 3, 2, 0, 1, 2, 0, 2, 1, 2, 1, 1, 0, 2, 2, 0, 1, 2, 3, 1, 1, 0, 1, 1
Offset: 0

Views

Author

Vladimir Shevelev, Aug 22 2015

Keywords

Comments

The following is a short proof of the corresponding 1915 result of R. D. Carmichael for a weaker restriction.
If n is in A074232, then a(n) >= 1, in view of the following identities: if n == 1 (mod 3), then n = F((n-1)/3, (n-1)/3, (n+2)/3); if n == 2 (mod 3), then n = F((n-2)/3, (n+1)/3, (n+1)/3); if n == 0 (mod 9), then n = F(n/9-1, n/9, n/9+1). QED
Further, if n > 1 is the cube of a positive number or the sum of two positive cubes, except for 2 and 9, then a(n) >= 2.
The sequence is unbounded.
Proof. We use the homogeneity of F(x,y,z) of degree 3. By induction, show that a(8^k) >= k+1. It is evident for k=0. Suppose that it is true for some value of k. Take k+1 triples (x_i,y_i,z_i) such that 8^k = F(x_i, y_i, z_i), i=1,...,k+1. Then for k+1 triples of even numbers (2*x_i, 2*y_i, 2*z_i) we have 8^(k+1) = F(2*x_i, 2*y_i, 2*z_i). But there is always a triple of not all even numbers (x=(n-1)/3, y=(n-1)/3, z=(n+2)/3) or (x=(n-2)/3, y=(n+1)/3, z=(n+1)/3), where n = 8^(k+1), for which 8^(k+1) = F(x,y,z). So a(8^(k+1)) >= k+2. QED
Theorem. For every n there exists k such that a(k)=n. For a proof, see [Shevelev] link.
Smallest such k are presented in sequence A260935.

Crossrefs

Programs

  • Mathematica
    r[n_] := Reduce[0 <= x <= y <= z && z >= x+1 && n == x^3 + y^3 + z^3 - 3 x y z, {x, y, z}, Integers];
    a[n_] := Which[rn = r[n]; rn === False, 0, rn[[0]] === And, 1, rn[[0]] === Or, Length[rn], True, Print["error ", rn]];
    Array[a, 100, 0] (* Jean-François Alcover, Nov 06 2018 *)

Formula

For positive n, a(n)=0, if and only if n == 3 or 6 (mod 9); if p is prime, other than 3, then a(p) = a(2*p) = 1.
For n >= 1, a(8^(n-1)) = n.

Extensions

More terms from Peter J. C. Moses, Aug 22 2015

A260804 Number of ways to write n as n = x * y * z * t + x + y + z + t where 1 <= x <= y <= z <= t <= n.

Original entry on oeis.org

0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 1, 1, 0, 2, 0, 2, 1, 2, 0, 2, 1, 2, 1, 1, 1, 4, 1, 2, 1, 2, 1, 3, 0, 3, 2, 2, 1, 5, 0, 1, 2, 4, 1, 4, 0, 3, 3, 2, 1, 4, 2, 3, 2, 2, 0, 5, 1, 4, 1, 2, 3, 6, 1, 2, 2, 5, 1, 4, 0, 4, 3, 3, 1, 6, 1, 2, 4, 4, 2, 4, 1, 4, 2, 2, 1, 8, 2, 4, 2, 4, 2, 5, 1, 4, 2, 2, 3, 8, 1, 3, 4, 4, 0, 4, 1, 6, 4, 3, 0
Offset: 0

Views

Author

David A. Corneth, Jul 31 2015

Keywords

Comments

a(n) = A071689(n) - A001399(n) = A071689(n) - round((n+3)^2/12).
From Vladimir Shevelev, Aug 03 2015: (Start)
Is the set of n for which a(n)=0 finite?
Note that this set contains only numbers n of the form prime + 1. Indeed, if n-1>=4 is a composite number, then n = p*q + 1, p>=2, q>=2. If p <= q, then, for x=1, y=1, z = p-1, t = q-1, we have
x*y*z*t + x + y + z + t = 1*1*(p-1)*(q-1) + 1 + 1 + (p-1) + (q-1) = p*q + 1 = n; so a(n) >= 1. If p > q, then we set x=1, y=1, z = q-1, t = p-1, and again a(n) >= 1.
Note also that limsup_{n->infinity} (a(n)) = infinity. Indeed, this limit is realized, say, on n = primorials +1 (A002110), since, when m goes to infinity, the number of representations of n - 1 = A002110(m) of the form p*q tends to infinity. On primorials +1 > 2 we have a subsequence: 0,1,3,8,27,... .
A generalization. For k>=2, let b_k(n) be the number of ways to write n as n = x_1 * x_2 *...* x_k + x_1 + x_2 + ... + x_k, where 1 <= x_1 <= x_2 <= ... <= x_k <= n.
Then, for n >= k-1, b_k(n) = 0 yields that n - k + 3 is prime with similar other comments. In particular, only b_2(n) = 0 if and only if n+1 is 1 or prime (cf. A072670). (End)

Crossrefs

Programs

  • Mathematica
    xmax = 9; ymax = 21; zmax = 98; (* When extending data, terms where maxima for x, y or z are reached have to be checked one by one. *)
    r[n_] := r[n] = Module[{r1, r2, r3, rn}, r1 = Reap[Do[rn = Reduce[n == x y z t + x + y + z + t && 1 <= x <= y <= z <= t <= n, t, Integers]; If[rn =!= False, Sow[{x, y, z, t} /. {ToRules[rn]}]], {x, 1, xmax}, {y, 1, ymax}, {z, 1, zmax}]]; If[r1 == {Null, {}} , {}, r2 = r1[[2, 1]]; r3 = Flatten[r2, 1]; If[Max[r3[[All, 1]]] == xmax, Print[ "xmax reached at n = ", n]]; If[Max[r3[[All, 2]]] == ymax, Print["ymax reached at n = ", n]]; If[Max[r3[[All, 3]]] == zmax, Print["zmax reached at n = ", n]]; r3]];
    a[n_] := Length[r[n]];
    Table[Print["a(", n, ") = ", a[n], " ", r[n]]; a[n], {n, 0, 109}] (* Jean-François Alcover, Nov 19 2018 *)

Formula

If A260803(n) > 0, then a(n+1) > 0. So if a(n+1) = 0, then A260803(n) = 0. Converse statement is not true. For example, a(24) > 0, while A260803(23) = 0. - Vladimir Shevelev, Aug 14 2015

A260965 Smallest number r>=3 such that for k>=r the number k - 3 + prime(n) can be represented in the form x_1*...*x_k + x_1 + ... + x_k, where 1 <= x_1 <= ... <= x_k, or a(n)=0 if there is no such r.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 3, 4, 3, 0, 0, 4, 0, 3, 0, 3, 3, 0, 4, 3, 3, 4, 3, 4, 0, 3, 5, 3, 4, 3, 3, 3, 3, 3, 3, 4, 3, 4, 3, 3, 0, 0, 5, 3, 3, 3, 0, 3, 3, 4, 3, 3, 0, 3, 3, 3, 3, 3, 3, 4, 3, 3, 3, 3, 4, 3, 3, 4, 3, 3, 3, 3, 0, 3, 3, 3, 3, 3, 3, 3, 0, 5, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 3, 3, 3, 3, 4, 3, 3, 3, 3, 4, 3, 3, 4, 3, 3, 3
Offset: 1

Views

Author

Vladimir Shevelev, Aug 06 2015

Keywords

Comments

Let m>=k-1. The condition 'm - k + 3 is prime' is a necessary condition for the non-representation of m by the form A = x_1*...*x_k + x_1 + ... + x_k, where 1 <= x_1 <= ... <= x_k (see link [Shevelev], Proposition 2). In particular, if m - k + 3 = prime(n), then a sufficient condition for that is a(n) = 0 or a(n) > k.
Conjecture. The sequence contains only a finite number of zero terms.
About the conjecture, for n <= 10000, 23 values a(n) are 0, of which 19 have n <= 100. The highest such n is 450. a(n) is at most five for n <= 10000 and mostly 3 (9747 times). - David A. Corneth, Aug 16 2015
Upper estimate of a(n). A representation of prime(n) + k - 3 for the minimal possible k by the form A we call optimal. Show that in an optimal representation all x_i>=2.
Indeed, let x_1 = ... = x_u = 1 and x_i >= 2 for u+1 <= i <= k, such that prime(n) + k - 3 = x_(u+1)*...*x_k + u + x_(u+1) + ... + x_k be an optimal representation (note that u
So for an optimal representation, prime(n) + k - 3 = A >= 2^k + 2*k and 2^k + k + 3 <= prime(n). Thus a(n) = k_min < log_2(prime(n)) (cf. formula).
a(n)>0 iff either there exists t_2>=1 such that B(t_2) = 2^t_2 + t_2 + 3 = prime(n) or there exist t_2>=0, t_3>=1 such that B(t_2, t_3) = 2^t_2*3^t_3 + t_2 + 2*t_3 + 3 = prime(n) or there exist t_2>=0, t_3>=0, t_4>=1 such that B(t_2, t_3, t_4) = 2^t_2*3^t_3*4^t_4 + t_2 + 2*t_3 + 3*t_4 + 3 = prime(n), etc.
For a proof, distinguish the following cases for x_i >= 2, i=1,...,k, and A = x_1*...*x_k + x_1 + ... + x_k:
(i) all x_i = 2. Here k=t_2 and A = A(t_2) = 2^t_2 + 2*t_2. If this is t_2 - 3 + prime, then prime = 2^t_2+t_2+3 = B(t_2). For example, for t_2=4 we have 23 = prime(9). Thus for k>=4, k - 3 + prime(9) is represented by a considered form A and a(9)=4.
(ii) the first t_2 consecutive x_i = 2 and t_3 consecutive x_i = 3. Note that t_3 >= 1 (otherwise, we have case (i)). Here A = A(t_2, t_3) = (2^t_2)*(3^t_3) + 2*t_2 + 3*t_3. If this is k - 3 + prime(n) = t_2 + t_3 -3 + prime(n), then prime(n) = (2^t_2)*(3^t_3) + t_2 + 2*t_3 + 3 = B(t_2, t_3). For example, for t_2=2, t_3=1 we have 19=prime(8). Thus for k>=2+1=3, k-3+prime(8) is represented by a considered form A and a(8)=2+1=3.
etc. QED
For an algorithm of calculation of a(n), see link [Shevelev], pp. 4-5.

Examples

			a(8)=3. Indeed, prime(8) = 19 and for k=3, set x_1 = x_2 = 2, x_3 = 3, and, for k>=4, set x_1 = ... = x_(k-3) = 1, x_(k-2) = x_(k-1) = 2, x_k = 3.
In both cases, x_1*...*x_k + x_1 + ... + x_k = 2*2*3 + (k-3) + 2 + 2 + 3 = k + 19 - 3.
		

Crossrefs

Formula

a(n) <= floor(log_2(prime(n))).

Extensions

More terms from David A. Corneth, Aug 16 2015

A071689 Number of ways to write n as n = x*y*z*t+x+y+z+t 0<=x<=y<=z<=t<=n.

Original entry on oeis.org

1, 1, 2, 3, 4, 6, 7, 9, 10, 13, 15, 17, 19, 23, 24, 29, 31, 35, 37, 42, 45, 50, 53, 57, 62, 69, 71, 77, 81, 87, 92, 99, 102, 111, 116, 122, 128, 138, 140, 148, 156, 165, 170, 180, 184, 195, 203, 210, 218, 229, 236, 246, 254, 263, 271, 285, 291, 304, 311, 322
Offset: 0

Author

Benoit Cloitre, Jun 23 2002

Keywords

Crossrefs

Programs

  • Mathematica
    xmax = 3; ymax = 66; zmax = 99;(* When extending data, terms where maxima for x, y or z are reached have to be checked one by one. *)
    r[n_] := r[n] = Module[{r1, r2, r3, rn}, r1 = Reap[Do[rn = Reduce[n == x y z t + x + y + z + t && 0 <= x <= y <= z <= t <= n, t, Integers]; If[rn =!= False, Sow[{x, y, z, t} /. {ToRules[rn]}]], {x, 0, xmax}, {y, 0, ymax}, {z, 0, zmax}]]; If[r1 == {Null, {}} , {}, r2 = r1[[2, 1]]; r3 = Flatten[r2, 1]; If[Max[r3[[All, 1]]] == xmax, Print["xmax reached at n = ", n]]; If[Max[r3[[All, 2]]] == ymax, Print["ymax reached at n = ", n]]; If[Max[r3[[All, 3]]] == zmax, Print["zmax reached at n = ", n]]; r3]];
    a[n_] := Length[r[n]];
    Table[Print[n, " ", a[n]]; a[n], {n, 0, m = 199}] (* Jean-François Alcover, Nov 20 2018 *)
  • PARI
    for(n=0,50,print1(sum(a=0,n,sum(b=0,a,sum(c=0,b,sum(d=0,c,if(a*b*c*d+a+b+c+d-n,0,1))))),","))

A071693 Number of ways to write n as n = x*y*z + x + y + z where 0 <= x <= y <= z <= n.

Original entry on oeis.org

1, 1, 2, 2, 4, 3, 5, 4, 6, 6, 7, 6, 9, 7, 10, 9, 11, 9, 12, 11, 13, 12, 13, 12, 17, 14, 16, 15, 17, 16, 19, 16, 19, 19, 20, 19, 24, 19, 21, 22, 25, 21, 26, 22, 26, 25, 26, 25, 29, 27, 28, 28, 29, 27, 33, 29, 33, 30, 31, 32, 37, 32, 34, 34, 37, 34, 38, 34, 38, 38, 39, 36, 43, 38, 40
Offset: 0

Author

Benoit Cloitre, Jun 23 2002

Keywords

Comments

a(n) >= floor(n / 2) + 1 = A008619(n). If x = 0 then n = x*y*z+x+y+z = y + z which has floor(n / 2) + 1 solutions. - David A. Corneth, Jul 31 2015
See A260803 for the case where 1 <= x <= y <= z. - M. F. Hasler, Jul 31 2015

Programs

  • Mathematica
    mx = 100; t = 0*Range@ mx; Do[n = x*y*z + x + y + z; If[n < mx, t[[n + 1]]++], {x, 0, mx}, {y, x, mx}, {z, y, mx}]; t (* Robert G. Wilson v, Jul 31 2015 *)
  • PARI
    for(n=0,74,print1(sum(a=0,n,sum(b=0,a,sum(c=0,b,a*b*c+a+b+c==n)))",")) \\ Zak Seidov, Jul 31 2015
    
  • PARI
    A071693(n)=sum(x=0,n\3,sum(y=x,(n-x*(1+x^2))\2,(n-x-y)%(x*y+1)==0&&n-x>=(x*y+2)*y)) \\ M. F. Hasler, Jul 31 2015

Extensions

a(0) = 1 prepended by David A. Corneth, Jul 30 2015

A350535 Integers that cannot be expressed as x + y + z + x*y*z for x,y,z >= 1.

Original entry on oeis.org

1, 2, 3, 5, 7, 11, 13, 17, 23, 31, 37, 41, 43, 53, 67, 71, 83, 97, 101, 107, 113, 157, 167, 181, 191, 193, 223, 233, 251, 283, 317, 347, 373, 421, 431, 487, 521, 563, 577, 613, 643, 647, 743, 907, 1033, 1091, 1103, 1193, 1201, 1213, 1277, 1291, 1423, 1427, 1471, 1543, 1583, 1597
Offset: 1

Author

Michel Marcus, Jan 04 2022

Keywords

Comments

Terms greater than 1 are prime.

Crossrefs

Cf. A260803.

Programs

  • PARI
    isok(n) = sum(x=1, n\3, sum(y=x, (n-x*(1+x^2))\2, (n-x-y)%(x*y+1)==0&&n-x>=y*(x*y+2))) == 0; \\ see A260803
    
  • Python
    from itertools import count, islice
    def A350535_gen(startvalue=1): # generator of terms >= startvalue
        for n in count(max(startvalue,1)):
            flag = True
            for x in range(1,n+1):
                if 3*x+x**3 > n or not flag:
                    break
                for y in range(x,n+1):
                    if x+2*y+x*y**2 > n:
                        break
                    if (n-x-y)%(1+x*y) == 0 and x+y*(2+x*y)<= n:
                        flag = False
                        break
            if flag:
                yield n
    A350535_list = list(islice(A350535_gen(),30)) # Chai Wah Wu, Oct 21 2022
Showing 1-7 of 7 results.