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: Marc LeBrun

Marc LeBrun's wiki page.

Marc LeBrun has authored 294 sequences. Here are the ten most recent ones:

A360443 Smallest integer m > n such that the multiset of nonzero decimal digits of m is exactly the same as the multiset of nonzero decimal digits of n.

Original entry on oeis.org

10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 101, 21, 31, 41, 51, 61, 71, 81, 91, 200, 102, 202, 32, 42, 52, 62, 72, 82, 92, 300, 103, 203, 303, 43, 53, 63, 73, 83, 93, 400, 104, 204, 304, 404, 54, 64, 74, 84, 94, 500, 105, 205, 305, 405, 505, 65, 75, 85, 95, 600
Offset: 1

Author

Marc LeBrun and M. F. Hasler, Feb 22 2023

Keywords

Comments

Equivalently: a(n) is the number whose decimal digits are the next larger permutation of those of n, allowing any number of leading zeros.

Crossrefs

Cf. A057168 (analog for base 2), A354049 (digits of a(n) contain those of n as sub-multiset).
Cf. A009994 (numbers with digits in nondecreasing order: don't appear in this sequence).

Programs

  • PARI
    A360443(n)={forperm(concat(0,digits(n)),p,n||return(fromdigits(Vec(p))); n=0)} \\ M. F. Hasler, Feb 23 2023; similar idea also suggested by Ruud H.G. van Tol.
    
  • Python
    # From Arthur O'Dwyer, edited by M. F. Hasler, Feb 22 2023
    def A360443(n):
        s = '0' + str(n)
        i = next(i for i in range(len(s) - 1, 0, -1) if s[i-1] < s[i])
        tail = s[i-1:]
        j = min((ch, j) for j, ch in enumerate(tail) if s[i-1] < ch)[1]
        s = s[:i-1] + tail[j] + ''.join(sorted(tail[:j] + tail[j+1:]))
        return int(s)
    for n in range(1, 100): print(n, A360443(n))

A339597 When 2*n+1 first appears in A086799.

Original entry on oeis.org

1, 2, 5, 4, 9, 10, 13, 8, 17, 18, 21, 20, 25, 26, 29, 16, 33, 34, 37, 36, 41, 42, 45, 40, 49, 50, 53, 52, 57, 58, 61, 32, 65, 66, 69, 68, 73, 74, 77, 72, 81, 82, 85, 84, 89, 90, 93, 80, 97, 98, 101, 100, 105, 106, 109, 104, 113, 114, 117, 116, 121, 122, 125, 64, 129, 130, 133, 132, 137
Offset: 0

Author

Marc LeBrun and N. J. A. Sloane, Jan 06 2021

Keywords

Crossrefs

Cf. A086799, A091072 (terms sorted), A129760.

Programs

  • Maple
    N := 127: # for a(0) to a(N)
    V := Array(0..N): count := 0:
    for i from 1 while count < N+1 do
      with(MmaTranslator[Mma]):
      f(i) := BitOr(i,i-1);
      v := (f(i)-1)/2;
      if v <= N and V[v] = 0 then count := count+1; V[v] := i fi
    od:
    convert(V,list); # Robert Israel, Jan 07 2021
  • PARI
    f(n) = bitor(n, n-1); \\ A086799
    a(n) = my(k=1); while (f(k) != 2*n+1, k++); k; \\ Michel Marcus, Jan 07 2021
    
  • PARI
    a(n) = n++; n<<1 - 1<Kevin Ryde, Mar 29 2021
    
  • Python
    def A339597(n): return ((m:=n+1)<<1)-(m&-m) # Chai Wah Wu, Sep 01 2023

Formula

a(n) = 2*(n+1) - A006519(n+1) = n+1 with a 0 bit inserted above its least significant 1-bit. - Kevin Ryde, Mar 29 2021
a(n) = A129760(n+1) + n+1. - Christian Krause, May 05 2021

A338364 a(n) = Product_{k=1..n} phi(prime(k)-1).

Original entry on oeis.org

1, 1, 1, 2, 4, 16, 64, 512, 3072, 30720, 368640, 2949120, 35389440, 566231040, 6794772480, 149484994560, 3587639869440, 100453916344320, 1607262661509120, 32145253230182400, 771486077524377600, 18515665860585062400, 444375980654041497600, 17775039226161659904000
Offset: 0

Author

Marc LeBrun and N. J. A. Sloane, Nov 04 2020

Keywords

Examples

			a(5) = phi(1)*phi(2)*phi(4)*phi(6)*phi(10) = 1*1*2*2*4 = 16.
		

Crossrefs

Programs

  • Maple
    with(NumberTheory);
    f:=n->mul(phi(ithprime(k)-1),k=1..n);
    [seq(f(n),n=1..32)];
  • PARI
    a(n) = prod(k=1, n, eulerphi(prime(k)-1)); \\ Michel Marcus, Nov 04 2020

A260798 Number of partitions of p=prime(n) into aliquant parts (i.e., parts that do not divide p, meaning any part except 1 and p).

Original entry on oeis.org

0, 0, 1, 3, 13, 23, 65, 104, 252, 846, 1237, 3659, 7244, 10086, 19195, 48341, 116599, 155037, 356168, 609236, 792905, 1716485, 2832213, 5887815, 15116625, 23911833, 29983570, 46873052, 58443395, 90374471, 394641602, 593224103, 1082063335, 1318608063, 3477935702, 4207389268, 7398721009, 12885091292, 18555597522, 31831360281, 54145147464, 64517020844
Offset: 1

Author

Marc LeBrun and N. J. A. Sloane, Aug 07 2015

Keywords

Examples

			For n=4, the fourth prime is 7, and we see the three partitions 7=2+5=2+2+3=3+4, so a(4)=3.
		

Crossrefs

This is A098743(prime(n)). Cf. A260797.

Programs

  • Haskell
    import Data.MemoCombinators (memo2, integral)
    a260798 n = a260798_list !! (n-1)
    a260798_list = map (subtract 1 . pMemo 2) a000040_list where
       pMemo = memo2 integral integral p
       p _ 0 = 1
       p k m | m < k     = 0
             | otherwise = pMemo k (m - k) + pMemo (k + 1) m
    -- Reinhard Zumkeller, Aug 09 2015
  • Maple
    b:= proc(n, i) option remember; `if`(n=0 or i=2, 1-irem(n, 2),
          `if`(i<2, 0, b(n, i-1)+b(n-i, min(i, n-i))))
        end:
    a:= n-> (p-> b(p, p-1))(ithprime(n)):
    seq(a(n), n=1..45);  # Alois P. Heinz, Mar 11 2018
  • Mathematica
    b[n_, i_] := b[n, i] = If[n == 0 || i == 2, 1 - Mod[n, 2], If[i < 2, 0, b[n, i - 1] + b[n - i, Min[i, n - i]]]];
    a[n_] := b[#, # - 1]&[Prime[n]];
    Table[a[n], {n, 1, 45}] (* Jean-François Alcover, May 20 2018, after Alois P. Heinz *)

A260797 Number of partitions of n! into aliquant parts (i.e., parts that do not divide n!).

Original entry on oeis.org

0, 0, 0, 10, 48474, 58200700681501904, 575117027557118268946825316636815769400417697019505807
Offset: 1

Author

Marc LeBrun and N. J. A. Sloane, Aug 07 2015

Keywords

Crossrefs

This is A098743(n!). Cf. A260798.

Programs

Extensions

a(6) and a(7) by Reinhard Zumkeller, Aug 08 2015

A241918 Table of partitions where the ordering is based on the modified partial sums of the exponents of primes in the prime factorization of n.

Original entry on oeis.org

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

Author

Antti Karttunen, May 03 2014, based on Marc LeBrun's Jan 11 2006 message on SeqFan mailing list

Keywords

Comments

a(1) = 0 by convention (stands for an empty partition).
For n >= 2, A203623(n-1)+2 gives the index to the beginning of row n and for n>=1, A203623(n)+1 is the index to the end of row n.

Examples

			Table begins:
Row     Partition
[ 1]    0;         (stands for empty partition)
[ 2]    1;         (as 2 = 2^1)
[ 3]    1,1;       (as 3 = 2^0 * 3^1)
[ 4]    2;         (as 4 = 2^2)
[ 5]    1,1,1;     (as 5 = 2^0 * 3^0 * 5^1)
[ 6]    2,2;       (as 6 = 2^1 * 3^1)
[ 7]    1,1,1,1;   (as 7 = 2^0 * 3^0 * 5^0 * 7^1)
[ 8]    3;         (as 8 = 2^3)
[ 9]    1,2;       (as 9 = 2^0 * 3^2)
[10]    2,2,2;     (as 10 = 2^1 * 3^0 * 5^1)
[11]    1,1,1,1,1;
[12]    3,3;
[13]    1,1,1,1,1,1;
[14]    2,2,2,2;
[15]    1,2,2;     (as 15 = 2^0 * 3^1 * 5^1)
[16]    4;
[17]    1,1,1,1,1,1,1;
[18]    2,3;       (as 18 = 2^1 * 3^2)
etc.
If n is 2^k (k>=1), then the partition is a singleton {k}, otherwise, add one to the exponent of 2 (= A007814(n)), and subtract one from the exponent of the greatest prime dividing n (= A071178(n)), leaving the intermediate exponents as they are, and then take partial sums of all, thus resulting for e.g. 15 = 2^0 * 3^1 * 5^1 the modified sequence of exponents {0+1, 1, 1-1} -> {1,1,0}, whose partial sums {1,1+1,1+1+0} -> {1,2,2} give the corresponding partition at row 15.
		

Crossrefs

For n>=2, the length of row n is given by A061395(n).
Cf. also A067255, A203623, A241914.
Other tables of partitions: A112798 (also based on prime factorization), A227739, A242628 (encoded in the binary representation of n), and A036036-A036037, A080576-A080577, A193073 for various lexicographical orderings.
Permutation A241909 maps between order of partitions employed here, and the order employed in A112798.
Permutation A122111 is induced when partitions in this list are conjugated.
A241912 gives the row numbers for which the corresponding rows in A112798 and here are the conjugate partitions of each other.

Programs

  • Mathematica
    Table[If[n == 1, {0}, Function[s, Function[t, Accumulate[If[Length@ t < 2, {0}, Join[{1}, ConstantArray[0, Length@ t - 2], {-1}]] + ReplacePart[t, Map[#1 -> #2 & @@ # &, s]]]]@ ConstantArray[0, Transpose[s][[1, -1]]]][FactorInteger[n] /. {p_, e_} /; p > 0 :> {PrimePi@ p, e}]], {n, 31}] // Flatten (* Michael De Vlieger, May 12 2017 *)

Formula

If A241914(n)=0 and A241914(n+1)=0, a(n) = A067255(n); otherwise, if A241914(n)=0 and A241914(n+1)>0, a(n) = A067255(n)+1; otherwise, if A241914(n)>0 and A241914(n+1)=0, a(n) = a(n-1) + A067255(n) - 1, otherwise, when A241914(n)>0 and A241914(n+1)>0, a(n) = a(n-1) + A067255(n).

A241909 Self-inverse permutation of natural numbers: a(1)=1, a(p_i) = 2^i, and if n = p_i1 * p_i2 * p_i3 * ... * p_{ik-1} * p_ik, where p's are primes, with their indexes are sorted into nondescending order: i1 <= i2 <= i3 <= ... <= i_{k-1} <= ik, then a(n) = 2^(i1-1) * 3^(i2-i1) * 5^(i3-i2) * ... * p_k^(1+(ik-i_{k-1})). Here k = A001222(n) and ik = A061395(n).

Original entry on oeis.org

1, 2, 4, 3, 8, 9, 16, 5, 6, 27, 32, 25, 64, 81, 18, 7, 128, 15, 256, 125, 54, 243, 512, 49, 12, 729, 10, 625, 1024, 75, 2048, 11, 162, 2187, 36, 35, 4096, 6561, 486, 343, 8192, 375, 16384, 3125, 50, 19683, 32768, 121, 24, 45, 1458, 15625, 65536, 21, 108, 2401
Offset: 1

Author

Antti Karttunen, May 03 2014, partly inspired by Marc LeBrun's Jan 11 2006 message on SeqFan mailing list

Keywords

Comments

This permutation maps between the partitions as ordered in A112798 and A241918 (the original motivation for this sequence).
For all n > 2, A007814(a(n)) = A055396(n)-1, which implies that this self-inverse permutation maps between primes (A000040) and the powers of two larger than one (A000079(n>=1)), and apart from a(1) & a(2), this also maps each even number to some odd number, and vice versa, which means there are no fixed points after 2.
A122111 commutes with this one, that is, a(n) = A122111(a(A122111(n))).
Conjugates between A243051 and A242424 and other rows of A243060 and A243070.

Examples

			For n = 12 = 2 * 2 * 3 = p_1 * p_1 * p_2, we obtain by the first formula 2^(1-1) * 3^(1-1) * 5^(1+(2-1)) = 5^2 = 25. By the second formula, as n = 2^2 * 3^1, we obtain the same result, p_{1+2} * p_{2+1} = p_3 * p_3 = 25, thus a(12) = 25.
Using the product formula over the terms of row n of table A241918, we see, because 9450 = 2*3*3*3*5*5*7 = p_1^1 * p_2^3 * p_3^2 * p_4^1, that the corresponding row in A241918 is {2,5,7,7}, and multiplying p_2 * p_5 * p_7^2 yields 3 * 11 * 17 * 17 = 9537, thus a(9450) = 9537.
Similarly, for 9537, the corresponding row in A241918 is {1,2,2,2,3,3,4}, and multiplying p_1^1 * p_2^3 * p_3^2 * p_4^1, we obtain 9450 back.
		

Crossrefs

Cf. also A278220 (= A046523(a(n))), A331280 (its rgs_transform), A331299 (= min(n,a(n))).
{A000027, A122111, A241909, A241916} form a 4-group.

Programs

  • Haskell
    a241909 1 = 1
    a241909 n = product $ zipWith (^) a000040_list $ zipWith (-) is (1 : is)
                where is = reverse ((j + 1) : js)
                      (j:js) = reverse $ map a049084 $ a027746_row n
    -- Reinhard Zumkeller, Aug 04 2014
    
  • Mathematica
    Array[If[# == 1, 1, Function[t, Times @@ Prime@ Accumulate[If[Length@ t < 2, {0}, Join[{1}, ConstantArray[0, Length@ t - 2], {-1}]] + ReplacePart[t, Map[#1 -> #2 & @@ # &, #]]]]@ ConstantArray[0, Transpose[#][[1, -1]]] &[FactorInteger[#] /. {p_, e_} /; p > 0 :> {PrimePi@ p, e}]] &, 56] (* Michael De Vlieger, Jan 23 2020 *)
  • PARI
    A241909(n) = if(1==n||isprime(n),2^primepi(n),my(f=factor(n),h=1,i,m=1,p=1,k=1); while(k<=#f~, p = nextprime(1+p); i = primepi(f[k,1]); m *= p^(i-h); h = i; if(f[k,2]>1, f[k,2]--, k++)); (p*m)); \\ Antti Karttunen, Jan 17 2020

Formula

If n is a prime with index i (p_i), then a(n) = 2^i, otherwise when n = p_i1 * p_i2 * p_i3 * ... p_ik, where p_i1, p_i2, p_i3, ..., p_ik are the primes present (not necessarily all distinct) in the prime factorization of n, sorted into nondescending order, a(n) = 2^(i1-1) * 3^(i2-i1) * 5^(i3-i2) * ... * p_k^(1+(ik-i_{k-1})).
Equally, if n = 2^k, then a(n) = p_k, otherwise, when n = 2^e1 * 3^e2 * 5^e3 * ... * p_k^{e_k}, i.e., where e1 ... e_k are the exponents (some of them possibly zero, except the last) of the primes 2, 3, 5, ... in the prime factorization of n, a(n) = p_{1+e1} * p_{1+e1+e2} * p_{1+e1+e2+e3} * ... * p_{e1+e2+e3+...+e_k}.
From the equivalence of the above two formulas (which are inverses of each other) it follows that a(a(n)) = n, i.e., that this permutation is an involution. For a proof, please see the attached notes.
The first formula corresponds to this recurrence:
a(1) = 1, a(p_k) = 2^k for primes with index k, otherwise a(n) = (A000040(A001222(n))^(A241917(n)+1)) * A052126(a(A052126(n))).
And the latter formula with this recurrence:
a(1) = 1, and for n>1, if n = 2^k, a(n) = A000040(k), otherwise a(n) = A000040(A001511(n)) * A242378(A007814(n), a(A064989(n))).
[Here A242378(k,n) changes each prime p(i) in the prime factorization of n to p(i+k), i.e., it's the result of A003961 iterated k times starting from n.]
We also have:
a(1)=1, and for n>1, a(n) = Product_{i=A203623(n-1)+2..A203623(n)+1} A000040(A241918(i)).
For all n >= 1, A001222(a(n)) = A061395(n), and vice versa, A061395(a(n)) = A001222(n).
For all n > 1, a(2n-1) = 2*a(A064216(n)).

Extensions

Typos in the name corrected by Antti Karttunen, May 31 2014

A193622 Integers originally used as card values in Planning Poker.

Original entry on oeis.org

1, 2, 3, 5, 7, 10
Offset: 1

Author

Marc LeBrun, Jul 31 2011

Keywords

Comments

"infinity" was also included. Planning Poker is an estimation technique used in the "agile scrum" software development methodology. Original deck used these values; subsequent commercial decks often use different values.

Crossrefs

Cf. A193616.

A193616 Integers often used as card values in Planning Poker decks.

Original entry on oeis.org

0, 1, 2, 3, 5, 8, 13, 20, 40, 100
Offset: 1

Author

Marc LeBrun, Jul 31 2011

Keywords

Comments

Non-integer values may include "1/2", "?", "infinity" and "coffee cup". Planning Poker is an estimation technique used in the "agile scrum" software development methodology; card decks with these values are commercially available (original decks used different values). Sometimes called "Modified Fibonacci Sequence".

Crossrefs

A190592 Maximal digit in base-3 expansion of n.

Original entry on oeis.org

0, 1, 2, 1, 1, 2, 2, 2, 2, 1, 1, 2, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 2, 1, 1, 2, 2, 2, 2, 1, 1, 2, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 2, 1, 1, 2, 2, 2, 2, 1, 1, 2, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2
Offset: 0

Author

N. J. A. Sloane, May 13 2011, based on a suggestion from Marc LeBrun

Keywords

Crossrefs

Programs

  • Maple
    [seq(max(convert(n,base,3)),n=0..120)];
  • Mathematica
    Join[{0}, gl[n_] := Module[{idn = IntegerDigits[n, 3]}, Max[idn]]; Array[gl,100]] (* Vincenzo Librandi, Aug 12 2017 *)
  • PARI
    a(n) = if (n==0, 0, vecmax(digits(n, 3))); \\ Michel Marcus, Aug 12 2017

Formula

a(n) = 2 if n == 2 (mod 3), a(1)=1, otherwise a(n) = a(floor(n/3)). - Robert Israel, Aug 11 2017
a(n) = A054055(A007089(n)). - Felix Fröhlich, Aug 13 2017