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.

A361376 Rewrite A129912(n), a product of distinct primorials P(i) = A002110(i) instead as a sum of powers 2^(i-1).

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 8, 7, 9, 10, 16, 11, 17, 12, 13, 18, 19, 32, 14, 33, 20, 15, 21, 34, 35, 22, 24, 64, 23, 36, 25, 65, 37, 26, 66, 38, 27, 67, 40, 128, 39, 41, 28, 68, 129, 29, 69, 42, 130, 48, 43, 30, 70, 72, 131, 49, 31, 71, 44, 73, 256, 132, 45, 50, 257, 133, 74, 51, 46, 80, 75, 258, 134, 136
Offset: 1

Views

Author

Michael De Vlieger, Jun 08 2023

Keywords

Comments

Permutation of nonnegative numbers.

Examples

			a(1) = 0 by convention.
a(8) = 8 comes before a(9) = 7, since we interpret 8 = 2^3 instead as P(4) = 210, while for a(9), 7 = 2^2 + 2^1 + 2^0 becomes P(3)*P(2)*P(1) = 30*6*2 = 360. Because 210 < 360, 8 appears before 7 in this sequence.
Table relating a(n), n=1..19 with the set S(n) of indices of distinct primorial factors of A129912(n):
   n A129912(n)  S(n)   a(n)  A272011(a(n))
  -----------------------------------------
   1         1            0
   2         2   1        1   0
   3         6   2        2   1
   4        12   2,1      3   1,0
   5        30   3        4   2
   6        60   3,1      5   2,0
   7       180   3,2      6   2,1
   8       210   4        8   3
   9       360   3,2,1    7   2,1,0
  10       420   4,1      9   3,0
  11      1260   4,2     10   3,1
  12      2310   5       16   4
  13      2520   4,2,1   11   3,1,0
  14      4620   5,1     17   4,0
  15      6300   4,3     12   3,2
  16     12600   4,3,1   13   3,2,0
  17     13860   5,2     18   4,1
  18     27720   5,2,1   19   4,1,0
  19     30030   6       32   5
  ...
		

Crossrefs

Programs

  • Mathematica
    a6939[n_] := Product[Prime[n + 1 - i]^i, {i, n}];
    g[m_] := Block[{f, j = 1},
      f[n_, i_, e_] :=
       If[n < m, Block[{p = Prime[i + 1]}, If[e == 1, Sow@ n];
         f[n p^e, i + 1, e];
         If[e > 1, f[n p^(e - 1), i + 1, e - 1]]]];
      Sort@ Reap[While[a6939[j] < m, f[2^j, 1, j]; j++]][[-1, 1]] ];
    Map[Total@
         Map[2^(# - 1) &,
          Table[LengthWhile[#1, # >= j &], {j, #2}] & @@ {#, Max[#]} ] &[
    FactorInteger[#][[All, -1]]] &, g[2^31]] (* Michael De Vlieger, Jun 08 2023, after Giovanni Resta at A129929 *)

Formula

Let S(n) be the set of indices of primorials P(i), reverse sorted, such that A129912(n) = Product_{k=1..m} S(n,k), where m = | S(n) |. Then a(n) = Sum_{k=1..m} 2^(S(n,k)-1).