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

A032742 a(1) = 1; for n > 1, a(n) = largest proper divisor of n (that is, for n>1, maximum divisor d of n in range 1 <= d < n).

Original entry on oeis.org

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

Views

Author

Patrick De Geest, May 15 1998

Keywords

Comments

It seems that a(n) = Max_{j=n+1..2n-1} gcd(n,j). - Labos Elemer, May 22 2002
This is correct: No integer in the range [n+1, 2n-1] has n as its divisor, but certainly at least one multiple of the largest proper divisor of n will occur there (e.g., if it is n/2, then at n + (n/2)). - Antti Karttunen, Dec 18 2014
The slopes of the visible lines made by the points in the scatter plot are 1/2, 1/3, 1/5, 1/7, ... (reciprocals of primes). - Moosa Nasir, Jun 19 2022

Crossrefs

Maximal GCD of k positive integers with sum n for k = 2..10: this sequence (k=2,n>=2), A355249 (k=3), A355319 (k=4), A355366 (k=5), A355368 (k=6), A355402 (k=7), A354598 (k=8), A354599 (k=9), A354601 (k=10).

Programs

  • Haskell
    a032742 n = n `div` a020639 n  -- Reinhard Zumkeller, Oct 03 2012
    
  • Maple
    A032742 :=proc(n) option remember; if n = 1 then 1; else numtheory[divisors](n) minus {n} ; max(op(%)) ; end if; end proc: # R. J. Mathar, Jun 13 2011
    1, seq(n/min(numtheory:-factorset(n)), n=2..1000); # Robert Israel, Dec 18 2014
  • Mathematica
    f[n_] := If[n == 1, 1, Divisors[n][[-2]]]; Table[f[n], {n, 100}] (* Vladimir Joseph Stephan Orlovsky, Mar 03 2010 *)
    Join[{1},Divisors[#][[-2]]&/@Range[2,80]] (* Harvey P. Dale, Nov 29 2011 *)
    a[n_] := n/FactorInteger[n][[1, 1]]; Array[a, 100] (* Amiram Eldar, Nov 26 2020 *)
    Table[Which[n==1,1,PrimeQ[n],1,True,Divisors[n][[-2]]],{n,80}] (* Harvey P. Dale, Feb 02 2022 *)
  • PARI
    a(n)=if(n==1,1,n/factor(n)[1,1]) \\ Charles R Greathouse IV, Jun 15 2011
    
  • Python
    from sympy import factorint
    def a(n): return 1 if n == 1 else n//min(factorint(n))
    print([a(n) for n in range(1, 81)]) # Michael S. Branicky, Jun 21 2022
  • Scheme
    (define (A032742 n) (/ n (A020639 n))) ;; Antti Karttunen, Dec 18 2014
    

Formula

a(n) = n / A020639(n).
Other identities and observations:
A054576(n) = a(a(n)); A117358(n) = a(a(a(n))) = a(A054576(n)); a(A008578(n)) = 1, a(A002808(n)) > 1. - Reinhard Zumkeller, Mar 10 2006
a(n) = A130064(n) / A006530(n). - Reinhard Zumkeller, May 05 2007
a(m)*a(n) < a(m*n) for m and n > 1. - Reinhard Zumkeller, Apr 11 2008
a(m*n) = max(m*a(n), n*a(m)). - Robert Israel, Dec 18 2014
From Antti Karttunen, Mar 31 2018: (Start)
a(n) = n - A060681(n).
For n > 1, a(n) = A003961^(r)(A246277(n)), where r = A055396(n)-1 and A003961^(r)(n) stands for shifting the prime factorization of n by r positions towards larger primes.
For all n >= 1, A276085(a(A276086(n))) = A276151(n).
(End)
Sum_{k=1..n} a(k) ~ c * n^2, where c = (1/2) * Sum_{k>=1} A005867(k-1)/(prime(k)*A002110(k)) = 0.165049... . - Amiram Eldar, Nov 19 2022

Extensions

Definition clarified by N. J. A. Sloane, Dec 26 2022

A355402 Maximal GCD of seven positive integers with sum n.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 2, 1, 2, 1, 2, 1, 2, 3, 2, 1, 3, 1, 2, 3, 4, 1, 3, 1, 4, 3, 2, 5, 4, 1, 2, 3, 5, 1, 6, 1, 4, 5, 2, 1, 6, 7, 5, 3, 4, 1, 6, 5, 8, 3, 2, 1, 6, 1, 2, 9, 8, 5, 6, 1, 4, 3, 10, 1, 9, 1, 2, 5, 4, 11, 6, 1, 10, 9, 2, 1, 12, 5, 2, 3, 11, 1, 10, 13, 4, 3, 2, 5, 12
Offset: 7

Views

Author

Wesley Ivan Hurt, Jun 30 2022

Keywords

Comments

Also largest divisor <= n/7 of n. - David A. Corneth, Jul 24 2022

Crossrefs

Maximal GCD of k positive integers with sum n for k = 2..10: A032742 (k=2,n>=2), A355249 (k=3), A355319 (k=4), A355366 (k=5), A355368 (k=6), this sequence (k=7), A354598 (k=8), A354599 (k=9), A354601 (k=10).

Programs

  • Maple
    b:= proc(n, i, t) option remember; `if`(n=0, signum(t),
         `if`(min(i, t)<1, 1, max(b(n, i-1, t),
          igcd(b(n-i, min(n-i, i), t-1), i))))
        end:
    a:= n-> `if`(n<7, 0, b(n$2, 7)):
    seq(a(n), n=7..200);  # Alois P. Heinz, Jul 13 2022
  • Mathematica
    b[n_, i_, t_] := b[n, i, t] = If[n == 0, Sign[t],
       If[Min[i, t] < 1, 1, Max[b[n, i - 1, t],
       GCD[b[n - i, Min[n - i, i], t - 1], i]]]];
    a[n_] := If[n < 7, 0, b[n, n, 7]];
    Table[a[n], {n, 7, 100}] (* Jean-François Alcover, Jul 24 2022, after Alois P. Heinz *)
  • PARI
    a(n) = my(d = divisors(n)); d = select(x->x <= n\7,d); d[#d] \\ David A. Corneth, Jul 24 2022

A355368 Maximal GCD of six positive integers with sum n.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 2, 1, 2, 1, 2, 1, 3, 1, 2, 3, 2, 1, 4, 1, 2, 3, 4, 1, 5, 1, 4, 3, 2, 5, 6, 1, 2, 3, 5, 1, 7, 1, 4, 5, 2, 1, 8, 7, 5, 3, 4, 1, 9, 5, 8, 3, 2, 1, 10, 1, 2, 9, 8, 5, 11, 1, 4, 3, 10, 1, 12, 1, 2, 5, 4, 11, 13, 1, 10, 9, 2, 1, 14, 5, 2, 3, 11, 1, 15, 13, 4, 3, 2
Offset: 6

Views

Author

Wesley Ivan Hurt, Jun 29 2022

Keywords

Crossrefs

Maximal GCD of k positive integers with sum n for k = 2..10: A032742 (k=2,n>=2), A355249 (k=3), A355319 (k=4), A355366 (k=5), this sequence (k=6), A355402 (k=7), A354598 (k=8), A354599 (k=9), A354601 (k=10).

Programs

  • Mathematica
    a[n_] := GCD @@@ IntegerPartitions[n, {6}] // Max;
    Table[a[n], {n, 6, 100}] (* Jean-François Alcover, Sep 21 2022 *)

A354598 Maximal GCD of eight positive integers with sum n.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 2, 1, 2, 1, 2, 1, 3, 1, 2, 3, 2, 1, 3, 1, 4, 3, 2, 1, 4, 1, 2, 3, 5, 1, 3, 1, 4, 5, 2, 1, 6, 1, 5, 3, 4, 1, 6, 5, 7, 3, 2, 1, 6, 1, 2, 7, 8, 5, 6, 1, 4, 3, 7, 1, 9, 1, 2, 5, 4, 7, 6, 1, 10, 9, 2, 1, 7, 5, 2, 3, 11, 1, 10, 7, 4, 3, 2, 5, 12, 1, 7, 11, 10
Offset: 8

Views

Author

Wesley Ivan Hurt, Jul 08 2022

Keywords

Crossrefs

Maximal GCD of k positive integers with sum n for k = 2..10: A032742 (k=2,n>=2), A355249 (k=3), A355319 (k=4), A355366 (k=5), A355368 (k=6), A355402 (k=7), this sequence (k=8), A354599 (k=9), A354601 (k=10).

Programs

  • Maple
    b:= proc(n, i, t) option remember; `if`(n=0, signum(t),
         `if`(min(i, t)<1, 1, max(b(n, i-1, t),
          igcd(b(n-i, min(n-i, i), t-1), i))))
        end:
    a:= n-> `if`(n<8, 0, b(n$2, 8)):
    seq(a(n), n=8..200);  # Alois P. Heinz, Jul 13 2022
  • Mathematica
    b[n_, i_, t_] := b[n, i, t] = If[n == 0, Sign[t], If[Min[i, t] < 1, 1, Max[b[n, i - 1, t], GCD[b[n - i, Min[n - i, i], t - 1], i]]]];
    a[n_] := If[n < 8, 0, b[n, n, 8]];
    Table[a[n], {n, 8, 100}] (* Jean-François Alcover, Sep 21 2022, after Alois P. Heinz *)

A354599 Maximal GCD of nine positive integers with sum n.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 3, 2, 1, 3, 1, 2, 3, 2, 1, 4, 1, 2, 3, 4, 1, 3, 1, 4, 5, 2, 1, 4, 1, 5, 3, 4, 1, 6, 5, 4, 3, 2, 1, 6, 1, 2, 7, 4, 5, 6, 1, 4, 3, 7, 1, 8, 1, 2, 5, 4, 7, 6, 1, 8, 9, 2, 1, 7, 5, 2, 3, 8, 1, 10, 7, 4, 3, 2, 5, 8, 1, 7, 11, 10
Offset: 9

Views

Author

Wesley Ivan Hurt, Jul 08 2022

Keywords

Crossrefs

Cf. A009714.
Maximal GCD of k positive integers with sum n for k = 2..10: A032742 (k=2,n>=2), A355249 (k=3), A355319 (k=4), A355366 (k=5), A355368 (k=6), A355402 (k=7), A354598 (k=8), this sequence (k=9), A354601 (k=10).

Programs

  • Maple
    b:= proc(n, i, t) option remember; `if`(n=0, signum(t),
         `if`(min(i, t)<1, 1, max(b(n, i-1, t),
          igcd(b(n-i, min(n-i, i), t-1), i))))
        end:
    a:= n-> `if`(n<9, 0, b(n$2, 9)):
    seq(a(n), n=9..200);  # Alois P. Heinz, Jul 13 2022
  • Mathematica
    b[n_, i_, t_] := b[n, i, t] = If[n == 0, Sign[t], If[Min[i, t] < 1, 1, Max[b[n, i - 1, t], GCD[b[n - i, Min[n - i, i], t - 1], i]]]];
    a[n_] := If[n < 9, 0, b[n, n, 9]];
    Table[a[n], {n, 9, 100}] (* Jean-François Alcover, Sep 21 2022, after Alois P. Heinz *)

A354601 Maximal GCD of ten positive integers with sum n.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 3, 1, 2, 3, 2, 1, 3, 1, 2, 3, 4, 1, 3, 1, 4, 3, 2, 1, 4, 1, 5, 3, 4, 1, 3, 5, 4, 3, 2, 1, 6, 1, 2, 3, 4, 5, 6, 1, 4, 3, 7, 1, 6, 1, 2, 5, 4, 7, 6, 1, 8, 3, 2, 1, 7, 5, 2, 3, 8, 1, 9, 7, 4, 3, 2, 5, 8, 1, 7, 9, 10
Offset: 10

Views

Author

Wesley Ivan Hurt, Jul 08 2022

Keywords

Crossrefs

Cf. A354600.
Maximal GCD of k positive integers with sum n for k = 2..10: A032742 (k=2,n>=2), A355249 (k=3), A355319 (k=4), A355366 (k=5), A355368 (k=6), A355402 (k=7), A354598 (k=8), A354599 (k=9), this sequence (k=10).

Programs

  • Mathematica
    b[n_, i_, t_] := b[n, i, t] = If[n == 0, Sign[t], If[Min[i, t] < 1, 1, Max[b[n, i - 1, t], GCD[b[n - i, Min[n - i, i], t - 1], i]]]];
    a[n_] := If[n < 10, 0, b[n, n, 10]];
    Table[a[n], {n, 10, 100}] (* Jean-François Alcover, Sep 21 2022, after Alois P. Heinz in A354599 *)

A355249 Maximal GCD of three positive integers with sum n.

Original entry on oeis.org

1, 1, 1, 2, 1, 2, 3, 2, 1, 4, 1, 2, 5, 4, 1, 6, 1, 5, 7, 2, 1, 8, 5, 2, 9, 7, 1, 10, 1, 8, 11, 2, 7, 12, 1, 2, 13, 10, 1, 14, 1, 11, 15, 2, 1, 16, 7, 10, 17, 13, 1, 18, 11, 14, 19, 2, 1, 20, 1, 2, 21, 16, 13, 22, 1, 17, 23, 14, 1, 24, 1, 2, 25, 19, 11, 26, 1, 20, 27, 2, 1, 28
Offset: 3

Views

Author

Wesley Ivan Hurt, Jun 25 2022

Keywords

Crossrefs

Maximal GCD of k positive integers with sum n for k = 2..10: A032742 (k=2,n>=2), this sequence (k=3), A355319 (k=4), A355366 (k=5), A355368 (k=6), A355402 (k=7), A354598 (k=8), A354599 (k=9), A354601 (k=10).

Programs

  • Mathematica
    a[n_] := GCD @@@ IntegerPartitions[n, {3}] // Max;
    Table[a[n], {n, 3, 100}] (* Jean-François Alcover, Sep 21 2022 *)
  • Python
    from math import gcd
    def a(n): return max(gcd(i, j, n-i-j) for i in range(1, n//3+1) for j in range(i, n//3+1))
    print([a(n) for n in range(3, 85)]) # Michael S. Branicky, Jun 26 2022

Formula

From Bernard Schott, Jun 27 2022: (Start)
a(3n) = n for n >= 1.
a(p) = 1 for p prime >= 3. (End)

A355366 Maximal GCD of five positive integers with sum n.

Original entry on oeis.org

1, 1, 1, 1, 1, 2, 1, 2, 1, 2, 3, 2, 1, 3, 1, 4, 3, 2, 1, 4, 5, 2, 3, 4, 1, 6, 1, 4, 3, 2, 7, 6, 1, 2, 3, 8, 1, 7, 1, 4, 9, 2, 1, 8, 7, 10, 3, 4, 1, 9, 11, 8, 3, 2, 1, 12, 1, 2, 9, 8, 13, 11, 1, 4, 3, 14, 1, 12, 1, 2, 15, 4, 11, 13, 1, 16, 9, 2, 1, 14, 17, 2, 3, 11, 1
Offset: 5

Views

Author

Wesley Ivan Hurt, Jun 29 2022

Keywords

Crossrefs

Maximal GCD of k positive integers with sum n for k = 2..10: A032742 (k=2,n>=2), A355249 (k=3), A355319 (k=4), this sequence (k=5), A355368 (k=6), A355402 (k=7), A354598 (k=8), A354599 (k=9), A354601 (k=10).

Programs

  • Mathematica
    a[n_] := GCD @@@ IntegerPartitions[n, {5}] // Max;
    Table[a[n], {n, 5, 100}] (* Jean-François Alcover, Sep 21 2022 *)
  • PARI
    a(n) = { my (v=0); forpart(p=n, v=max(v,gcd(Vec(p))),, [5,5]); v } \\ Rémy Sigrist, Jul 01 2022
Showing 1-8 of 8 results.