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.

User: Andy Niedermaier

Andy Niedermaier's wiki page.

Andy Niedermaier has authored 9 sequences.

A381901 Partition the natural numbers by letting a(1)=1 (denoting the set {1}) and for n>1 define a(n) to be the least integer such that the product of the set of integers {a(n-1)+1,...,a(n)} is an integer multiple of the previous partition's product.

Original entry on oeis.org

1, 2, 4, 8, 14, 26, 46, 86, 166, 326, 634, 1262, 2518, 5006, 10006, 19946, 39874, 79738, 159398, 318778, 637502, 1274998, 2549978, 5099902, 10199786, 20399534, 40799062, 81598082, 163196134, 326392258, 652784498, 1305568942, 2611137838, 5222275634, 10444551254
Offset: 1

Author

Andy Niedermaier, Mar 09 2025

Keywords

Examples

			The first few corresponding partitions are {1}, {2}, {3, 4}, {5, 6, 7, 8}, {9, 10, 11, 12, 13, 14}.
		

Crossrefs

Appears to agree with A113117 starting at the 5th term and with A113118 starting at the 6th term.

Formula

a(n) = A090905(n+1) - 1.
a(n) = 2 * A006992(n-1) for n>=5.

A366196 The number of ways to express n^n in the form a^b for positive integers a and b.

Original entry on oeis.org

2, 2, 4, 2, 4, 2, 8, 6, 4, 2, 6, 2, 4, 4, 7, 2, 6, 2, 6, 4, 4, 2, 8, 6, 4, 5, 6, 2, 8, 2, 12, 4, 4, 4, 12, 2, 4, 4, 8, 2, 8, 2, 6, 6, 4, 2, 10, 6, 6, 4, 6, 2, 8, 4, 8, 4, 4, 2, 12, 2, 4, 6, 16, 4, 8, 2, 6, 4, 8, 2, 12, 2, 4, 6, 6, 4, 8, 2, 10, 15, 4, 2, 12, 4
Offset: 2

Author

Andy Niedermaier, Oct 03 2023

Keywords

Examples

			a(27) = 5, as "27^27 = a^b" has 5 positive integer solutions: 3^81, 27^27, 19683^9, 7625597484987^3, and (3^81)^1.
		

Crossrefs

Programs

  • Maple
    a:= n-> numtheory[tau](igcd(map(i-> i[2], ifactors(n)[2])[])*n):
    seq(a(n), n=2..100);  # Alois P. Heinz, Oct 03 2023
  • Mathematica
    intPowCountPos[n_] := Module[{m, F, i, t},
      m = n (GCD @@ FactorInteger[n][[All, 2]]);
      t = 0;
      While[Mod[m, 2] == 0,
       t++;
       m = m/2];
      t = t + 1;
      F = FactorInteger[m][[All, 2]];
      If[m > 1,
       For[i = 1, i <= Length[F], i++,
         t = t (F[[i]] + 1)];
       ];
      Return[t]]
  • Python
    from math import gcd
    from sympy import divisor_count, factorint
    def A366196(n): return divisor_count((m:=n*gcd(*factorint(n).values()))>>(t:=(m-1&~m).bit_length()))*(t+1) # Chai Wah Wu, Oct 04 2023

A366161 The number of ways to express n^n in the form a^b for integers a and b.

Original entry on oeis.org

3, 2, 7, 2, 6, 2, 14, 9, 6, 2, 10, 2, 6, 4, 13, 2, 9, 2, 10, 4, 6, 2, 14, 9, 6, 5, 10, 2, 12, 2, 22, 4, 6, 4, 21, 2, 6, 4, 14, 2, 12, 2, 10, 6, 6, 2, 18, 9, 9, 4, 10, 2, 12, 4, 14, 4, 6, 2, 20, 2, 6, 6, 30, 4, 12, 2, 10, 4, 12, 2, 21, 2, 6, 6, 10, 4, 12, 2, 18, 25, 6, 2, 20, 4, 6, 4, 14
Offset: 2

Author

Andy Niedermaier, Oct 02 2023

Keywords

Comments

Finding the first appearance of 2023 was the subject of an Internet puzzle in September 2023. (See web link.) The least such n for which a(n) = 2023 is 26273633422851562500 = 2^2 * 3^16 * 5^16.

Examples

			a(4) = 7, as "4^4 = a^b" has 7 integer solutions: 2^8, (-2)^8, 4^4, (-4)^4, 16^2, (-16)^2, 256^1.
		

Crossrefs

Programs

  • Maple
    a:= n-> add(2-irem(d, 2), d=numtheory[divisors](
           igcd(map(i-> i[2], ifactors(n)[2])[])*n)):
    seq(a(n), n=2..100);  # Alois P. Heinz, Oct 02 2023
  • Mathematica
    intPowCount[n_] := Module[{m, F, i, t},
      m = n (GCD @@ FactorInteger[n][[All, 2]]);
      t = 0;
      While[Mod[m, 2] == 0,
       t++;
       m = m/2];
      t = 2 t + 1;
      F = FactorInteger[m][[All, 2]];
      If[m > 1,
       For[i = 1, i <= Length[F], i++,
         t = t (F[[i]] + 1)];
       ];
      Return[t]]
  • Python
    from math import gcd
    from sympy import divisor_count, factorint
    def A366161(n): return divisor_count((m:=n*gcd(*factorint(n).values()))>>(t:=(m-1&~m).bit_length()))*(t<<1|1) # Chai Wah Wu, Oct 04 2023

A354457 a(n) is the least integer for which there exist two disjoint sets of n positive integers each, all distinct, for which the product of the integers in either set is a(n).

Original entry on oeis.org

6, 36, 240, 2520, 30240, 443520, 6652800, 133056000, 2075673600, 58118860800, 1270312243200, 29640619008000, 844757641728000, 25342729251840000, 810967336058880000, 27978373094031360000, 1077167364120207360000, 43086694564808294400000, 1499416970855328645120000
Offset: 2

Author

Andy Niedermaier, May 30 2022

Keywords

Comments

This is also the least integer that can be represented as the product of the integers > 1 in two disjoint sets, one having n terms and the other having n-1 terms.
From Jon E. Schoenfield, May 12 2024: (Start)
For n >= 2, let b(n) be the square root of the smallest square that can be expressed as the product of 2*n distinct positive integers; then a(n) >= b(n).
Conjecture: for every n >= 2, a(n) = b(n). (End)

Examples

			From _Jinyuan Wang_, May 31 2022: (Start)
For n=2,       6 = 1*6                  = 2 * 3.
For n=3,      36 = 1*4*9                = 2 * 3 * 6.
For n=4,     240 = 1*3*8*10             = 2 * 4 * 5 * 6.
For n=5,    2520 = 1*2*9*10*14          = 3 * 4 * 5 * 6 * 7.
For n=6,   30240 = 1*2*6*10*14*18       = 3 * 4 * 5 * 7 * 8 * 9.
For n=7,  443520 = 1*2*5*9*14*16*22     = 3 * 4 * 6 * 7 * 8 *10 *11.
For n=8, 6652800 = 1*2*3*12*14*15*20*22 = 4 * 5 * 6 * 7 * 8 * 9 *10 *11. (End)
From _Zhao Hui Du_, May 11 2024: (Start)
For n=9, 133056000 = 1*2*3*9*14*16*20*22*25 = 4*5*6*7*8*10*11*12*15.
For n=10, 2075673600 = 1*2*3*7*15*16*18*20*22*26 = 4*5*6*8*9*10*11*12*13*14. (End)
		

Crossrefs

Extensions

a(7)-a(8) from Jinyuan Wang, May 31 2022
a(9)-a(10) from Zhao Hui Du, May 11 2024
a(11)-a(20) from Jon E. Schoenfield, May 11 2024

A304935 a(n) is the largest possible integer value for sqrt(0 1 2 ... n), where one is allowed to place any mixture of +'s and *'s in the n blank spaces.

Original entry on oeis.org

1, 0, 0, 5, 11, 6, 71, 19, 123, 33, 174, 426, 174, 233, 625, 816, 5695, 3656, 15936, 246960, 24234, 24234, 35151, 140604, 177399, 250982, 1304130, 1304130, 1304130, 1304130, 5532955, 5532955, 58136459, 8525544, 8525544, 58136459, 941988492, 58136459, 941988492
Offset: 1

Author

Andy Niedermaier, May 21 2018

Keywords

Comments

Inspired by a test ARML problem from 2018, which asked students to determine a(8).

Examples

			a(2) = a(3) = 0, since no positive squares are achievable.
Some examples:
a(7) = 71 = sqrt(0+1+2*3*4*5*6*7).
a(8) = 19 = sqrt(0+1*2+3+4*5+6*7*8).
a(20) = 246960 = sqrt(0+1*2*3*4*5*6*7*8*9*10*11+12*13*14*15*16*17*18*19*20)
		

Crossrefs

Upper-bounded by sqrt(A038507).

Programs

  • Mathematica
    sqStrTest[n_] := Module[{bVal, bStr, i, j, iB, mVal, mStr},
      bVal = -1;
      For[i = 0, i < 2^n, i++,
       iB = IntegerDigits[i, 2];
       While[Length[iB] < n, PrependTo[iB, 0]];
       mStr = "0";
       For[j = 1, j <= n, j++,
        mStr = StringJoin[mStr, If[iB[[j]] == 0, "+", "*"], ToString[j]]];
       mVal = ToExpression[mStr];
       If[Sqrt[mVal] == Floor[Sqrt[mVal]],
        If[mVal > bVal, {bVal, bStr} = {mVal, mStr}]
        ]
       ];
      Print[{Sqrt[bVal], bVal, bStr}]]
  • PARI
    See Links section.

Extensions

More terms from Rémy Sigrist, May 22 2018

A186736 Maximum sum of relatively prime integers no larger than n.

Original entry on oeis.org

1, 3, 6, 8, 13, 13, 20, 24, 30, 30, 41, 41, 54, 54, 55, 63, 80, 80, 99, 99, 103, 103, 126, 126, 146, 146, 159, 164, 193, 193, 224, 235, 235, 235, 238, 238, 275, 275, 275, 275, 316, 316, 359, 360, 360, 360, 407, 407, 446, 446, 453, 459, 512, 512, 531, 531, 535
Offset: 1

Author

Andy Niedermaier, Aug 29 2013

Keywords

Examples

			a(30) = 193, for the set {1, 11, 13, 17, 19, 23, 25, 27, 28, 29}.
a(51) = 453, for the set {1, 13, 19, 23, 25, 29, 31, 37, 41, 43, 44, 47, 49, 51}. - _Matt Ready_, Oct 05 2024
		

Programs

  • PARI
    \\ see link
    
  • Python
    # see link

Extensions

a(31)-a(47) from Alois P. Heinz, Aug 29 2013
a(51) corrected by Matt Ready, Oct 05 2024

A228288 Smallest k such that z = n in the minimal value of x + y*z, given x*y + z = k (for positive integers x, y, z).

Original entry on oeis.org

2, 8, 48, 160, 720, 790, 1690, 4572, 13815, 22031, 22032, 79965, 209013, 546035, 546036, 546037, 2932793, 2037794, 2932795, 12433772, 17529248, 9945922, 72105623, 72105624, 72105625, 195099674, 205216242, 222426196, 222426197, 984126926
Offset: 1

Author

Andy Niedermaier, Aug 19 2013

Keywords

Comments

The first decrease in the sequence is at a(17) > a(18). [Andy Niedermaier, Sep 01 2013]
No value of z larger than 25 appears in the first 10^8 terms of A228287.

Examples

			For n = 3, a(n) = 48. This is because for 2 <= n < 48, z = 1 or z = 2 in the smallest value of x + yz (given xy + z = n). But for xy + z = 48, the minimal x + yz is given for (x, y, z) = (15, 3, 3).
In cases where multiple triples (x, y, z) achieve the smallest value for x + yz, we consider the triple with the smaller value of z. (See A228287.) Thus, even though for n = 215, (53, 4, 3) and (35, 6, 5) give the minimum value for x + yz, a(5) cannot equal 215. (720 is the smallest n for which we MUST have z = 5 in order to achieve the minimum x + yz.)
		

Crossrefs

Formula

a(n) = min {k: A228287(k)=n}. Smallest greedy inverse of A228287. - R. J. Mathar, Sep 02 2013

Extensions

Added terms a(17) through a(25). - Andy Niedermaier, Sep 02 2013
Added terms a(26) through a(30). - Andy Niedermaier, Sep 11 2013

A228287 Smallest value of z in the minimal value of x + y*z, given x*y + z = n (where x, y, z are positive integers).

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 2, 1, 2, 1, 1, 1, 2, 1, 2, 1, 1, 1, 2, 1, 1, 1, 1, 1, 2, 1, 2, 1, 1, 2, 1, 1, 2, 1, 1, 1, 2, 1, 2, 1, 1, 2, 3, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 2, 3, 1, 2, 3, 1, 1, 1, 1, 2, 1, 2, 1, 2, 1, 2, 3, 1, 1, 1, 1, 2, 1, 1, 2, 3, 1, 1, 2, 1
Offset: 2

Author

Andy Niedermaier, Aug 19 2013

Keywords

Comments

If there are multiple triples (x, y, z) for which xy + z = n and x + yz is minimized, consider the triple with smallest z. I.e., this sequence illustrates the smallest z needed to minimize x + y*z.

Examples

			For n = 215 the triples (53, 4, 3) and (35, 6, 5) both give the minimal value of x + yz = 65. Thus a(215) = 3.
		

Crossrefs

Cf. A228286.

Programs

  • Maple
    A228287 := proc(n)
        local a,x,y,z,zfin ;
        a := n+n^2 ;
        zfin := n ;
        for z from 1 to n-1 do
            for x in numtheory[divisors](n-z) do
                y := (n-z)/x ;
                if x+y*z < a then
                    a := x+y*z ;
                    zfin := z ;
                end if;
            end do:
        end do:
        return zfin;
    end proc: # R. J. Mathar, Sep 02 2013
  • Mathematica
    A228287[n_] := Module[{a, x, y, z, zfin}, a = n + n^2; zfin = n; Do[Do[y = (n-z)/x; If[x + y*z < a, a = x + y*z; zfin = z], {x, Divisors[n-z]}], {z, 1, n-1}]; zfin];
    Table[A228287[n], {n, 2, 100}] (* Jean-François Alcover, Aug 08 2023, after R. J. Mathar *)

A228286 Smallest x + y*z, given x*y + z = n (for positive integers x, y, z).

Original entry on oeis.org

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

Author

Andy Niedermaier, Aug 19 2013

Keywords

Comments

One of the terms in this sequence is the subject of a problem on the 2013 ARML contest (Team Round).
The Mathematica code below computes the quadruple {x, y, z, a(n)}, where z is as small as possible (in the event of a tie).

Examples

			For n = 160, a(n) = 50, as 26 * 6 + 4 = 160 and 26 + 6 * 4 = 50 and no triple of positive integers (x, y, z) with xy + z = 160 gives a smaller value for x + yz.
		

Crossrefs

Cf. A228287 (z-coordinate of the triple (x, y, z) that minimizes x + yz).
Cf. A228288 (least k such that z = n, given xy + z = k and x + yz is minimized).

Programs

  • Maple
    A228286 := proc(n)
        local a,x,y,z ;
        a := n+n^2 ;
        for z from 1 to n-1 do
            for x in numtheory[divisors](n-z) do
                y := (n-z)/x ;
                a := min(a, x+y*z) ;
            end do:
        end do:
        return a;
    end proc: # R. J. Mathar, Sep 02 2013
  • Mathematica
    a[n_] := Module[{X, bX, bT, m},
      bT = n + 1;
      bX = {n - 1, 1, 1, n};
      X = bX;
      m = Floor[2*Sqrt[X[[3]]*(n - X[[3]])]];
      While[bT >= m && X[[3]] <= n/2,
       X[[2]] = Max[1, Floor[(n - bX[[3]])/bT]];
       While[X[[2]] <= Floor[bT/X[[3]]],
        If[Mod[n - X[[3]], X[[2]]] == 0,
         X[[1]] = (n - X[[3]])/X[[2]];
         X[[4]] = X[[1]] + X[[2]]*X[[3]];
         If[X[[4]] < bX[[4]], bX = X]];
        X[[2]] = X[[2]] + 1];
       X[[3]] = X[[3]] + 1;
       m = Floor[2*Sqrt[X[[3]]*(n - X[[3]])]]];
      Return[bX]]; Table[a[n][[-1]], {n, 2, 100}]