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-10 of 14 results. Next

A060681 Largest difference between consecutive divisors of n (ordered by size).

Original entry on oeis.org

0, 1, 2, 2, 4, 3, 6, 4, 6, 5, 10, 6, 12, 7, 10, 8, 16, 9, 18, 10, 14, 11, 22, 12, 20, 13, 18, 14, 28, 15, 30, 16, 22, 17, 28, 18, 36, 19, 26, 20, 40, 21, 42, 22, 30, 23, 46, 24, 42, 25, 34, 26, 52, 27, 44, 28, 38, 29, 58, 30, 60, 31, 42, 32, 52, 33, 66, 34, 46, 35, 70, 36, 72, 37
Offset: 1

Views

Author

Labos Elemer, Apr 19 2001

Keywords

Comments

Is a(n) the least m > 0 such that n - m divides n! + m? - Clark Kimberling, Jul 28 2012
Is a(n) the least m > 0 such that L(n-m) divides L(n+m), where L = A000032 (Lucas numbers)? - Clark Kimberling, Jul 30 2012
Records give A006093. - Omar E. Pol, Oct 26 2013
Divide n by its smallest prime factor p, then multiply with (p-1), with a(1) = 0 by convention. Compare also to A366387. - Antti Karttunen, Oct 23 2023
a(n) is also the smallest LCM of positive integers x and y where x + y = n. - Felix Huber, Aug 28 2024

Examples

			For n = 35, divisors are {1, 5, 7, 35}; differences are {4, 2, 28}; a(35) = largest difference = 28 = 35 - 35/5.
		

Crossrefs

Cf. A013661, A020639, A060680, A060682, A060683, A060685, A064097 (number of iterations needed to reach 1).
Cf. also A171462, A366387.

Programs

  • Haskell
    a060681 n = div n p * (p - 1) where p = a020639 n
    -- Reinhard Zumkeller, Apr 06 2015
    
  • Maple
    read("transforms") :
    A060681 := proc(n)
        if n = 1 then
            0 ;
        else
            sort(convert(numtheory[divisors](n),list)) ;
            DIFF(%) ;
            max(op(%)) ;
        end if;
    end proc:
    seq(A060681(n),n=1..60) ; # R. J. Mathar, May 23 2018
    # second Maple program:
    A060681:=n->if(n=1,0,min(map(x->ilcm(x,n-x),[$1..1/2*n]))); seq(A060681(n),n=1..74); # Felix Huber, Aug 28 2024
  • Mathematica
    a[n_ ] := n - n/FactorInteger[n][[1, 1]]
    Array[Max[Differences[Divisors[#]]] &, 80, 2] (* Harvey P. Dale, Oct 26 2013 *)
  • PARI
    diff(v)=vector(#v-1,i,v[i+1]-v[i])
    a(n)=vecmax(diff(divisors(n))) \\ Charles R Greathouse IV, Sep 02 2015
    
  • PARI
    a(n) = if (n==1, 0, n - n/factor(n)[1,1]); \\ Michel Marcus, Oct 24 2015
    
  • PARI
    first(n) = n = max(n, 1); my(res = vector(n)); res[1] = 0; forprime(p = 2, n, for(i = 1, n \ p, if(res[p * i] == 0, res[p * i] = i*(p-1)))); res \\ David A. Corneth, Jan 08 2019
    
  • Python
    from sympy import primefactors
    def A060681(n): return n-n//min(primefactors(n),default=1) # Chai Wah Wu, Jun 21 2023

Formula

a(n) = n - n/A020639(n).
a(n) = n - A032742(n). - Omar E. Pol, Aug 31 2011
a(2n) = n, a(3*(2n+1)) = 2*(2n+1) = 4n + 2. - Antti Karttunen, Oct 23 2023
Sum_{k=1..n} a(k) ~ (1/2 - c) * n^2, where c is defined in the corresponding formula in A032742. - Amiram Eldar, Dec 21 2024

Extensions

Edited by Dean Hickerson, Jan 22 2002
a(1)=0 added by N. J. A. Sloane, Oct 01 2015 at the suggestion of Antti Karttunen

A060680 Smallest difference between consecutive divisors of n.

Original entry on oeis.org

1, 2, 1, 4, 1, 6, 1, 2, 1, 10, 1, 12, 1, 2, 1, 16, 1, 18, 1, 2, 1, 22, 1, 4, 1, 2, 1, 28, 1, 30, 1, 2, 1, 2, 1, 36, 1, 2, 1, 40, 1, 42, 1, 2, 1, 46, 1, 6, 1, 2, 1, 52, 1, 4, 1, 2, 1, 58, 1, 60, 1, 2, 1, 4, 1, 66, 1, 2, 1, 70, 1, 72, 1, 2, 1, 4, 1, 78, 1, 2, 1, 82, 1, 4, 1, 2, 1, 88, 1, 6, 1, 2, 1, 4
Offset: 2

Views

Author

Labos Elemer, Apr 19 2001

Keywords

Comments

a(n) = 1 if n is even and a(n) is even if n is odd.
a(n) = least m>0 such that n!+1+m and n-m are not relatively prime. - Clark Kimberling, Jul 21 2012

Examples

			For n = 35, divisors = {1,5,7,35}; differences = {4,2,28}; a(35) = smallest difference = 2.
		

Crossrefs

Cf. A060681 (largest difference), A060682, A060683, A060684.

Programs

  • Haskell
    a060680 = minimum . a193829_row  -- Reinhard Zumkeller, Jun 25 2015
    
  • Maple
    read("transforms") :
    A060680 := proc(n)
        sort(convert(numtheory[divisors](n),list)) ;
        DIFF(%) ;
        min(op(%)) ;
    end proc:
    seq(A060680(n),n=2..60) ; # R. J. Mathar, May 23 2018
  • Mathematica
    a[n_] := Min@@(Drop[d=Divisors[n], 1]-Drop[d, -1]);
    (* Second program: *)
    a[n_] := Min[Differences[Divisors[n]]];
    Table[a[n], {n, 2, 100}] (* Jean-François Alcover, Oct 16 2024 *)
  • PARI
    a(n) = {my(m = n, d1); fordiv(n, d, if(d > 1 && d - d1 < m, m = d - d1); d1 = d); m;} \\ Amiram Eldar, Mar 17 2025

Formula

a(2n+1) = A060684(n).

Extensions

Corrected by David W. Wilson, May 04 2001
Edited by Dean Hickerson, Jan 22 2002

A193829 Irregular triangle read by rows in which row n lists the differences between consecutive divisors of n.

Original entry on oeis.org

1, 2, 1, 2, 4, 1, 1, 3, 6, 1, 2, 4, 2, 6, 1, 3, 5, 10, 1, 1, 1, 2, 6, 12, 1, 5, 7, 2, 2, 10, 1, 2, 4, 8, 16, 1, 1, 3, 3, 9, 18, 1, 2, 1, 5, 10, 2, 4, 14, 1, 9, 11, 22, 1, 1, 1, 2, 2, 4, 12, 4, 20, 1, 11, 13, 2, 6, 18, 1, 2, 3, 7, 14, 28, 1, 1, 2, 1, 4, 5, 15, 30
Offset: 2

Views

Author

Omar E. Pol, Aug 31 2011

Keywords

Comments

The sum of row n gives A000027(n-1). The product of row n gives A057449(n). Row n has length A032741(n). The final term of row n is A060681(n). It appears that the first term of row n is A057237(n).

Examples

			Written as a triangle:
1,
2,
1, 2,
4,
1, 1, 3,
6,
1, 2, 4,
2, 6,
1, 3, 5,
10,
1, 1, 1, 2, 6
		

Crossrefs

Cf. A060682 (distinct terms per row), A060680 (row minima), A060681 (row maxima).

Programs

  • Haskell
    import Data.List (genericIndex)
    a193829 n k = genericIndex a193829_tabf (n - 1) !! (k - 1)
    a193829_row n = genericIndex a193829_tabf (n - 1)
    a193829_tabf = zipWith (zipWith (-))
                           (map tail a027750_tabf') a027750_tabf'
    -- Reinhard Zumkeller, Jun 25 2015, Jun 23 2013
  • Mathematica
    Flatten[Table[Differences[Divisors[n]], {n, 2, 30}]] (* T. D. Noe, Aug 31 2011 *)

Formula

T(n,k) = A027750(n,k+1)-A027750(n,k). - R. J. Mathar, Sep 01 2011

A060683 Numbers for which the differences between consecutive divisors (ordered by size) are distinct.

Original entry on oeis.org

1, 2, 3, 4, 5, 7, 8, 9, 10, 11, 13, 14, 16, 17, 19, 21, 22, 23, 25, 26, 27, 28, 29, 31, 32, 33, 34, 35, 37, 38, 39, 41, 43, 44, 46, 47, 49, 50, 51, 52, 53, 55, 57, 58, 59, 61, 62, 64, 65, 67, 68, 69, 71, 73, 74, 76, 77, 79, 81, 82, 83, 85, 86, 87, 88, 89, 92, 93, 94, 95, 97, 98
Offset: 1

Views

Author

Labos Elemer, Apr 19 2001

Keywords

Comments

A060682(a(n)) = A000005(a(n)) - 1, n > 1. - Reinhard Zumkeller, Jun 25 2015

Examples

			For n=6, divisors={1,2,3,6}; differences={1,1,3}, which are not distinct, so 6 is not in the sequence.
		

Crossrefs

Cf. A060682, A259366 (complement).

Programs

  • Haskell
    a060683 n = a060683_list !! (n-1)
    a060683_list = 1 : filter (\x -> a060682 x == a000005' x - 1) [2..]
    -- Reinhard Zumkeller, Jun 25 2015
    
  • Mathematica
    test[n_ ] := Length[dd=Drop[d=Divisors[n], 1]-Drop[d, -1]]==Length[Union[dd]]; Select[Range[1, 100], test]
  • PARI
    isok(k) = my(d=divisors(k)); #Set(vector(#d-1, k, d[k+1]-d[k])) == #d-1; \\ Michel Marcus, Nov 11 2023

Extensions

Edited by Dean Hickerson, Jan 22 2002

A328026 Number of divisible pairs of consecutive divisors of n.

Original entry on oeis.org

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

Views

Author

Gus Wiseman, Oct 03 2019

Keywords

Comments

The number m = 2^n, n >= 0, is the smallest for which a(m) = n. - Marius A. Burtea, Nov 20 2019

Examples

			The divisors of 500 are {1,2,4,5,10,20,25,50,100,125,250,500}, with consecutive divisible pairs {1,2}, {2,4}, {5,10}, {10,20}, {25,50}, {50,100}, {125,250}, {250,500}, so a(500) = 8.
		

Crossrefs

Positions of 1's are A000040.
Positions of 0's and 2's are A328028.
Positions of terms > 2 are A328189.
Successive pairs of consecutive divisors are counted by A129308.

Programs

  • Magma
    f:=func;  g:=func; [g(n):n in [1..100]]; // Marius A. Burtea, Nov 20 2019
  • Mathematica
    Table[Length[Split[Divisors[n],!Divisible[#2,#1]&]]-1,{n,100}]
  • PARI
    a(n) = {my(d=divisors(n), nb=0); for (i=2, #d, if ((d[i] % d[i-1]) == 0, nb++)); nb;} \\ Michel Marcus, Oct 05 2019
    

Formula

a(p^k) = k for any prime number p and k >= 0. - Rémy Sigrist, Oct 05 2019

Extensions

Data section extended up to a(105) by Antti Karttunen, Feb 23 2023

A060763 Number of distinct differences between consecutive divisors (ordered by increasing magnitude) of n which are not also divisors of n.

Original entry on oeis.org

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

Views

Author

Labos Elemer, Apr 24 2001

Keywords

Examples

			For n=70, divisors={1,2,5,7,10,14,35,70}; differences={1,3,2,3,4,21,35}; the differences {3,4,21} are not divisors, so a(70)=3.
		

Crossrefs

Programs

  • Maple
    f:= proc(n) local D,L;
      D:= numtheory:-divisors(n);
      L:= sort(convert(D,list));
      nops(convert(L[2..-1]-L[1..-2],set) minus D);
    end proc:
    map(f, [$1..200]); # Robert Israel, Jul 03 2017
  • Mathematica
    a[n_] := Length[Complement[Drop[d=Divisors[n], 1]-Drop[d, -1], d]]
  • PARI
    a(n) = my(d=divisors(n)); #select(x->(setsearch(d, x)==0), vecsort(vector(#d-1, k, d[k+1] - d[k]),,8)); \\ Michel Marcus, Jul 04 2017

Extensions

Edited by Dean Hickerson, Jan 22 2002

A328023 Heinz number of the multiset of differences between consecutive divisors of n.

Original entry on oeis.org

1, 2, 3, 6, 7, 20, 13, 42, 39, 110, 29, 312, 37, 374, 261, 798, 53, 2300, 61, 3828, 903, 1426, 79, 18648, 497, 2542, 2379, 21930, 107, 86856, 113, 42294, 4503, 5546, 2247, 475800, 151, 7906, 8787, 370620, 173, 843880, 181, 249798, 92547, 12118, 199, 5965848
Offset: 1

Views

Author

Gus Wiseman, Oct 02 2019

Keywords

Comments

The Heinz number of an integer partition or multiset {y_1,...,y_k} is prime(y_1)*...*prime(y_k).

Examples

			The sequence of terms together with their prime indices begins:
            1: ()
            2: (1)
            3: (2)
            6: (2,1)
            7: (4)
           20: (3,1,1)
           13: (6)
           42: (4,2,1)
           39: (6,2)
          110: (5,3,1)
           29: (10)
          312: (6,2,1,1,1)
           37: (12)
          374: (7,5,1)
          261: (10,2,2)
          798: (8,4,2,1)
           53: (16)
         2300: (9,3,3,1,1)
           61: (18)
         3828: (10,5,2,1,1)
For example, the divisors of 6 are {1,2,3,6}, with differences {1,1,3}, with Heinz number 20, so a(6) = 20.
		

Crossrefs

The sorted version is A328024.
a(n) is the Heinz number of row n of A193829, A328025, or A328027.

Programs

  • Mathematica
    Table[Times@@Prime/@Differences[Divisors[n]],{n,100}]

Formula

A056239(a(n)) = n - 1. In words, the integer partition with Heinz number a(n) is an integer partition of n - 1.
A055396(a(n)) = A060680(n).
A061395(a(n)) = A060681(n).
A001221(a(n)) = A060682(n).
A001222(a(n)) = A000005(n).

A328024 Heinz numbers of multisets representing the differences between some positive integer's consecutive divisors.

Original entry on oeis.org

1, 2, 3, 6, 7, 13, 20, 29, 37, 39, 42, 53, 61, 79, 107, 110, 113, 151, 173, 181, 199, 239, 261, 271, 281, 312, 317, 349, 359, 374, 397, 421, 457, 497, 503, 541, 557, 577, 593, 613, 701, 733, 769, 787, 798, 857, 863, 903, 911, 953, 983, 1021, 1061, 1069, 1151
Offset: 1

Views

Author

Gus Wiseman, Oct 02 2019

Keywords

Comments

The Heinz number of an integer partition or multiset {y_1,...,y_k} is prime(y_1)*...*prime(y_k).
There is exactly one entry with any given sum of prime indices A056239.

Examples

			The sequence of terms together with their prime indices begins:
     1: {}
     2: {1}
     3: {2}
     6: {1,2}
     7: {4}
    13: {6}
    20: {1,1,3}
    29: {10}
    37: {12}
    39: {2,6}
    42: {1,2,4}
    53: {16}
    61: {18}
    79: {22}
   107: {28}
   110: {1,3,5}
   113: {30}
   151: {36}
   173: {40}
   181: {42}
   199: {46}
   239: {52}
   261: {2,2,10}
   271: {58}
   281: {60}
   312: {1,1,1,2,6}
For example, the divisors of 8 are {1,2,4,8}, with differences {1,2,4}, with Heinz number 42, so 42 belongs to the sequence.
		

Crossrefs

A permutation of A328023.
Also the set of possible Heinz numbers of rows of A193829, A328025, or A328027.

Programs

  • Mathematica
    nn=1000;
    Select[Union[Table[Times@@Prime/@Differences[Divisors[n]],{n,nn}]],#<=nn&]

A259366 Numbers for which the differences between consecutive divisors (ordered by size) are not distinct.

Original entry on oeis.org

6, 12, 15, 18, 20, 24, 30, 36, 40, 42, 45, 48, 54, 56, 60, 63, 66, 70, 72, 75, 78, 80, 84, 90, 91, 96, 99, 100, 102, 105, 108, 110, 112, 114, 120, 126, 130, 132, 135, 138, 140, 144, 150, 156, 160, 162, 165, 168, 174, 180, 182, 186, 189, 192, 195, 198, 200
Offset: 1

Views

Author

Reinhard Zumkeller, Jun 25 2015

Keywords

Examples

			.    n |  A193829(n,*)      |  A027750(n,*)         |
.  ----+--------------------+-----------------------+------------
.   10 |  {1,3,5}           |  {1,2,5,10}           |
.   11 |  {10}              |  {1,11}               |
.   12 |  {1,1,1,2,6}       |  {1,2,3,4,6,12}       |  a(2) = 12
.   13 |  {12}              |  {1,13}               |
.   14 |  {1,5,7}           |  {1,2,7,14}           |
.   15 |  {2,2,10}          |  {1,3,5,15}           |  a(3) = 15
.   16 |  {1,2,4,8}         |  {1,2,4,8,16}         |
.   17 |  {16}              |  {1,17}               |
.   18 |  {1,1,3,3,9}       |  {1,2,3,6,9,18}       |  a(4) = 18
.   19 |  {18}              |  {1,19}               |
.   20 |  {1,2,1,5,10}      |  {1,2,4,5,10,20}      |  a(5) = 20
.   21 |  {2,4,14}          |  {1,3,7,21}           |
.   22 |  {1,9,11}          |  {1,2,11,22}          |
.   23 |  {22}              |  {1,23}               |
.   24 |  {1,1,1,2,2,4,12}  |  {1,2,3,4,6,8,12,24}  |  a(6) = 24
.   25 |  {4,20}            |  {1,5,25}             |            .
		

Crossrefs

Cf. A193829, A027750, A060682, A000005, A060683 (complement), subsequence of A129512.

Programs

  • Haskell
    a259366 n = a259366_list !! (n-1)
    a259366_list = filter (\x -> a060682 x < a000005' x - 1) [2..]
  • Mathematica
    q[k_] := Module[{d = Differences[Divisors[k]]}, CountDistinct[d] < Length[d]]; Select[Range[200], q] (* Amiram Eldar, Jan 27 2025 *)

Formula

A060682(a(n)) < A000005(a(n)) - 1.

A328025 Irregular triangle read by rows where row n gives the differences between consecutive divisors of n in weakly decreasing order.

Original entry on oeis.org

1, 2, 2, 1, 4, 3, 1, 1, 6, 4, 2, 1, 6, 2, 5, 3, 1, 10, 6, 2, 1, 1, 1, 12, 7, 5, 1, 10, 2, 2, 8, 4, 2, 1, 16, 9, 3, 3, 1, 1, 18, 10, 5, 2, 1, 1, 14, 4, 2, 11, 9, 1, 22, 12, 4, 2, 2, 1, 1, 1, 20, 4, 13, 11, 1, 18, 6, 2, 14, 7, 3, 2, 1, 28, 15, 5, 4, 2, 1, 1, 1
Offset: 1

Views

Author

Gus Wiseman, Oct 02 2019

Keywords

Examples

			Triangle begins:
   {}
   1
   2
   2  1
   4
   3  1  1
   6
   4  2  1
   6  2
   5  3  1
  10
   6  2  1  1  1
  12
   7  5  1
  10  2  2
   8  4  2  1
  16
   9  3  3  1  1
  18
  10  5  2  1  1
For example, the divisors of 18 are {1,2,3,6,9,18}, with differences {1,1,3,3,9}, so row 18 is {9,3,3,1,1}.
		

Crossrefs

Same as A193829 with rows sorted in weakly decreasing order.
Same as A328027 with rows reversed.
Row sums are A001477.
Row lengths are A000005.
First column is A060681.
Heinz numbers of rows are A328023.

Programs

  • Mathematica
    Table[Sort[Differences[Divisors[n]],Greater],{n,30}]
Showing 1-10 of 14 results. Next