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-9 of 9 results.

A003681 a(n) = min { p +- q : p +- q > 1 and p*q = Product_{k=1..n-1} a(k) }.

Original entry on oeis.org

2, 3, 5, 7, 11, 13, 17, 107, 197, 3293, 74057, 1124491, 1225063003, 48403915086083, 229199690093487791653, 139394989871393443893426292667, 2310767115930351361890156080500119173238113, 521722354210765171422123515738862106081757768167379798858040637
Offset: 1

Views

Author

Keywords

Comments

a(n) = A082120(Product_{k=1..n-1} a(k)) for n >= 3. - Robert Israel, Aug 12 2015
The + sign in the definition applies only for n = 1 and n = 2, thereafter only the - sign is relevant and will yield the minimum. The definition could be reformulated in a way similar to that of A056737. - M. F. Hasler, Aug 17 2015

Examples

			a(4) = 7 because 2*3*5 = 30 whose divisors are 1, 2, 3, 5, 6, 10, 15 and 30. The closest p and q are 5 and 6 but its difference is 1 so the next closest p and q are 3 and 10 whose difference is 7.
		

References

  • J. H. Conway, personal communication.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Programs

  • Mathematica
    a[1] = 2; a[2] = 3; a[n_] := a[n] = Block[{d, l, t, p = Product[a[i], {i, n - 1}]}, d = Divisors[p]; l = Length[d]; t = Take[d, {l/2 - 1, l/2 + 2}]; If[t[[3]] - t[[2]] == 1, t[[4]] - t[[1]], t[[3]] - t[[2]]]]; Array[a, 16] (* Robert G. Wilson v, May 27 2012 *)
  • PARI
    A003681(N,a=[2,3])={while(#a1||next;a=concat(a,d[i+1]-d[#d-i]);break));a} \\ May require allocatemem() for N >= 15. - M. F. Hasler, Aug 17 2015

Extensions

a(15) from Robert G. Wilson v, Feb 26 1996
a(16) from Naohiro Nomoto, Jun 25 2001
a(17) from Robert G. Wilson v, Sep 15 2006
a(18) from Robert G. Wilson v, Jul 20 2009
a(19) from Sean A. Irvine, Jul 29 2015

A082125 Smallest difference>1 between d and p/d for any divisor d of the partial product p of the sequence, starting with 4.

Original entry on oeis.org

4, 3, 4, 2, 4, 8, 16, 64, 512, 16384, 2097152, 2147483648, 140737488355328, 1180591620717411303424, 40564819207303340847894502572032, 365375409332725729550921208179070754913983135744
Offset: 0

Views

Author

Ralf Stephan, Apr 04 2003

Keywords

Comments

a(n) is a power of two for n>1 and log_2(a(n))=A073941(n) for n>2. - Ralf Stephan, Apr 16 2003

Crossrefs

Cf. A082120, A003681 (starts with 2, 3), A082126.
Cf. A029744.

Programs

  • PARI
    p=4; print1(p, ", "); for(n=1, 50, v=divisors(p); r=sqrt(p); t=0; for(k=1, matsize(v)[2], if(v[k]>=r, t=k; break)); if(v[t]^2==p, u=t, u=t-1); if(v[t]-v[u]<2, u=u-1; t=t+1); print1(v[t]-v[u]", "); p=p*(v[t]-v[u]))

A082119 Smallest positive difference between d and n/d for any divisor d of n.

Original entry on oeis.org

1, 2, 3, 4, 1, 6, 2, 8, 3, 10, 1, 12, 5, 2, 6, 16, 3, 18, 1, 4, 9, 22, 2, 24, 11, 6, 3, 28, 1, 30, 4, 8, 15, 2, 5, 36, 17, 10, 3, 40, 1, 42, 7, 4, 21, 46, 2, 48, 5, 14, 9, 52, 3, 6, 1, 16, 27, 58, 4, 60, 29, 2, 12, 8, 5, 66, 13, 20, 3, 70, 1, 72, 35, 10, 15, 4, 7, 78, 2, 24, 39, 82, 5
Offset: 2

Views

Author

Ralf Stephan, Apr 04 2003

Keywords

Comments

a(n) = A056737(n) for nonsquare n. a(p) = p-1 for prime p.

Crossrefs

Cf. A082120, A000037 (nonsquares), A056737.

Programs

  • Maple
    with(numtheory):
    a:= n-> min(seq((h-> `if`(h>0, h, NULL))(d-n/d), d=divisors(n))):
    seq(a(n), n=2..100);  # Alois P. Heinz, Nov 12 2014
  • Mathematica
    a[n_] := Min[Table[If[# > 0, #, Nothing]&[d-n/d], {d, Divisors[n]}]];
    Table[a[n], {n, 2, 100}] (* Jean-François Alcover, Jan 13 2025, after Alois P. Heinz *)
  • PARI
    a(n) = my(v=divisors(n), r=sqrt(n), t=0); for(k=1, length(v), if(v[k]>=r, t=k; break)); if(v[t]^2==n, u=t, u=t-1);  if(v[t]-v[u]<1, u=u-1; t=t+1); v[t]-v[u];

A082123 Smallest difference > 1 between d and p/d for any divisor d of the partial product p of the sequence, starting with 17.

Original entry on oeis.org

17, 16, 26, 36, 76, 94, 432, 37220, 996768, 158267352, 973348166592, 8429202561226344, 419324164827901536306744, 339991740461303603766175692597227316, 12025891484499365294341150949542442100059557280661504
Offset: 1

Views

Author

Ralf Stephan, Apr 04 2003

Keywords

Crossrefs

Cf. A082120, A003681 (starts with 2, 3), A082124.

Programs

  • Maple
    branch:= proc(m,dm, bestyet)
        local t,x, nby,r;
        nby:= bestyet;
        for t from F[m][2] by -1 to 0 do
          x:= dm*F[m][1]^t;
          if x >= nby then next
          elif x >= c then nby:= x
          elif (x*R[m] < c) or (m=nF) then break
          else nby:= branch(m+1,x,nby);
          fi
        od;
        nby
    end proc:
    P:= 17: A[1]:= 17:
    for n from 2 to 15 do
      c:= ceil(1/2+1/2*sqrt(5+4*P));
      while not type(c,integer) do Digits:= 2*Digits; c:= eval(c) od:
      F:= ifactors(P)[2]; nF:= nops(F);
      F:= sort(F,(s,t)->s[1]>t[1]);
      R:= [seq(mul(F[i][1]^F[i][2],i=j+1..nF),j=1..nF)];
      d:= branch(1,1,P);
      A[n]:= d - P/d;
      P:= P*A[n]
    od:
    seq(A[n],n=1..15); # Robert Israel, May 20 2015
  • PARI
    p=17; print1(p,","); for(n=1,13,r=floor(sqrt(p)); d1=1; d2=1; nE=omega(p); P=factor(p); E=P[,2]; P=P[,1]; forvec(v=vector(nE,i,[0,E[i]]),x=prod(k=1,nE,P[k]^v[k]); if(x<=r && x>=d2,d1=d2; d2=x,if(x<=d2 && x>=d1,d1=x))); difer=p/d2-d2; if(difer<=1,difer=p/d1-d1); print1(difer","); p*=difer)

Extensions

a(12) from Herman Jamke (hermanjamke(AT)fastmail.fm), Nov 02 2006
a(13) from Herman Jamke (hermanjamke(AT)fastmail.fm), Nov 14 2006
a(14) and a(15) from Robert Israel, May 20 2015

A082126 Smallest difference>1 between d and p/d for any divisor d of the partial product p of the sequence, starting with 19.

Original entry on oeis.org

19, 18, 29, 27, 9, 27, 2187, 6561, 531441, 387420489, 7625597484987, 328256967394537077627, 381520424476945831628649898809, 235655016338368235499067731945871638181119123
Offset: 0

Views

Author

Ralf Stephan, Apr 04 2003

Keywords

Comments

Except for the first three, the members are all powers of 3. Proved by Luke Pebody, pers. comm.

Crossrefs

Cf. A082120, A003681 (starts with 2, 3), A082128.

Programs

  • PARI
    p=19; print1(p, ", "); for(n=1, 50, v=divisors(p); r=sqrt(p); t=0; for(k=1, matsize(v)[2], if(v[k]>=r, t=k; break));  if(v[t]^2==p, u=t, u=t-1);  if(v[t]-v[u]<2, u=u-1; t=t+1); print1(v[t]-v[u]", "); p=p*(v[t]-v[u]))

A082128 Smallest difference>1 between d and p/d for any divisor d of the partial product p of the sequence, starting with 21.

Original entry on oeis.org

21, 4, 5, 13, 8, 2, 32, 16, 64, 512, 131072, 4194304, 8589934592, 9007199254740992, 75557863725914323419136, 20769187434139310514121985316880384
Offset: 0

Views

Author

Ralf Stephan, Apr 04 2003

Keywords

Comments

For n>3, the members are all powers of two. Proved by Luke Pebody, pers. comm.

Crossrefs

Cf. A082120, A003681 (starts with 2, 3).

Programs

  • PARI
    p=21; print1(p, ", "); for(n=1, 50, v=divisors(p); r=sqrt(p); t=0; for(k=1, matsize(v)[2], if(v[k]>=r, t=k; break)); if(v[t]^2==p, u=t, u=t-1); if(v[t]-v[u]<2, u=u-1; t=t+1); print1(v[t]-v[u]", "); p=p*(v[t]-v[u]))

A082121 Smallest difference>1 between d and p/d for any divisor d of the partial product p of the sequence, starting with 7.

Original entry on oeis.org

7, 6, 11, 19, 37, 109, 515, 3301, 267271, 130914197, 209015618081, 887384060899271, 58605404461258015758293
Offset: 0

Views

Author

Ralf Stephan, Apr 04 2003

Keywords

Crossrefs

Cf. A082120, A003681 (starts with 2, 3), A082122.

Programs

  • PARI
    p=7; print1(p, ", "); for(n=1, 50, v=divisors(p); r=sqrt(p); t=0; for(k=1, matsize(v)[2], if(v[k]>=r, t=k; break)); if(v[t]^2==p, u=t, u=t-1); if(v[t]-v[u]<2, u=u-1; t=t+1); print1(v[t]-v[u]", "); p=p*(v[t]-v[u]))

A082122 Smallest difference > 1 between d and p/d for any divisor d of the partial product p of the sequence, starting with 11.

Original entry on oeis.org

11, 10, 17, 21, 23, 31, 43, 167, 6383, 31741, 52112213, 37549127743, 36777947021270771, 504837176634758950812127
Offset: 0

Views

Author

Ralf Stephan, Apr 04 2003

Keywords

Crossrefs

Cf. A082120, A003681 (starts with 2, 3), A082123.

Programs

  • PARI
    p=11; print1(p, ", "); for(n=1, 50, v=divisors(p); r=sqrt(p); t=0; for(k=1, matsize(v)[2], if(v[k]>=r, t=k; break)); if(v[t]^2==p, u=t, u=t-1); if(v[t]-v[u]<2, u=u-1; t=t+1); print1(v[t]-v[u]", "); p=p*(v[t]-v[u]))

A082124 Smallest difference>1 between d and p/d for any divisor d of the partial product p of the sequence, starting with 9.

Original entry on oeis.org

9, 8, 6, 6, 6, 36, 39, 618, 4932, 60192, 3075084, 349550100, 15219084556800, 13331385308976969710
Offset: 1

Views

Author

Ralf Stephan, Apr 04 2003

Keywords

Crossrefs

Cf. A082120, A082123, A003681 (starts with 2, 3), A082125.

Programs

  • PARI
    p=9; print1(p, ", "); for(n=1, 50, v=divisors(p); r=sqrt(p); t=0; for(k=1, matsize(v)[2], if(v[k]>=r, t=k; break));  if(v[t]^2==p, u=t, u=t-1);  if(v[t]-v[u]<2, u=u-1; t=t+1); print1(v[t]-v[u]", "); p=p*(v[t]-v[u]))

Extensions

a(14) from Herman Jamke (hermanjamke(AT)fastmail.fm), Nov 02 2006
Showing 1-9 of 9 results.