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-5 of 5 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

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

Original entry on oeis.org

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

Views

Author

David A. Corneth, Jul 31 2015

Keywords

Comments

From Vladimir Shevelev, Aug 02 2015: (Start)
Conjecture: liminf_{n->infinity} (a(n)) = 0.
Note that this limit should realize on a subsequence of primes. Indeed, if n>=4 is a composite number, then n = p*q, p>=2, q>=2. If p <= q, then, for x=1, y = p-1, z = q-1, we have x*y*z + x + y + z = 1*(p-1)*(q-1) + 1 + (p-1) + (q-1) = p*q = n; so a(n) >= 1. If p > q, then we set x=1, y = q-1, z = p-1, and again a(n) >= 1.
Note also that primes r for which a(r) = 0 should grow fast enough. Indeed, r should not be a prime of the form (2*t+1)*k + t + 2, 2 <= t <= k, (*) where t==0 or 2 (mod 3).
Indeed, in this case r = x*y*z + x + y + z for x = 2, y = t, z = k. Since gcd(2*t+1, t+2) = gcd(2*(t+2)-3, t+2)=1, then for every considered t and k>=t, the progression (*) contains infinitely many primes r for which a(r) >= 1.
Finally, note that limsup_{n->infinity} (a(n)) = infinity. Indeed, this limit is realized, say, on primorials (A002110), since, when m goes to infinity, the number of representations of A002110(m) of the form p*q tends to infinity. So on primorials >1 we have a strictly monotonic subsequence: 0,1,3,8,25,46,78,164 ... (the terms 46 and 78 were calculated by Michel Marcus, 164 - by David A. Corneth). (End)

Crossrefs

Programs

  • Mathematica
    a[n_] := Sum[Sum[Boole[Mod[n-x-y, x y + 1] == 0 && n-x >= y(x y + 2)], {y, x, (n - x(1+x^2))/2 // Floor}], {x, 1, n/3 // Floor}];
    Table[a[n], {n, 0, 99}] (* Jean-François Alcover, Sep 20 2018, after M. F. Hasler *)
  • PARI
    a(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))) \\ M. F. Hasler, Jul 31 2015

Formula

a(n) = A071693(n) - A008619(n) = A071693(n) - floor(n/2) - 1.

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))))),","))
Showing 1-5 of 5 results.