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

A178715 a(n) = solution to the "Select All, Copy, Paste" problem: Given the ability to type a single letter, or to type individual "Select All", "Copy" or "Paste" command keystrokes, what is the maximal number of letters of text that can be obtained with n keystrokes?

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 9, 12, 16, 20, 27, 36, 48, 64, 81, 108, 144, 192, 256, 324, 432, 576, 768, 1024, 1296, 1728, 2304, 3072, 4096, 5184, 6912, 9216, 12288, 16384, 20736, 27648, 36864, 49152, 65536, 82944, 110592, 147456, 196608, 262144, 331776, 442368, 589824, 786432, 1048576, 1327104, 1769472, 2359296, 3145728, 4194304
Offset: 1

Views

Author

Bill Blewett, Jan 11 2011

Keywords

Comments

It is assumed that we start with a single letter in the copy buffer.
Alternatively, a(n-1) = maximal value of Product (k_i-1) for any way of writing n = Sum k_i.
1. The description above assumes that the text is deselected after the Copy command is invoked.
2. This sequence is the solution to the equivalent problem formulated as {insert, "Select All+ Copy" macro (without deselection), Paste}.
3. This sequence is a "paradigm-shift" sequence with procedure length p =1 (in the sense of A193455).
4. The optimal number of pastes per copy, as measured by the geometric growth rate (p+z root of z), is z = 4. [noninteger maximum between 3 and 4]
5. The function a(n) = maximum value of the product of the terms k_i, where Sum (k_i) = n+1-i_max.
6. All solutions will be of the form a(n) = m^b * (m+1)^d.

Examples

			For n = 7 the a(7) = 9 solution is to type the seven keystrokes: paste, paste, paste, select-all, copy, paste paste which yields nine text characters.
Here is a table showing the pattern for n = 1 to 35. The first column is n and the second column is the number of characters that can be obtained with n keystrokes.  The remainder of the line shows how to get the maximum, as follows.  S = Select and C = Copy while a dot stands for Paste.  The dots at the beginning of a line are equivalent to a single letter being typed, based on the assumption that at the start there is a single letter in the paste buffer.
01: 00001 .
02: 00002 ..
03: 00003 ...
04: 00004 ....
05: 00005 .....
06: 00006 ......
07: 00009 ...SC..
08: 00012 ....SC..
09: 00016 ....SC...
10: 00020 .....SC...
11: 00027 ...SC..SC..
12: 00036 ....SC..SC..
13: 00048 ....SC...SC..
14: 00064 ....SC...SC...
15: 00081 ...SC..SC..SC..
16: 00108 ....SC..SC..SC..
17: 00144 ....SC...SC..SC..
18: 00192 ....SC...SC...SC..
19: 00256 ....SC...SC...SC...
20: 00324 ....SC..SC..SC..SC..
21: 00432 ....SC...SC..SC..SC..
22: 00576 ....SC...SC...SC..SC..
23: 00768 ....SC...SC...SC...SC..
24: 01024 ....SC...SC...SC...SC...
25: 01296 ....SC...SC..SC..SC..SC..
26: 01728 ....SC...SC...SC..SC..SC..
27: 02304 ....SC...SC...SC...SC..SC..
28: 03072 ....SC...SC...SC...SC...SC..
29: 04096 ....SC...SC...SC...SC...SC...
30: 05184 ....SC...SC...SC..SC..SC..SC..
31: 06912 ....SC...SC...SC...SC..SC..SC..
32: 09216 ....SC...SC...SC...SC...SC..SC..
33: 12288 ....SC...SC...SC...SC...SC...SC..
34: 16384 ....SC...SC...SC...SC...SC...SC...
35: 20736 ....SC...SC...SC...SC..SC..SC..SC..
It appears that A000792 is the result if only one keystroke instead of two is required for the "Select All, Copy" operation.  Here is the table.  Here "C" means that all the previously typed characters are copied to the paste buffer.
01: 00001 .
02: 00002 ..
03: 00003 ...
04: 00004 ....
05: 00006 ...C.
06: 00009 ...C..
07: 00012 ....C..
08: 00018 ...C..C.
09: 00027 ...C..C..
10: 00036 ....C..C..
11: 00054 ...C..C..C.
12: 00081 ...C..C..C..
13: 00108 ....C..C..C..
14: 00162 ...C..C..C..C.
15: 00243 ...C..C..C..C..
16: 00324 ....C..C..C..C..
17: 00486 ...C..C..C..C..C.
18: 00729 ...C..C..C..C..C..
19: 00972 ....C..C..C..C..C..
20: 01458 ...C..C..C..C..C..C.
21: 02187 ...C..C..C..C..C..C..
22: 02916 ....C..C..C..C..C..C..
23: 04374 ...C..C..C..C..C..C..C.
24: 06561 ...C..C..C..C..C..C..C..
25: 08748 ....C..C..C..C..C..C..C..
26: 13122 ...C..C..C..C..C..C..C..C.
27: 19683 ...C..C..C..C..C..C..C..C..
28: 26244 ....C..C..C..C..C..C..C..C..
29: 39366 ...C..C..C..C..C..C..C..C..C.
30: 59049 ...C..C..C..C..C..C..C..C..C..
31: 78732 ....C..C..C..C..C..C..C..C..C..
		

Crossrefs

See A193286 for another version. Cf. A000792.
A000792, A178715, A193286, A193455, A193456, and A193457 are paradigm shift sequences with procedure lengths p=0,1,...,5, respectively.
Cf. A367116 (squares summing to n).

Programs

  • Mathematica
    LinearRecurrence[{0,0,0,0,4},{1,2,3,4,5,6,9,12,16,20,27,36,48,64,81},60] (* Harvey P. Dale, Apr 11 2017 *)
  • PARI
    Vec(x*(1 +2*x +3*x^2 +4*x^3 +5*x^4 +2*x^5 +x^6 +3*x^10 +x^14) / (1 -4*x^5) + O(x^100)) \\ Colin Barker, Nov 19 2016
    
  • Python
    def a(n):
        c=(n//5) + 1
        if n<15:
            if n==5: return 5
            if n==10: return 20
            r=(n + 1)%c
            q=((n + 1)//c) - 1
            return q**(c - r)*(q + 1)**r
        else:
            r=n%5
            return 3**(4 - r)*4**(c - 4 + r)
    print([a(n) for n in range(1, 102)]) # Indranil Ghosh, Jun 27 2017

Formula

a(n) = 4*a(n-5) for n>=16.
a(n) =
a(5;10) = 5; 20 [C=1, 2 below, respectively]
a(n=1:14) = Q^(C-R)*(Q+1)^R
where C = floor(n/5)+1, R = n+1 mod C,
and Q = floor(n+1/C)-1
a(n>=15) = 3^(4-R)*4^(C-4+R)
where C = floor (n/5)+1, R = n mod 5.
G.f.: x*(1 +2*x +3*x^2 +4*x^3 +5*x^4 +2*x^5 +x^6 +3*x^10 +x^14) / (1 -4*x^5). - Colin Barker, Nov 19 2016

Extensions

Edited by N. J. A. Sloane, Jul 21 2011
Additional comment and formula from David Applegate, Jul 21 2011
Additional comments, formulas, and CrossRefs by Jonathan T. Rowell, Jul 30 2011
More terms from Joerg Arndt, Nov 15 2014

A193286 a(n) is the maximal number of a's that can be produced in a blank document with n "keystrokes".

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 9, 12, 16, 20, 25, 30, 36, 48, 64, 80, 100, 125, 150, 192, 256, 320, 400, 500, 625, 768, 1024, 1280, 1600, 2000, 2500, 3125, 4096, 5120, 6400, 8000, 10000, 12500, 16384, 20480, 25600, 32000, 40000, 50000, 65536, 81920, 102400, 128000, 160000, 200000, 262144, 327680
Offset: 1

Views

Author

N. J. A. Sloane, Jul 20 2011

Keywords

Comments

A "keystroke" means one of the following:
a (i.e., hit the letter "a" on the keyboard)
Ctrl-a ("select all")
Ctrl-c (copy selected text to clipboard)
Ctrl-v (paste from clipboard to cursor location)
Alternatively, a(n-2) = maximal value of Product (k_i-2) for any way of writing n = Sum k_i
1. Note that the copy command does not deselect the text.
2. This sequence is a "paradigm-shift" sequence with procedure length p =2 (in the sense of A193455).
3. The optimal number of pastes per copy, as measured by the geometric growth rate (p+z root of z), is z = 4. [Non-integer maximum between 4 and 5.]
4. The function a(n) = maximum value of the product of the terms k_i, where Sum (k_i) = n + 2 - 2*i_max.
5. All solutions will be of the form a(n) = m^b * (m+1)^d.

Examples

			For n=25, C = floor(28/6) = 4, R = (27 mod 4) = 3, and Q = floor(27/4)-2 = 4; therefore, a(25) = 4^(4-3)*5^(3) = 4*5^3 = 500.
For n=9, we use the general solution, but with C=2 (rather than C=1). R=(11 mod 2)=1, Q=3, and a(9)=3^(2-1)*4^1 = 12.
		

Crossrefs

See A178715 for another version. Cf. A000792.
A000792, A178715, A193286, A193455, A193456, and A193457 are paradigm shift sequences of procedure lengths p=0,1,...,5, respectively.

Programs

  • Haskell
    -- See Theorem 5 in John Derbyshire link.
    a193286 n = p n [] where
       p 0 ks       = product ks
       p n []       = p (n-1) [1]
       p n (k:ks)
        | n < 0     = 0
        | otherwise = max (p (n-1) ((k+1):ks)) (p (n-3) (1:k:ks))
    -- Reinhard Zumkeller, Jul 22 2011, Jul 21 2011
    
  • Mathematica
    a[n_ /; 1 <= n <= 7] := n; a[8] = 9; a[n_ /; 9 <= n <= 27] := (c = Max[1, Floor[(n+3)/6]]; r = Mod[n+2, c]; q = Floor[(n+2)/c]-2;q^(c-r)*(q+1)^r);a[n_ /; n >= 28] := ({q, r} = QuotientRemainder[n+2, 6]; 4^(q-r)*5^r);Table[a[n], {n, 1, 60}] (* Jean-François Alcover, May 28 2015 *)
  • Python
    def a(n):
        if n<8: return n
        elif n==8: return 9
        elif n>8 and n<=27:
            c=max(1, ((n + 3)//6))
            r=(n + 2)%c
            q=((n + 2)//c) - 2
            return q**(c - r)*(q + 1)**r
        else:
            q=((n + 2)//6)
            r=(n + 2)%6
            return 4**(q - r)*5**r
    print([a(n) for n in range(1, 101)]) # Indranil Ghosh, Jun 27 2017, after Mathematica code

Formula

a(n) = 4*a(n-6) for n >= 34. [corrected by Georg Fischer, Jun 09 2022]
a(n) = a(8;9;15;21;27) = 9; 12; 48; 192; 768 - corresponding to [C=2;2;3;4;5 below].
a(n=9..27) = Q^(C-R) * (Q+1)^R where C = floor((n+3)/6) [minimum value 1], R = (n+2) mod C, and Q = floor((n+2)/C)-2.
a(n>=28) = 4^(C-R) * 5^R, where C = floor((n+2)/6), R = (n+2) mod 6.

Extensions

Additional comment and formula from David Applegate, Jul 21 2011
More terms from Reinhard Zumkeller, Jul 22 2011, Jul 21 2011
Additional comments, formulas, examples and CrossRefs from Jonathan T. Rowell, Jul 30 2011

A005520 Smallest number of complexity n: smallest number requiring n 1's to build using + and *.

Original entry on oeis.org

1, 2, 3, 4, 5, 7, 10, 11, 17, 22, 23, 41, 47, 59, 89, 107, 167, 179, 263, 347, 467, 683, 719, 1223, 1438, 1439, 2879, 3767, 4283, 6299, 10079, 11807, 15287, 21599, 33599, 45197, 56039, 81647, 98999, 163259, 203999, 241883, 371447, 540539, 590399, 907199
Offset: 1

Views

Author

Keywords

Comments

Ed Pegg Jr, www.mathpuzzle.com, Apr 10 2001, notes that all the new terms are -1 mod 120. - That is, this holds at least for all terms from a(45) = 590399 up to the highest known term a(89) given in the b-file at the end of 2015. Comment clarified by Antti Karttunen, Dec 14 2015
Largest number of complexity n is given by A000792. - David W. Wilson, Oct 03 2005
After 1438 = 2 * 719, all elements through 8206559 are primes. Equivalently, except for a(4) = 4, a(7) = 10, a(10) = 22 and a(25) = 1438, we have a(1) through a(53) are all primes. - Jonathan Vos Post, Apr 07 2006
a(54)-a(89) are all primes. - Janis Iraids, Apr 21 2011
Previous observations (primes with property -1 mod 120) still hold. - Martins Opmanis, Oct 16 2009
The prime 353942783 = A189125(1) = 2*3 + (1 + 2^2*3^2)*(2 + 3^4(1 + 2*3^10)) is the smallest counterexample to Guy's first hypothesis on integer complexity. - Jonathan Vos Post, Mar 30 2012
The sequence A265360 (second smallest number of complexity n) seems to have similar properties. - Janis Iraids via Antti Karttunen, Dec 15 2015

Examples

			Examples from Piotr Fabian:
1 = 1, 1 "one": first 1, a(1) = 1
2 = 1+1, 2 "ones": first 2, a(2) = 2
3 = 1+1+1, 3 "ones": first 3, a(3) = 3
4 = 1+1+1+1, 4 "ones": first 4, a(4) = 4
5 = 1+1+1+1+1, 5 "ones": first 5, a(5) = 5
6 = (1+1)*(1+1+1), 5 "ones"
7 = 1+((1+1)*(1+1+1)), 6 "ones": first 6, a(6) = 7
8 = (1+1)*(1+1+1+1), 6 "ones"
9 = (1+1+1)*(1+1+1), 6 "ones"
10 = 1+((1+1+1)*(1+1+1)), 7 "ones": first 7, a(7) = 10
11 = 1+(1+(1+1+1)*(1+1+1)), 8 "ones": first 8, a(8) = 11
12 = (1+1)*((1+1)*(1+1+1)), 7 "ones"
		

References

  • R. K. Guy, Unsolved Problems in Number Theory, Sec. F26 (related material).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Programs

  • MATLAB
    N = 10^6;
    fact = cell(1,N);
    for n = 2:sqrt(N)
      for m = [n^2:n:N]
        fact{m} = [fact{m},n];
      end
    end
    R = zeros(1,N);
    R(1) = 1;
    A(1) = 1;
    mmax = 1;
    for n = 2:N
      m = min(R(1:floor(n/2)) + R([n-1:-1:ceil(n/2)]));
      if numel(fact{n}) > 0
        m = min(m, min(R(fact{n}) + R(n ./ fact{n})));
      end
      R(n) = m;
      if m > mmax
        A(m) = n;
        mmax = m;
      elseif A(m) == 0
        A(m) = n;
      end
    end
    A % Robert Israel, Dec 14 2015
    
  • Maple
    N:= 100000: # to get all terms <= N
    R:= Vector(N):
    R[1]:= 1: A[1]:= 1:
    for n from 2 to N do
      inds:= [seq(n-i,i=1..floor(n/2))];
      m:= min(R[1..floor(n/2)] + R[inds]);
      for d in select(`<=`,numtheory:-divisors(n),floor(sqrt(n))) minus {1} do
        m:= min(m, R[d]+R[n/d])
      od;
      R[n]:= m;
      if not assigned(A[m]) then A[m]:= n fi;
    od:
    seq(A[m],m=1..max(R)); # Robert Israel, Dec 14 2015
  • Mathematica
    nn = 10000;
    R = Table[0, nn];
    R[[1]] = 1; Clear[A]; A[1] = 1;
    For[n = 2, n <= nn, n++,
      inds = Table[n-i, {i, 1, n/2}];
      m = Min[R[[1 ;; Floor[n/2]]] + R[[inds]]];
      Do[
        m = Min[m, R[[d]] + R[[n/d]]], {d,
        Select[Rest[Divisors[n]], # <= Sqrt[n]&]}
      ];
      R[[n]] = m;
      If[!IntegerQ[A[m]], A[m] = n];
    ];
    Table[A[m], {m, 1, Max[R]}] (* Jean-François Alcover, Aug 05 2018, after Robert Israel *)
  • Python
    def aupton(nn):
      alst, R = [1], {0: {1}} # R[n] is set reachable using n+1 1's (n ops)
      for n in range(1, nn):
        R[n]  = set(a+b for i in range(n//2+1) for a in R[i] for b in R[n-1-i])
        R[n] |= set(a*b for i in range(n//2+1) for a in R[i] for b in R[n-1-i])
        alst.append(min(R[n] - R[n-1]))
      return alst
    print(aupton(35)) # Michael S. Branicky, Jun 08 2021

Extensions

Corrected and extended by David W. Wilson, May 1997
Extended to terms a(40)=163259 and a(41)=203999 by John W. Layman, Nov 03 1999
Further terms from Piotr Fabian (PCF(AT)who.net), Mar 30 2001
a(68)-a(89) from Janis Iraids, Apr 20 2011

A370808 Greatest number of multisets that can be obtained by choosing a divisor of each part of an integer partition of n.

Original entry on oeis.org

1, 1, 2, 2, 3, 4, 5, 6, 7, 10, 11, 14, 17, 19, 23, 29, 30, 39, 41, 51, 58, 66, 78, 82, 102, 110, 132, 144, 162, 186, 210, 228, 260, 296, 328, 366, 412, 462, 512, 560, 638, 692, 764, 860, 924, 1028, 1122, 1276, 1406, 1528, 1721, 1898, 2056, 2318, 2506, 2812, 3020, 3442
Offset: 0

Views

Author

Gus Wiseman, Mar 05 2024

Keywords

Examples

			For the partitions of 5 we have the following choices:
      (5): {{1},{5}}
     (41): {{1,1},{1,2},{1,4}}
     (32): {{1,1},{1,2},{1,3},{2,3}}
    (311): {{1,1,1},{1,1,3}}
    (221): {{1,1,1},{1,1,2},{1,2,2}}
   (2111): {{1,1,1,1},{1,1,1,2}}
  (11111): {{1,1,1,1,1}}
So a(5) = 4.
		

Crossrefs

For just prime factors we have A370809.
The version for factorizations is A370816, for just prime factors A370817.
A000005 counts divisors.
A000041 counts integer partitions, strict A000009.
A006530 gives greatest prime factor, least A020639.
A027746 lists prime factors, A112798 indices, length A001222.
A239312 counts condensed partitions, ranks A368110.
A355731 counts choices of a divisor of each prime index, firsts A355732.
A355733 counts choices of divisors of prime indicec.
A370320 counts non-condensed partitions, ranks A355740.
A370592 counts factor-choosable partitions, complement A370593.

Programs

  • Mathematica
    Table[Max[Length[Union[Sort/@Tuples[Divisors/@#]]]&/@IntegerPartitions[n]],{n,0,30}]

Extensions

Terms a(31) onward from Max Alekseyev, Sep 17 2024

A370820 Number of positive integers that are a divisor of some prime index of n.

Original entry on oeis.org

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

Views

Author

Gus Wiseman, Mar 15 2024

Keywords

Comments

A prime index of n is a number m such that prime(m) divides n. The multiset of prime indices of n is row n of A112798.
This sequence contains all nonnegative integers. In particular, a(prime(n)!) = n.

Examples

			2045 has prime indices {3,80} with combined divisors {1,2,3,4,5,8,10,16,20,40,80}, so a(2045) = 11. In fact, 2045 is the least number with this property.
		

Crossrefs

a(prime(n)) = A000005(n).
Positions of ones are A000079 except for 1.
a(n!) = A000720(n).
a(prime(n)!) = a(prime(A005179(n))) = n.
Counting prime factors instead of divisors gives A303975.
Positions of 2's are A371127.
Position of first appearance of n is A371131(n), sorted version A371181.
A001221 counts distinct prime factors.
A003963 gives product of prime indices.
A027746 lists prime factors, A112798 indices, length A001222.
A355731 counts choices of a divisor of each prime index, firsts A355732.
A355741 counts choices of a prime factor of each prime index.

Programs

  • Mathematica
    Table[Length[Union@@Divisors/@PrimePi/@First/@If[n==1,{},FactorInteger[n]]],{n,100}]
  • PARI
    a(n) = my(list=List(), f=factor(n)); for (i=1, #f~, fordiv(primepi(f[i,1]), d, listput(list, d))); #Set(list); \\ Michel Marcus, May 02 2024

A370802 Positive integers with as many prime factors (A001222) as distinct divisors of prime indices (A370820).

Original entry on oeis.org

1, 2, 6, 9, 10, 22, 25, 28, 30, 34, 42, 45, 62, 63, 66, 75, 82, 92, 98, 99, 102, 104, 110, 118, 121, 134, 140, 147, 152, 153, 156, 166, 170, 186, 210, 218, 228, 230, 232, 234, 246, 254, 260, 275, 276, 279, 289, 308, 310, 314, 315, 330, 342, 343, 344, 348, 350
Offset: 1

Views

Author

Gus Wiseman, Mar 14 2024

Keywords

Comments

A prime index of n is a number m such that prime(m) divides n. The multiset of prime indices of n is row n of A112798.
All squarefree terms are even.

Examples

			The prime indices of 1617 are {2,4,4,5}, with distinct divisors {1,2,4,5}, so 1617 is in the sequence.
The terms together with their prime indices begin:
    1: {}
    2: {1}
    6: {1,2}
    9: {2,2}
   10: {1,3}
   22: {1,5}
   25: {3,3}
   28: {1,1,4}
   30: {1,2,3}
   34: {1,7}
   42: {1,2,4}
   45: {2,2,3}
   62: {1,11}
   63: {2,2,4}
   66: {1,2,5}
   75: {2,3,3}
   82: {1,13}
   92: {1,1,9}
   98: {1,4,4}
   99: {2,2,5}
  102: {1,2,7}
  104: {1,1,1,6}
		

Crossrefs

For factors instead of divisors on the RHS we have A319899.
A version for binary indices is A367917.
For (greater than) instead of (equal) we have A370348, counted by A371171.
The RHS is A370820, for prime factors instead of divisors A303975.
Partitions of this type are counted by A371130, strict A371128.
For divisors instead of factors on LHS we have A371165, counted by A371172.
For only distinct prime factors on LHS we have A371177, counted by A371178.
Other inequalities: A371166, A371167, A371169, A371170.
A000005 counts divisors.
A001221 counts distinct prime factors.
A027746 lists prime factors, A112798 indices, length A001222.
A239312 counts divisor-choosable partitions, ranks A368110.
A355731 counts choices of a divisor of each prime index, firsts A355732.
A370320 counts non-divisor-choosable partitions, ranks A355740.

Programs

  • Mathematica
    Select[Range[100],PrimeOmega[#]==Length[Union @@ Divisors/@PrimePi/@First/@If[#==1,{},FactorInteger[#]]]&]

Formula

A001222(a(n)) = A370820(a(n)).

A048249 Number of distinct values produced from sums and products of n unity arguments.

Original entry on oeis.org

1, 2, 3, 4, 6, 9, 11, 17, 23, 30, 44, 60, 80, 114, 156, 212, 296, 404, 556, 770, 1065, 1463, 2032, 2795, 3889, 5364, 7422, 10300, 14229, 19722, 27391, 37892, 52599, 73075, 101301, 140588, 195405, 271024, 376608, 523518, 726812, 1010576, 1405013, 1952498
Offset: 1

Views

Author

Keywords

Comments

Values listed calculated by exhaustive search algorithm.
For n+1 operands (n operations) there are (2n)!/((n!)((n+1)!)) possible postfix forms over a single operator. For each such form, there are 2^n ways to assign 2 operators (here, sum and product). Calculate results and eliminate duplicates.
Number of distinct positive integers that can be obtained by iteratively adding or multiplying together parts of an integer partition until only one part remains, starting with 1^n. - Gus Wiseman, Sep 29 2018

Examples

			a(3)=3 since (in postfix): 111** = 11*1* = 1, 111*+ = 11*1+ = 111+* = 11+1* = 2 and 111++ = 11+1+ = 3. Note that at n=7, the 11 possible values produced are the set {1,2,3,4,5,6,7,8,9,10,12}. This is the first n for which there are "skipped" values in the set.
		

Crossrefs

Programs

  • Maple
    b:= proc(n) option remember; `if`(n=1, {1}, {seq(seq(seq(
         [f+g, f*g][], g=b(n-i)), f=b(i)), i=1..iquo(n, 2))})
        end:
    a:= n-> nops(b(n)):
    seq(a(n), n=1..35);  # Alois P. Heinz, May 05 2019
  • Mathematica
    ReplaceListRepeated[forms_,rerules_]:=Union[Flatten[FixedPointList[Function[pre,Union[Flatten[ReplaceList[#,rerules]&/@pre,1]]],forms],1]];
    Table[Length[Select[ReplaceListRepeated[{Array[1&,n]},{{foe___,x_,mie___,y_,afe___}:>Sort[Append[{foe,mie,afe},x+y]],{foe___,x_,mie___,y_,afe___}:>Sort[Append[{foe,mie,afe},x*y]]}],Length[#]==1&]],{n,10}] (* Gus Wiseman, Sep 29 2018 *)
  • Python
    from functools import cache
    @cache
    def f(m):
        if m == 1: return {1}
        out = set()
        for j in range(1, m//2+1):
            for x in f(j):
                for y in f(m-j):
                    out.update([x + y, x * y])
        return out
    def a(n): return len(f(n))
    print([a(n) for n in range(1, 40)]) # Michael S. Branicky, Aug 03 2022

Formula

Equals partial sum of "number of numbers of complexity n" (A005421). - Jonathan Vos Post, Apr 07 2006

Extensions

More terms from David W. Wilson, Oct 10 2001
a(43)-a(44) from Alois P. Heinz, May 05 2019

A319910 Number of distinct pairs (m, y), where m >= 1 and y is an integer partition of n, such that m can be obtained by iteratively adding or multiplying together parts of y until only one part (equal to m) remains.

Original entry on oeis.org

1, 3, 6, 11, 23, 48, 85, 178, 331, 619, 1176, 2183, 3876, 7013, 12447, 21719, 37628, 64570, 109723, 185055
Offset: 1

Views

Author

Gus Wiseman, Oct 01 2018

Keywords

Examples

			The a(4) = 11 pairs:
  4 <= (4)
  3 <= (3,1)
  4 <= (3,1)
  4 <= (2,2)
  2 <= (2,1,1)
  3 <= (2,1,1)
  4 <= (2,1,1)
  1 <= (1,1,1,1)
  2 <= (1,1,1,1)
  3 <= (1,1,1,1)
  4 <= (1,1,1,1)
		

Crossrefs

Programs

  • Mathematica
    ReplaceListRepeated[forms_,rerules_]:=Union[Flatten[FixedPointList[Function[pre,Union[Flatten[ReplaceList[#,rerules]&/@pre,1]]],forms],1]];
    nexos[ptn_]:=If[Length[ptn]==0,{0},Union@@Select[ReplaceListRepeated[{Sort[ptn]},{{foe___,x_,mie___,y_,afe___}:>Sort[Append[{foe,mie,afe},x+y]],{foe___,x_,mie___,y_,afe___}:>Sort[Append[{foe,mie,afe},x*y]]}],Length[#]==1&]];
    Table[Total[Length/@nexos/@IntegerPartitions[n]],{n,20}]

A319913 Number of distinct integer partitions whose parts can be combined together using additions and multiplications to obtain n, with the exception that 1's can only be added and not multiplied with other parts.

Original entry on oeis.org

1, 2, 3, 5, 7, 16, 20, 37, 53, 81, 107, 177, 227, 332, 449, 647, 830, 1162, 1480, 2032, 2597, 3447, 4348, 5775, 7251, 9374, 11758, 15026, 18640, 23688, 29220, 36771, 45128, 56168, 68674, 85015, 103394, 126923, 153871, 187911, 226653
Offset: 1

Views

Author

Gus Wiseman, Oct 01 2018

Keywords

Comments

All parts of the integer partition must be used in such a combination.

Examples

			The a(7) = 20 partitions (which are not all partitions of 7):
  (7),
  (61), (52), (43),
  (511), (321), (421), (331), (322),
  (3111), (4111), (2211), (3211), (2221),
  (21111), (31111), (22111),
  (111111), (211111),
  (1111111).
This list contains (2211) because we can write 7 = (2+1)*2+1. It contains (321) because we can write 7 = 3*2+1, even though the sum of parts is only 6.
		

Crossrefs

Formula

a(n) >= A000041(n).
a(n) >= A001055(n).

Extensions

a(13)-a(41) from Charlie Neder, Jun 02 2019

A009490 Number of distinct orders of permutations of n objects; number of nonisomorphic cyclic subgroups of symmetric group S_n.

Original entry on oeis.org

1, 1, 2, 3, 4, 6, 6, 9, 11, 14, 16, 20, 23, 27, 31, 35, 43, 47, 55, 61, 70, 78, 88, 98, 111, 123, 136, 152, 168, 187, 204, 225, 248, 271, 296, 325, 356, 387, 418, 455, 495, 537, 581, 629, 678, 732, 787, 851, 918, 986, 1056, 1133, 1217, 1307, 1399, 1498, 1600, 1708, 1823
Offset: 0

Views

Author

Keywords

Comments

Also number of different LCM's of partitions of n.
a(n) <= A023893(n), which counts the nonisomorphic Abelian subgroups of S_n. - M. F. Hasler, May 24 2013

Crossrefs

Cf. A051613 (first differences), A000792, A000793, A034891, A051625 (all cyclic subgroups), A256067.

Programs

  • Maple
    b:= proc(n,i) option remember; local p;
          p:= `if`(i<1, 1, ithprime(i));
          `if`(n=0 or i<1, 1, b(n, i-1)+
          add(b(n-p^j, i-1), j=1..ilog[p](n)))
        end:
    a:= n-> b(n, numtheory[pi](n)):
    seq(a(n), n=0..100);  # Alois P. Heinz, Feb 15 2013
  • Mathematica
    Table[ Length[ Union[ Apply[ LCM, Partitions[ n ], 1 ] ] ], {n, 30} ]
    f[n_] := Length@ Union[LCM @@@ IntegerPartitions@ n]; Array[f, 60, 0]
    (* Caution, the following is Extremely Slow and Resource Intensive *) CoefficientList[ Series[ Expand[ Product[1 + Sum[x^(Prime@ i^k), {k, 4}], {i, 10}]/(1 - x)], {x, 0, 30}], x]
    b[n_, i_] := b[n, i] = Module[{p}, p = If[i<1, 1, Prime[i]]; If[n == 0 || i<1, 1, b[n, i-1]+Sum[b[n-p^j, i-1], {j, 1, Log[p, n]}]]]; a[n_] := b[n, PrimePi[n]]; Table[a[n], {n, 0, 100}] (* Jean-François Alcover, Feb 03 2014, after Alois P. Heinz *)
  • PARI
    /* compute David W. Wilson's g.f., needs <1 sec for 1000 terms */
    N=1000;  x='x+O('x^N); /* N terms */
    gf=1; /* generating function */
    { forprime(p=2,N,
        sm = 1;  pp=p;  /* sum;  prime power */
        while ( ppJoerg Arndt, Jan 19 2011 */

Formula

a(n) = Sum_{k=0..n} b(k), where b(k) is the number of partitions of k into distinct prime power parts (1 excluded) (A051613). - Vladeta Jovovic
G.f.: (Product_{p prime} (1 + Sum_{k >= 1} x^(p^k))) / (1-x). - David W. Wilson, Apr 19 2000
Previous Showing 11-20 of 86 results. Next