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 32 results. Next

A324920 a(n) is the number of iterations of the integer splitting function (A056737) necessary to reach zero.

Original entry on oeis.org

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

Views

Author

Robert G. Wilson v, Mar 20 2019

Keywords

Comments

The iterations always fall to zero, proof by induction: 0 is 0; 1 -> 0; 2 -> 1; 3 -> 2; 4 -> 2; n -> some number less than n.
First occurrence of k >= 0: 0, 1, 2, 3, 10, 11, 26, 83, 178, ... see A324921.

Examples

			a(0) = 0;
a(1) = 1 since 1 -> 0;
a(2) = 2 since 2 -> 1 -> 0;
a(3) = 3 since 3 -> 2 -> 1 -> 0;
a(4) = 1 since 4 -> 0; etc.
		

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[f, n, # > 0 &] -1; Array[f, 105, 0]
  • PARI
    a056737(n)=n=divisors(n); n[(2+#n)\2]-n[(1+#n)\2] \\ after M. F. Hasler in A056737
    a(n) = my(x=n, i=0); while(x!=0, i++; x=a056737(x)); i \\ Felix Fröhlich, Mar 20 2019

Formula

a(n) = 1 iff n is a perfect square (A000290).

A139694 a(0)=1. a(n) = smallest positive integer m, m > a(n-1), where, for k divides m, minimum(|k -m/k|) = n. a(n) = the minimum positive integer m where A056737(m) = n and m > a(n-1).

Original entry on oeis.org

1, 2, 3, 10, 21, 50, 55, 78, 105, 136, 171, 242, 253, 338, 351, 406, 465, 578, 595, 666, 741, 820, 903, 1058, 1081, 1250, 1275, 1378, 1653, 1682, 1711, 1830, 1953, 2178, 2211, 2556, 2701, 2738, 2775, 2926, 3081, 3362, 3403, 3698, 3741, 3916, 4232, 4418, 4465
Offset: 0

Views

Author

Leroy Quet, Apr 29 2008

Keywords

Crossrefs

Programs

  • PARI
    a056737(n)={n=divisors(n); n[(2+#n)\2]-n[(1+#n)\2];} \\ from A056737
    lista(nn) = {olda = 1; for (n=1, nn+1, print1(olda, ", "); newa = olda + 1; while (a056737(newa) != n, newa++); olda = newa;);} \\ Michel Marcus, Feb 11 2014

Extensions

More terms from Michel Marcus, Feb 11 2014

A161416 Partial sums of A056737.

Original entry on oeis.org

0, 1, 3, 3, 7, 8, 14, 16, 16, 19, 29, 30, 42, 47, 49, 49, 65, 68, 86, 87, 91, 100, 122, 124, 124, 135, 141, 144, 172, 173, 203, 207, 215, 230, 232, 232, 268, 285, 295, 298, 338, 339, 381, 388, 392, 413, 459, 461, 461, 466, 480, 489, 541, 544, 550, 551, 567, 594
Offset: 1

Views

Author

Omar E. Pol, Jun 21 2009

Keywords

Crossrefs

Formula

a(n) = A219730(n) - A219729(n). - Tamas Sandor Nagy, Jan 20 2024

Extensions

Extended beyond a(16) by R. J. Mathar, Aug 01 2009

A163984 First differences of A056737.

Original entry on oeis.org

1, 1, -2, 4, -3, 5, -4, -2, 3, 7, -9, 11, -7, -3, -2, 16, -13, 15, -17, 3, 5, 13, -20, -2, 11, -5, -3, 25, -27, 29, -26, 4, 7, -13, -2, 36, -19, -7, -7, 37, -39, 41, -35, -3, 17, 25, -44, -2, 5, 9, -5, 43, -49, 3, -5, 15, 11, 31, -54, 56, -31, -27, -2, 8, -3, 61, -53, 7, -17, 67, -69, 71, -37, -25, 5, -11, 3, 71, -76, -2, 39, 43, -77, 7, 29, -15
Offset: 1

Views

Author

Omar E. Pol, Aug 12 2009

Keywords

Crossrefs

Programs

  • Maple
    A033676 := proc(n) local a, d; a := 0 ; for d in numtheory[divisors](n) do if d^2 <= n then a := max(a, d) ; fi; od: a; end:
    A033677 := proc(n) local a, d; a := n ; for d in numtheory[divisors](n) do if d^2 >= n then a := min(a, d) ; fi; od: a; end proc:
    A056737 := proc(n) A033677(n)-A033676(n) ; end proc:
    [seq(A056737(n),n=1..120)] ;
    DIFF(%) ;

A033676 Largest divisor of n <= sqrt(n).

Original entry on oeis.org

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

Views

Author

Keywords

Comments

a(n) = sqrt(n) is a new record if and only if n is a square. - Zak Seidov, Jul 17 2009
a(n) = A060775(n) unless n is a square, when a(n) = A033677(n) = sqrt(n) is strictly larger than A060775(n). It would be nice to have an efficient algorithm to calculate these terms when n has a large number of divisors, as for example in A060776, A060777 and related problems such as A182987. - M. F. Hasler, Sep 20 2011
a(n) = 1 when n = 1 or n is prime. - Alonso del Arte, Nov 25 2012
a(n) is the smallest central divisor of n. Column 1 of A207375. - Omar E. Pol, Feb 26 2019
a(n^4+n^2+1) = n^2-n+1: suppose that n^2-n+k divides n^4+n^2+1 = (n^2-n+k)*(n^2+n-k+2) - (k-1)*(2*n+1-k) for 2 <= k <= 2*n, then (k-1)*(2*n+1-k) >= n^2-n+k, or n^2 - (2*k-1)*n + (k^2-k+1) = (n-k+1/2)^2 + 3/4 < 0, which is impossible. Hence the next smallest divisor of n^4+n^2+1 than n^2-n+1 is at least n^2-n+(2*n+1) = n^2+n+1 > sqrt(n^4+n^2+1). - Jianing Song, Oct 23 2022

References

  • G. Tenenbaum, pp. 268 ff, in: R. L. Graham et al., eds., Mathematics of Paul Erdős I.

Crossrefs

Cf. A033677 (n/a(n)), A000196 (sqrt), A027750 (list of divisors), A056737 (n/a(n) - a(n)), A219695 (half of this for odd numbers), A207375 (list the central divisor(s)).
The strictly inferior case is A060775. Cf. also A140271.
Indices of given values: A008578 (1 and the prime numbers: a(n) = 1), A161344 (a(n) = 2), A161345 (a(n) = 3), A161424 (4), A161835 (5), A162526 (6), A162527 (7), A162528 (8), A162529 (9), A162530 (10), A162531 (11), A162532 (12), A282668 (indices of primes).

Programs

  • Haskell
    a033676 n = last $ takeWhile (<= a000196 n) $ a027750_row n
    -- Reinhard Zumkeller, Jun 04 2012
    
  • Maple
    A033676 := proc(n) local a,d; a := 0 ; for d in numtheory[divisors](n) do if d^2 <= n then a := max(a,d) ; end if; end do: a; end proc: # R. J. Mathar, Aug 09 2009
  • Mathematica
    largestDivisorLEQR[n_Integer] := Module[{dvs = Divisors[n]}, dvs[[Ceiling[Length@dvs/2]]]]; largestDivisorLEQR /@ Range[100] (* Borislav Stanimirov, Mar 28 2010 *)
    Table[Last[Select[Divisors[n],#<=Sqrt[n]&]],{n,100}] (* Harvey P. Dale, Mar 17 2017 *)
  • PARI
    A033676(n) = {local(d);if(n<2,1,d=divisors(n);d[(length(d)+1)\2])} \\ Michael B. Porter, Jan 30 2010
    
  • Python
    from sympy import divisors
    def A033676(n):
        d = divisors(n)
        return d[(len(d)-1)//2]  # Chai Wah Wu, Apr 05 2021

Formula

a(n) = n / A033677(n).
a(n) = A161906(n,A038548(n)). - Reinhard Zumkeller, Mar 08 2013
a(n) = A162348(2n-1). - Daniel Forgues, Sep 29 2014

A033677 Smallest divisor of n >= sqrt(n).

Original entry on oeis.org

1, 2, 3, 2, 5, 3, 7, 4, 3, 5, 11, 4, 13, 7, 5, 4, 17, 6, 19, 5, 7, 11, 23, 6, 5, 13, 9, 7, 29, 6, 31, 8, 11, 17, 7, 6, 37, 19, 13, 8, 41, 7, 43, 11, 9, 23, 47, 8, 7, 10, 17, 13, 53, 9, 11, 8, 19, 29, 59, 10, 61, 31, 9, 8, 13, 11, 67, 17, 23, 10, 71, 9, 73, 37, 15, 19, 11, 13, 79, 10
Offset: 1

Views

Author

Keywords

Comments

a(n) is the smallest k such that n appears in the k X k multiplication table and A027424(k) is the number of n with a(n) <= k.
a(n) is the largest central divisor of n. Right border of A207375. - Omar E. Pol, Feb 26 2019
If we define a divisor d|n to be superior if d >= n/d, then superior divisors are counted by A038548 and listed by A161908. This sequence selects the smallest superior divisor of n. - Gus Wiseman, Feb 19 2021
a(p) = p for p a prime or 1, these are also the record high points in this sequence. - Charles Kusniec, Aug 26 2022
a(n^4+n^2+1) = n^2+n+1 (see A033676). - Jianing Song, Oct 23 2022

Examples

			From _Gus Wiseman_, Feb 19 2021: (Start)
The divisors of 36 are {1,2,3,4,6,9,12,18,36}. Of these {1,2,3,4,6} are inferior and {6,9,12,18,36} are superior, so a(36) = 6.
The divisors of 40 are {1,2,4,5,8,10,20,40}. Of these {1,2,4,5} are inferior and {8,10,20,40} are superior, so a(40) = 8.
(End)
		

References

  • G. Tenenbaum, pp. 268ff of R. L. Graham et al., eds., Mathematics of Paul Erdős I.

Crossrefs

The lower central divisor is A033676.
The strictly superior case is A140271.
Leftmost column of A161908 (superior divisors).
Rightmost column of A207375 (central divisors).
A038548 counts superior (or inferior) divisors.
A056924 counts strictly superior (or strictly inferior) divisors.
A063538/A063539 list numbers with/without a superior prime divisor.
A070038 adds up superior divisors.
A341676 selects the unique superior prime divisor.
- Strictly Inferior: A070039, A333805, A333806, A341596, A341674, A341677.

Programs

  • Haskell
    a033677 n = head $
       dropWhile ((< n) . (^ 2)) [d | d <- [1..n], mod n d == 0]
    -- Reinhard Zumkeller, Oct 20 2011
    
  • Maple
    A033677 := proc(n)
        n/A033676(n) ;
    end proc:
  • Mathematica
    Table[Select[Divisors[n], # >= Sqrt[n] &, 1] // First, {n, 80}]  (* Jean-François Alcover, Apr 01 2011 *)
  • PARI
    A033677(n) = {local(d); d=divisors(n); d[length(d)\2+1]} \\ Michael B. Porter, Feb 26 2010
    
  • Python
    from sympy import divisors
    def A033677(n):
        d = divisors(n)
        return d[len(d)//2]  # Chai Wah Wu, Apr 05 2021

Formula

a(n) = n/A033676(n).
a(n) = A162348(2n). - Daniel Forgues, Sep 29 2014

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

A082120 Smallest difference > 1 between d and n/d for any divisor d of n.

Original entry on oeis.org

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

Views

Author

Ralf Stephan, Apr 04 2003

Keywords

Comments

a(p) = p-1 for prime p.

Crossrefs

Programs

  • Maple
    F:= proc(n) local p;
      p:= min(select(t -> t - n/t > 1, numtheory:-divisors(n)));
      p - n/p
    end proc:
    map(F, [$3..100]); # Robert Israel, Aug 12 2015
  • Mathematica
    sd[n_]:=Min[Select[Abs[#-n/#]&/@Divisors[n],#>1&]]; Array[sd,90,3] (* Harvey P. Dale, Sep 28 2013 *)
  • PARI
    for(n=3, 100, 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]<2, u=u-1; t=t+1); print1(v[t]-v[u]", "))

A061057 Factorial splitting: write n! = x*y with x <= y and x maximal; sequence gives value of y-x.

Original entry on oeis.org

0, 1, 1, 2, 2, 6, 2, 18, 54, 30, 36, 576, 127, 840, 928, 3712, 20160, 93696, 420480, 800640, 1305696, 7983360, 55056804, 65318400, 326592000, 2286926400, 2610934480, 13680979200, 18906930876, 674165366496, 326850970500, 16753029012720, 16880461678080
Offset: 1

Views

Author

Ed Pegg Jr, May 28 2001

Keywords

Comments

Difference between central divisors of n!. - Jaume Oliver Lafont, Mar 13 2009
For n > 1, n! will never be a square, because of primes in the last half of the factors. Therefore the divisors of n! come in pairs (x,y) with x*y = n! and x < y. The sequence gives the difference y-x between the pair nearest to the square root of n!. - Alois P. Heinz, Jul 06 2009
a(n) = 2 iff n belongs to A146968. - Max Alekseyev, Feb 06 2010

Examples

			2! = 1*2, with difference of 1.
3! = 2*3, with difference of 1.
4! = 4*6, with difference of 2.
5! = 10*12, with difference of 2.
6! = 24*30, with difference of 6.
7! = 70*72 with difference of 2.
The corresponding central divisors are two units apart (equivalently, n!+1=A038507(n) is a square) for n = 4, 5, 7 (see A146968).
		

Crossrefs

Programs

  • Maple
    A060777 := proc(n) local d,nd ; d := sort(convert(numtheory[divisors](n!),list)) ; nd := nops(d) ; op(floor(1+nd/2),d) ; end:
    A060776 := proc(n) local d,nd ; d := sort(convert(numtheory[divisors](n!),list)) ; nd := nops(d) ; op(floor(nd/2),d) ; end:
    A061057 := proc(n) A060777(n)-A060776(n) ; end:
    seq(A061057(n),n=2..27) ; # R. J. Mathar, Mar 14 2009
  • Mathematica
    Do[ With[ {k = Floor[ Sqrt[ x! ] ] - Do[ If[ Mod[ x!, Floor[ Sqrt[ x! ] ] - n ] == 0, Return[ n ] ], {n, 0, 10000000} ]}, Print[ {x, "! =", k, x!/k, x!/k - k} ] ], {x, 3, 22} ]
    f[n_] := Block[{k = Floor@ Sqrt[n! ]}, While[ Mod[n!, k] != 0, k-- ]; n!/k - k]; Table[f@n, {n, 2, 32}] (* Robert G. Wilson v, Jul 11 2009 *)
    Table[d=Divisors[n!]; len=Length[d]; If[OddQ[len], 0, d[[1 + len/2]] - d[[len/2]]], {n, 34}] (* Vincenzo Librandi, Jan 02 2016 *)
  • PARI
    for(k=2,25,d=divisors(k!);print(d[#d/2+1]-d[#d/2])) \\ Jaume Oliver Lafont, Mar 13 2009
    
  • Python
    from math import isqrt, factorial
    from sympy import divisors
    def A061057(n):
        k = factorial(n)
        m = max(d for d in divisors(k,generator=True) if d <= isqrt(k))
        return k//m-m # Chai Wah Wu, Apr 06 2022

Formula

a(n) = A060777(n) - A060776(n).
a(n) = A056737(A000142(n)). - Pontus von Brömssen, Jul 15 2023

Extensions

More terms from Dean Hickerson, Jun 13 2001
Edited by N. J. A. Sloane Jul 07 2009 at the suggestion of R. J. Mathar and Alois P. Heinz
a(41) from Robert G. Wilson v, Oct 03 2014

A219695 For odd numbers 2n - 1, half the difference between the largest divisor not exceeding the square root, and the least divisor not less than the square root.

Original entry on oeis.org

0, 1, 2, 3, 0, 5, 6, 1, 8, 9, 2, 11, 0, 3, 14, 15, 4, 1, 18, 5, 20, 21, 2, 23, 0, 7, 26, 3, 8, 29, 30, 1, 4, 33, 10, 35, 36, 5, 2, 39, 0, 41, 6, 13, 44, 3, 14, 7, 48, 1, 50, 51, 4, 53, 54, 17, 56, 9, 2, 5, 0, 19, 10, 63, 20, 65, 6, 3, 68, 69, 22, 1, 12, 7, 74, 75, 4, 13, 78, 25, 8, 81, 2, 83, 0, 5, 86, 9, 28, 89
Offset: 1

Views

Author

M. F. Hasler, Nov 25 2012

Keywords

Comments

We consider 2n-1 which has only odd divisors, so any difference among them is always even.
a(n) = 0 if and only if 2n - 1 is a square.
From Charles Kusniec, Oct 31 2024: (Start)
a(n) = 1 iff 2n is a square.
a(n) = 2 iff 2n-1 = (2k-1)^2 - 4.
a(n) = 3 iff 2n-1 = (2k)^2 - 9.
Since 2n-1 is odd, 2n-1 = d*D can be written 2n-1 = (x-y)*(x+y) = x^2 - y^2 with integers x and y, from which a(n) is the smallest possible y, which also means smallest possible x and that being x = A377499(n).
Record values occur when 2n-1 is an odd prime (n in A006254), and then a(n) = n-1 (and A377499(n) = n). (End)
From Rémi Guillaume, Mar 12 2025: (Start)
a(n) is half the difference between the "median" divisors of 2n-1.
a(n) and A377499(n) have opposite parities.
a(n) and n have opposite parities. (End)

Examples

			For n = 2, consider divisors of 2n - 1 = 3 which are {1, 3}. The least one greater than or equal to sqrt(3) is 3, the largest one less than or equal to sqrt(3) is 1; whence a(2) = (3 - 1)/2 = 1.
For n = 14, consider divisors of 2n - 1 = 27 which are {1, 3, 9, 27}. The least one greater than or equal to sqrt(27) is 9, the largest one less than or equal to sqrt(27) is 3; whence a(14) = (9 - 3)/2 = 3.
For n = 1, 5, 13, 25, ..., the number 2n - 1 equals the square 1, 9, 25, 49, ...; so the two beforementioned "median" divisors coincide with the square root, and a(n) = 0/2 = 0.
		

Crossrefs

Cf. A006254 (indices of record highs).

Programs

  • Mathematica
    Table[(Divisors[n][[(Length[Divisors[n]] - Boole[IntegerQ[Sqrt[n]]])/2 + 1]] - Divisors[n][[(Length[Divisors[n]] + Boole[IntegerQ[Sqrt[n]]])/2]])/2, {n, 1, 199, 2}] (* Alonso del Arte, Nov 25 2012, corrected March 21 2024, with help from Giorgos Kalogeropoulos *)
    A219695[n_] := (d = Divisors[2n - 1]; l = Floor[Length@d/2 + 1]; (d[[l]] - d[[-l]])/2); Array[A219695, 100] (* Giorgos Kalogeropoulos, Mar 15 2024 *)
  • PARI
    A056737(n)={n=divisors(n); n[(2+#n)\2]-n[(1+#n)\2]}
    A219695(n)=A056737(2*n-1)/2  \\ M. F. Hasler, Nov 25 2012

Formula

a(n) = (A056737(2n-1))/2 = (A033677(2n-1) - A033676(2n-1))/2.
a(n) = sqrt(A377499(n)^2 - (2n-1)). - Charles Kusniec, Oct 31 2024
Showing 1-10 of 32 results. Next