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.

Previous Showing 11-20 of 32 results. Next

A076388 a(n) = minimum of y-x such that x <= y, x*y = n and gcd(x,y)=1.

Original entry on oeis.org

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

Views

Author

T. D. Noe, Oct 11 2002

Keywords

Comments

If n is a prime or a power of a prime, a(n) = n-1. Similar to A056737, which does not have the gcd(x,y)=1 condition.

Examples

			a(12) = 1 because of the possible (x,y) pairs, (1,12), (2,6), (3,4), the pair (3,4) yields the minimum difference and satisfies gcd(x,y)=1.
		

Crossrefs

Differs from |A354988(n)| for the first time at n=60, where a(60) = 7, while A354988(60) = -11.

Programs

  • Mathematica
    nMax = 100; Table[dvs = Divisors[n]; i = 1; j = 1; While[n/dvs[[i]] > dvs[[i]], If[GCD[n/dvs[[i]], dvs[[i]]] == 1, j = i]; i++ ]; n/dvs[[j]] - dvs[[j]], {n, 2, nMax}]
  • PARI
    A076388(n) = fordiv(n,d,if((d>=(n/d)) && 1==gcd(d,n/d), return(d-(n/d)))); \\ Antti Karttunen, Jun 16 2022

Formula

a(n) = A354933(n) - A052128(n). - Corrected by Antti Karttunen, Jun 16 2022

Extensions

Definition formally changed from x < y to x <= y, to accommodate the prepended term a(1)=0 - Antti Karttunen, Jun 16 2022

A368312 Irregular triangle read by rows where row n lists the factor differences of n.

Original entry on oeis.org

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

Views

Author

Kevin Ryde, Dec 21 2023

Keywords

Comments

Factor differences of n are all abs(p-q) where n = p*q, for positive integers p,q.
p is each divisor of n which is >= sqrt(n), in ascending order (A161908), and the resulting differences p-q are distinct and in ascending order.
Row n has length A038548(n).
Row n begins with smallest difference T(n,1) = A056737(n) and this is 0 iff n is a perfect square.
Row n ends with n-1 and this is the sole entry iff n is 1 or prime.

Examples

			Triangle begins:
       k=1
  n=1:   0
  n=2:   1
  n=3:   2
  n=4:   0, 3
  n=5:   4
  n=6:   1, 5
  n=7:   6
  n=8:   2, 7
  n=9:   0, 8
		

Crossrefs

Cf. A038548 (row lengths), A079667 (row sums), A068333 (row products).
Cf. A056737 (column k=1), A161908.
Cf. A335572 (factor sums).

Programs

  • PARI
    row(n) = my(v=divisors(n)); (v-Vecrev(v))[#v\2+1..#v];

Formula

T(n,k) = d - n/d where d = A161908(n,k).

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];

A139693 a(n) is the smallest positive integer m where, for k divides m, minimum(|k - m/k|) = n.

Original entry on oeis.org

1, 2, 3, 10, 5, 14, 7, 44, 33, 22, 11, 26, 13, 68, 51, 34, 17, 38, 19, 92, 69, 46, 23, 174, 145, 116, 87, 58, 29, 62, 31, 222, 185, 148, 111, 74, 37, 164, 123, 82, 41, 86, 43, 188, 141, 94, 47, 318, 265, 212, 159, 106, 53, 354, 295, 236, 177, 118, 59, 122, 61, 402, 335
Offset: 0

Views

Author

Leroy Quet, Apr 29 2008

Keywords

Comments

a(n) is the minimum positive integer m where A056737(m) = n.

Crossrefs

Programs

  • PARI
    f(n) = {n=divisors(n); n[(2+#n)\2]-n[(1+#n)\2]} \\ A056737
    a(n) = my(k=1); while(f(k) != n, k++); k; \\ Michel Marcus, Mar 20 2019

Extensions

More terms from Max Alekseyev, Oct 28 2008

A369110 a(n) is the number of distinct elements appearing in the sequence formed by recursively applying A063655 when starting from n.

Original entry on oeis.org

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

Views

Author

Adnan Baysal, Jan 13 2024

Keywords

Comments

A063655(n) gives the smallest semiperimeter of an integral rectangle with area n, which is the same thing as the minimum sum of two positive integers whose product is n. In this sequence, A063655 is applied recursively until a cycle is found. Then the number of distinct elements appearing in this process is given as a(n). Note that it's conjectured that a cycle will be found at some point.
Conjecture: The cycle part of each sequence generated by the recursion is one of (4), (5, 6), or (6, 5). Confirmed through 1 millionth term.
The conjecture is true. Proof: The conjecture holds for n <= 6. Suppose n >= 7 and the conjecture holds for lower values of n. If n is composite, then A063655(n) <= n/2+2. If n is prime, then A063655(n) = n+1 is even and A063655(A063655(n)) <= (n+1)/2+2. In both cases, n reaches a lower number and the conjecture holds for n. - Jason Yuen, Mar 30 2024

Examples

			n = 1 can be factored as 1*1 with minimum sum 2 (similarly, A063655(1) = 2). Then 2 = 1*2, so minimum sum is 3 = A063655(2). 3 = 1*3 which means the next number in the recursion is 4 = A063655(3). 4 = 2*2 which gives the same number 4 = A063655(4), hence this recursion will create a cycle at this point. Starting from n = 1 (including 1), we generated these numbers: (1, 2, 3, 4, 4, 4, ...). Therefore, a(1) = 4. a(2), a(3), and a(4) are trivially deduced from this example.
		

Crossrefs

Programs

  • Python
    from sympy import divisors
    def A369110(n):
        c = {n}
        while n<4 or n>5:
            c.add(n:=(d:=divisors(n))[((l:=len(d))-1)>>1]+d[l>>1])
        if n==5:
            c.add(6)
        return len(c) # Chai Wah Wu, Apr 25 2024

A324921 Index of first occurrence of n in A324920.

Original entry on oeis.org

0, 1, 2, 3, 10, 11, 26, 83, 178, 179, 362, 1835, 9188, 42709, 162466, 358487, 1877938, 11596979, 57866702, 94418279, 1888365980
Offset: 0

Views

Author

Robert G. Wilson v, Mar 20 2019

Keywords

Crossrefs

Programs

  • Mathematica
    g[n_] := Block[{d = Divisors@ n}, len = Length@ d; If[ OddQ@ len, 0, d[[1 + len/2]] - d[[len/2]]]]; f[n_] := Length@ NestWhileList[g, n, # > 0 &] - 1; t[_] := -1; k = 0; While[k < 1000000001, a = f@ k; If[ t[a] == -1, t[a] = k]; k++]; t@# & /@ Range[0, 17]
  • PARI
    a056737(n)=n=divisors(n); n[(2+#n)\2]-n[(1+#n)\2] \\ after M. F. Hasler in A056737
    a324920(n) = my(x=n, i=0); while(x!=0, i++; x=a056737(x)); i
    a(n) = for(k=0, oo, if(a324920(k)==n, return(k))) \\ Felix Fröhlich, Mar 20 2019

Extensions

a(18)-a(20) from Daniel Suteu, Mar 20 2019

A369793 a(n) is the number of occurrences of n in A063655.

Original entry on oeis.org

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

Views

Author

Adnan Baysal, Feb 07 2024

Keywords

Comments

Construct a directed graph whose vertex set is the set of all positive integers, and a directed edge from k to n belongs to this graph iff A063655(k) = n. a(n) is the in-degree of the vertex n in this graph. As conjectured in A369110, it is also conjectured here that the only cycles in this graph are from 4 to itself and between 5 and 6.

Examples

			a(1) = 0 since 1 does not exist in A063655. This is also clear from the definition of A063655, because there is no integral rectangle with semiperimeter 1.
a(2) = 1 because there is only one integral rectangle of area 1 with a minimal semiperimeter 2, which is the 1 X 1 square. So 2 appears only once in A063655, which means a(2) = 1.
a(4) = 2, because only A063655(3) and A063655(4) have the value 4. For any n > 4, A063655(n) > 4, because A063655(n) > 2 * sqrt(n) > 2 * sqrt(4) = 4. Hence, 4 cannot appear in the rest of A063655.
		

Crossrefs

Programs

  • Mathematica
    a=1156;Table[Count[Table[2*Median[Divisors[m]], {m,a}] ,n],{n,Floor[2*Sqrt[a]]}] (* James C. McMahon, Mar 12 2024 *)
  • Python
    from sympy import divisors
    def A369793(n): return sum(1 for m in range(1,(n**2>>2)+1) if (d:=divisors(m))[((l:=len(d))-1)>>1]+d[l>>1]==n) # Chai Wah Wu, Mar 25 2024

A147763 a(n) = smallest k such that n = d*(d-b)*(d+c), where b, c, d >= 0 and k = b+c.

Original entry on oeis.org

0, 1, 2, 1, 4, 2, 6, 0, 2, 4, 10, 1, 12, 6, 4, 2, 16, 1, 18, 3, 6, 10, 22, 2, 4, 12, 0, 5, 28, 3, 30, 2, 10, 16, 6, 1, 36, 18, 12, 3, 40, 5, 42, 9, 2, 22, 46, 1, 6, 3, 16, 11, 52, 3, 10, 5, 18, 28, 58, 2, 60, 30, 4, 0, 12, 9, 66, 15, 22, 5, 70, 3, 72, 36, 2, 17, 10, 11, 78, 1, 6, 40, 82, 4, 16
Offset: 1

Views

Author

Samuel Zbarsky (sa_zbarsky(AT)yahoo.com), Nov 11 2008

Keywords

Examples

			n = 9 = 3*1*3 = 3*(3-2)*(3+0) with d = 3, b = 2, c = 0. So a(9) = k = 2+0 = 2, since there is no solution with k = 1.
		

Crossrefs

Cf. A056737.

Programs

  • Magma
    [ Min(v) where v is [ b+c: d, y, z in Divisors(n) | d*(d-b)*(d+c) eq n and d ge 0 and b ge 0 and c ge 0 where b is d-y where c is z-d ]: n in [1..85] ]; // Klaus Brockhaus, Nov 19 2008
    
  • PARI
    first(n) = {my(res = vector(n, i, i), t = 0); for(i = 1, n, for(j = i, n \ i, for(k = j, n \ (i * j), res[i * j * k] = min(res[i * j * k], k - i)))); res} \\ David A. Corneth, May 12 2018

Formula

a(n) = n-1 for n prime; a(n) = 0 for n a 3rd power. - Klaus Brockhaus, Nov 19 2008

Extensions

Definition and example edited, and extended beyond a(42) by Klaus Brockhaus, Nov 19 2008

A243981 Minimum range of sets of natural numbers with a product of n.

Original entry on oeis.org

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

Views

Author

Paul Richards, Nov 11 2014

Keywords

Comments

The minimum difference between the largest and smallest values in the sets of positive integers with a product of n, excluding the singleton set {n}.

Examples

			For 45 the sets are {1,45}, {3,15}, {5,9}, {3,3,5} with differences of 44, 12, 4 and 2 respectively.  2 is the minimum and so a(45) = 2.
		

Crossrefs

Formula

a(n) <= A046665(n) for all composite n, a(p) = p - 1 for primes p. - Charlie Neder, Jan 13 2019

A285119 Min(|d(k+1-i) - d(i)|, for i = 1..k), where d(1)..d(k) are the divisors of n^3.

Original entry on oeis.org

0, 2, 6, 0, 20, 6, 42, 16, 0, 15, 110, 12, 156, 7, 30, 0, 272, 9, 342, 20, 84, 33, 506, 20, 0, 65, 162, 84, 812, 30, 930, 128, 176, 153, 70, 0, 1332, 209, 182, 6, 1640, 42, 1806, 110, 132, 345, 2162, 96, 0, 250, 170, 78, 2756, 162, 330, 56, 152, 609, 3422
Offset: 1

Views

Author

Clark Kimberling, Apr 11 2017

Keywords

Comments

a(n) = 0 if and only if n is a square (A000290).

Examples

			3^3 = 27 has divisors 1,3,9,27, so that k=4 and d(k+1-i) - d(i) ranges through {-26,-6,6,27}, so that a(3) = 6.
		

Crossrefs

Programs

  • Mathematica
    f[n_] := f[n] = n^3; Table[Divisors[f[n]] - Reverse[Divisors[f[n]]], {n, 1, 10}]
    Table[Min[Abs[Divisors[f[n]] - Reverse[Divisors[f[n]]]]], {n, 1, 100}]
  • PARI
    a(n) = my(d=divisors(n^3)); vecmin(apply(abs, d - Vecrev(d))); \\ Michel Marcus, Feb 22 2021

Formula

a(n) = A056737(A000578(n)).
Previous Showing 11-20 of 32 results. Next