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-4 of 4 results.

A307544 Irregular triangle read by rows: T(n,k) = A087207(A307540(n,k)).

Original entry on oeis.org

0, 1, 3, 2, 7, 5, 6, 4, 15, 11, 13, 9, 14, 10, 12, 8, 31, 23, 27, 19, 29, 21, 25, 30, 17, 22, 26, 18, 28, 20, 24, 16, 63, 47, 55, 59, 39, 43, 51, 61, 35, 45, 53, 57, 37, 62, 41, 49, 46, 54, 33, 58, 38, 42, 50, 60, 34, 44, 52, 56, 36, 40, 48, 32, 127, 95, 111, 119
Offset: 0

Views

Author

Michael De Vlieger, Apr 19 2019

Keywords

Comments

Let gpf(m) = A006530(m) and let phi(m) = A000010(m) for m in A005117.
Row n contains m in A005117 such that A006530(m) = n, sorted such that phi(m)/m increases as k increases.
Let m be the squarefree kernel A007947(m') of m'. We only consider squarefree m since phi(m)/m = phi(m')/m'. Let prime p | n and prime q be a nondivisor of n.
Since m is squarefree, we might encode the multiplicities of its prime divisors in a positional notation M that is finite at n significant digits. For example, m = 42 can be encoded reverse(A067255(42)) = 1,0,1,1 = 7^1 * 5^0 * 3^1 * 2^1. It is necessary to reverse row m of A067255 (hereinafter simply A067255(m)) so as to preserve zeros in M = A067255(m) pertaining to small nondivisor primes q < p. The code M is a series of 0's and 1's since m is squarefree. Then it is clear that row n contains all m such that A067255(m) has n terms, and there are 2^(n - 1) possible terms for n >= 1.
We may use an approach that generates the binary expansion of the range 2^(n - 1) < M < 2^n - 1, or we may append 1 to the reversed (n - 1)-tuples of {1, 0} (as A059894) to achieve codes M -> m for each row n.
Originally it was thought that the codes M were in order of the latter algorithm, and we could avoid sorting. Observation shows that the m still require sorting by the function phi(m)/m indeed to be in increasing order in row n. Still, the latter approach is slightly more efficient than the former in generating the sequence.
This sequence interprets the code M as a binary value. The sequence is a permutation of the natural numbers since the ratio phi(m)/m is unique for squarefree m.
This sequence and A059894 are identical for 1 <= n <= 23.
Numbers of terms in rows n of this sequence and A059894 (partitioned by powers of 2) that are coincident: 1, 2, 4, 8, 14, 14, 10, 26, 14, 20, 10, 16, 22, 12, 18, 18, 16, 14, 18, 18, 18, 14, 16, ...}.
The graphs of this sequence and A059894 are similar.
The graph of this sequence feature squares of size 2^(j-1) at (x,y) = (h,h) where h = 2^j, integers, that have pi-radian rotational symmetry.

Examples

			First terms of this sequence appear bottom to top in the chart below. The values of n appear in the header, values m = T(n,k) followed parenthetically by phi(m)/m appear in column n. In square brackets, we write the multiplicities of primes in positional order with the smallest prime at right (big-endian). The x axis plots k according to primepi(gpf(m)), while the y axis plots k according to phi(m)/m:
    0       1          2             3             4
    .       .          .             .             .
--- 1 ------------------------------------------------
  (1/1)     .          .             .             .
   [0]      .          .             .             .
    .       .          .             .             .
    .       .          .             .             7
    .       .          .             5           (6/7)
    .       .          .           (4/5)        [1000]
    .       .          .           [100]           .
    .       .          .             .            35
    .       .          3             .          (24/35)
    .       .        (2/3)           .          [1100]
    .       .        [10]            .             .
    .       .          .             .             .
    .       .          .             .            21
    .       .          .             .           (4/7)
    .       .          .            15          [1010]
    .       .          .          (8/15)           .
    .       2          .           [110]           .
    .     (1/2)        .             .             .
    .      [1]         .             .            105
    .       .          .             .          (16/35)
    .       .          .             .          [1110]
    .       .          .             .            14
    .       .          .            10           (3/7)
    .       .          .           (2/5)        [1001]
    .       .          .           [101]           .
    .       .          .             .            70
    .       .          6             .          (12/35)
    .       .        (1/3)           .          [1101]
    .       .        [11]            .            42
    .       .          .            30           (2/7)
    .       .          .          (4/15)        [1011]
    .       .          .           [111]          210
    .       .          .             .           (8/35)
    .       .          .             .          [1111]
...
a(1) = 0 since T(0,1) = 1 = empty product.
a(2) = 1 since T(1,1) = 2 = 2^1 -> binary "1" = decimal 1.
a(3) = 3 since T(2,1) = 6 = 2^1 * 3^1 -> binary "11" = decimal 3.
a(4) = 2 since T(2,2) = 3 = 2^0 * 3^1 -> binary "10" = decimal 2.
a(5) = 7 since T(3,1) = 30 = 2^1 * 3^1 * 5^1 -> binary "111" = decimal 7, etc.
Graph of first 32 terms: (Start)
              x
                       x
                   x
                           x
                 x
                         x
                     x
                x
                             x
                        x
                    x
                            x
                  x
                          x
                      x
                              x
       x
           x
         x
             x
        x
            x
          x
              x
   x
     x
    x
      x
x
  x
x
(End)
From _Antti Karttunen_, Jan 10 2020: (Start)
Arranged as a binary tree:
                                       0
                                       |
                    ...................1...................
                   3                                       2
         7......../ \........5                   6......../ \........4
        / \                 / \                 / \                 / \
       /   \               /   \               /   \               /   \
      /     \             /     \             /     \             /     \
    15       11         13       9          14       10         12       8
  31  23   27  19     29  21   25 30      17  22   26  18     28  20   24 16
etc.
(End)
		

Crossrefs

Programs

  • Mathematica
    Prepend[Array[SortBy[#, Last] &@ Map[{#2, EulerPhi[#1]/#1} & @@ {Times @@  MapIndexed[Prime[First@ #2]^#1 &, Reverse@ #], FromDigits[#, 2]} &, Map[Prepend[Reverse@ #, 1] &, Tuples[{1, 0}, # - 1]]] &, 7], {{0, 0, 1}}][[All, All, 1]] // Flatten
  • PARI
    up_to = 1023;
    rat(n) = { my(m=1, p=2); while(n, if(n%2, m *= (p-1)/p); n >>= 1; p = nextprime(1+p)); (m); };
    cmpA307544(a,b) = if(!a,sign(-b),if(!b,sign(a), my(as=logint(a,2), bs=logint(b,2)); if(as!=bs, sign(as-bs), sign(rat(a)-rat(b)))));
    A307544list(up_to) = vecsort(vector(1+up_to,n,n-1), cmpA307544);
    v307544 = A307544list(up_to);
    A307544(n) = v307544[1+n]; \\ Antti Karttunen, Jan 10 2020

Formula

For n > 0, row lengths = 2^(n - 1).
T(n,1) = 2^n - 1 = A000225(n).
T(n,2^(n - 1)) = 2^(n - 1).

A325236 Squarefree k such that phi(k)/k - 1/2 is positive and minimal for k with gpf(k) = prime(n).

Original entry on oeis.org

1, 2, 3, 15, 21, 231, 273, 255, 285, 167739, 56751695, 7599867, 3829070245, 567641679, 510795753, 39169969059, 704463969, 3717740976339, 42917990271, 547701649495, 45484457928390429, 59701280265935165
Offset: 0

Views

Author

Michael De Vlieger, Apr 19 2019

Keywords

Comments

Let gpf(k) = A006530(k) and let phi(n) = A000010(n) for k in A005117.
There are 2^(n-1) numbers k with gpf(k) = prime(n), since we can only either have p_i^0 or p_i^1 where p_i | k and i <= n. For example, for n = 2, there are only 2 squarefree numbers k with prime(2) = 3 as greatest prime factor. These are 3 = 2^0 * 3^1, and 6 = 2^1 * 3^1. We observe that we can write multiplicities of the primes as A067255(k), and thus for the example derive 3 = "0,1" and 6 = "1,1". Thus for n = 3, we have 5 = "0,0,1", 15 = "0,1,1", 10 = "1,0,1", and 30 = "1,1,1". This establishes the possible values of k with respect to n. We choose the value of k in n for which phi(k)/k - 1/2 is positive and minimal.
We know that prime k (in A000040) have phi(k)/k = A006093(n)/A000040(n) and represent maxima in n. We likewise know primorials k (in A002110) have phi(k)/k = A038110(n)/A060753(n) and represent minima in n. This sequence shows squarefree numbers k with gpf(k) = n such that their value phi(k)/k is closest to but more than 1/2.
Apart from a(1) = 2, all terms are odd. For n > 1 and k even, phi(k)/k - 1/2 is negative.

Examples

			First terms of this sequence appear in the chart below between asterisks.
The values of n appear in the header, values of k followed parenthetically by phi(k)/k appear in column n. The x axis plots k according to primepi(gpf(k)), while the y axis plots k according to phi(k)/k:
    0       1          2             3             4
    .       .          .             .             .
-- *1* -----------------------------------------------
  (1/1)     .          .             .             .
    .       .          .             .             .
    .       .          .             .             .
    .       .          .             .             7
    .       .          .             5           (6/7)
    .       .          .           (4/5)           .
    .       .          .             .             .
    .       .          .             .            35
    .       .         *3*            .          (24/35)
    .       .        (2/3)           .             .
    .       .          .             .             .
    .       .          .             .             .
    .       .          .             .           *21*
    .       .          .             .           (4/7)
    .       .          .           *15*            .
    .       .          .          (8/15)           .
    .      *2*         .             .             .
----------(1/2)---------------------------------------
    .       .          .             .             .
    .       .          .             .            105
    .       .          .             .          (16/35)
    .       .          .             .            14
    .       .          .            10           (3/7)
    .       .          .           (2/5)           .
    .       .          .             .             .
    .       .          .             .            70
    .       .          6             .          (12/35)
    .       .        (1/3)           .             .
    .       .          .             .            42
    .       .          .            30           (2/7)
    .       .          .          (4/15)           .
    .       .          .             .            210
    .       .          .             .           (8/35)
...
a(3) = 15 for the following reasons. There are 4 possible values of k with n = 3. These are 5, 15, 10, and 30 with phi(k)/k = 4/5, 8/15, 2/5, and 4/15, respectively. Subtracting 1/2 from each of the latter values, we derive 3/10, 1/30, -1/10, and -7/30 respectively. Since the smallest of these differences is 3/10 pertaining to k = 15, a(3) = 15.
		

Crossrefs

Programs

  • Mathematica
    With[{e = 15}, Map[MinimalBy[#, If[# < 0, # + 1, #] &[#[[2]] - 1/2] &] &, SplitBy[#, Last]] &@ Array[{#2, EulerPhi[#2]/#2, If[! IntegerQ@ #, 0, #] &[1 + Floor@ Log2@ #1]} & @@ {#, Times @@ MapIndexed[Prime[First@ #2]^#1 &, Reverse@ IntegerDigits[#, 2]]} &, 2^(e + 1), 0]][[All, 1, 1]]

A325237 Squarefree k such that 1/2 - phi(k)/k is positive and minimal for k with gpf(k) = prime(n).

Original entry on oeis.org

2, 6, 10, 105, 165, 195, 4641, 5187, 5313, 266133, 8870433, 3068957045, 11063481, 10164297, 667797009, 909411789, 32221169781185, 1963007211216415, 421522466365, 3012887561310445
Offset: 1

Views

Author

Michael De Vlieger, Apr 19 2019

Keywords

Comments

Let gpf(k) = A006530(k) and let phi(n) = A000010(n) for k in A005117. There are 2^(n-1) numbers k with gpf(k) = n, since we can only either have p_i^0 or p_i^1 where p_i | k and i <= n. For example, for n = 2, there are only 2 squarefree numbers k with prime(2) = 3 as greatest prime factor. These are 3 = 2^0 * 3^1, and 6 = 2^1 * 3^1. We observe that we can write multiplicities of the primes as A067255(k), and thus for the example derive 3 = "0,1" and 6 = "1,1". Thus for n = 3, we have 5 = "0,0,1", 15 = "0,1,1", 10 = "1,0,1", and 30 = "1,1,1". This establishes the possible values of k with respect to n. We choose the value of k in n for which 1/2 - phi(k)/k is positive and minimal.
We know that prime k (in A000040) have phi(k)/k = A006093(n)/A000040(n) and represent maxima in n. We likewise know primorials k (in A002110) have phi(k)/k = A038110(n)/A060753(n) and represent minima in n. This sequence shows squarefree numbers k with gpf(k) = n such that their value phi(k)/k is closest to but less than 1/2.
Conjecture: for n > 3, k is always odd. This assertion is reliant upon phi(2 prime(n))/2 prime(n) = phi(2)/2 * phi(prime(n))/prime(n) = 1/2 * (prime(n) - 1)/prime(n), and it is clear that 1/2 is an asymptote for even k.

Examples

			First terms of this sequence appear in the chart below between asterisks.
The values of n appear in the header, values of k followed parenthetically by phi(k)/k appear in column n. The x axis plots k according to primepi(gpf(k)), while the y axis plots k according to phi(k)/k:
    0       1          2             3             4
    .       .          .             .             .
--- 1 ------------------------------------------------
  (1/1)     .          .             .             .
    .       .          .             .             .
    .       .          .             .             .
    .       .          .             .             7
    .       .          .             5           (6/7)
    .       .          .           (4/5)           .
    .       .          .             .             .
    .       .          .             .            35
    .       .          3             .          (24/35)
    .       .        (2/3)           .             .
    .       .          .             .             .
    .       .          .             .             .
    .       .          .             .            21
    .       .          .             .           (4/7)
    .       .          .            15             .
    .       .          .          (8/15)           .
    .      *2*         .             .             .
----------(1/2)---------------------------------------
    .       .          .             .             .
    .       .          .             .           *105*
    .       .          .             .          (16/35)
    .       .          .             .            14
    .       .          .           *10*          (3/7)
    .       .          .           (2/5)           .
    .       .          .             .             .
    .       .          .             .            70
    .       .         *6*            .          (12/35)
    .       .        (1/3)           .             .
    .       .          .             .            42
    .       .          .            30           (2/7)
    .       .          .          (4/15)           .
    .       .          .             .            210
    .       .          .             .           (8/35)
...
a(3) = 10 for the following reasons. There are 4 possible values of k with n = 3. These are 5, 15, 10, and 30 with phi(k)/k = 4/5, 8/15, 2/5, and 4/15, respectively. Subtracting each of the latter values from 1/2, we derive -3/10, -1/30, 1/10, and 7/30 respectively. Since the smallest of these differences is 1/10 pertaining to k = 10, a(3) = 10.
		

Crossrefs

Programs

  • Mathematica
    With[{e = 20}, Map[MinimalBy[#, If[# > 0, # + 1, Abs@ #] &[#[[2]] - 1/2] &] &, SplitBy[#, Last]] &@ Array[{#2, EulerPhi[#2]/#2, If[! IntegerQ@ #, 0, #] &[1 + Floor@ Log2@ #1]} & @@ {#, Times @@ MapIndexed[Prime[First@ #2]^#1 &, Reverse@ IntegerDigits[#, 2]]} &, 2^e - 1]][[All, 1, 1]]

A359243 a(1) = 1, a(2) = 2; let j = a(n-1); for n > 2, if j is prime then a(n) = least novel k such that phi(k)/k < phi(j)/j, else a(n) = least novel k such that phi(k)/k > phi(j)/j, where phi(x) = A000010(x).

Original entry on oeis.org

1, 2, 6, 3, 4, 5, 8, 7, 9, 11, 10, 13, 12, 14, 15, 17, 16, 19, 18, 20, 21, 23, 22, 25, 29, 24, 26, 27, 31, 28, 32, 33, 35, 37, 30, 34, 38, 39, 41, 36, 40, 43, 42, 44, 45, 47, 46, 49, 53, 48, 50, 51, 55, 59, 52, 57, 61, 54, 56, 58, 62, 63, 65, 67, 60, 64, 69, 71
Offset: 1

Views

Author

Michael De Vlieger, Jan 16 2023

Keywords

Comments

Permutation of natural numbers.
Once we have a(n) = prime(m), we require a(n+1) = u, the smallest missing number. Thereafter, we find the smallest k new to the sequence such that phi(k)/k > phi(j)/j, where j = a(n-1) until we reach another prime. Primes appear in order, since phi(p)/p = (p-1)/p.
Sequence can be interpreted as an irregular triangle where row 0 = {1} and row m > 1 begins with prime(m). In such a triangle, we observe prime(m) > min(row m) for m > 5, yet we can find prime(m) either less than or exceeding max(row m) for 2^20 terms of this sequence, or m = 1..82032.
Since phi(k)/k ascribes to squarefree kernel K = rad(k) = A007947(k) and K < mK where mK is nonsquarefree yet rad(m) | K, squarefree k appear before mK. For example, a(3) = 6 and a(13) = 12; a(11) = 10 and a(20) = 20, etc.
Odd prime numbers tend to appear early, even numbers tend to appear late.

Examples

			Let f(x) = phi(x)/x.
a(3) = 6 since 2 is prime and f(k) >= f(2) = 1/2 for k in {3, 4, 5}.
a(4) = 3 since f(3) < f(6) = 1/3.
a(5) = 4 since 3 is prime and f(4) < f(3) = 2/3.
a(6) = 5 since f(5) > f(4) = 1/2.
a(7) = 8 since 5 is prime and f(7) >= f(5) = 4/5 but f(8) = 1/2 < 4/5, etc.
Sequence written as an irregular triangle where row 0 = {1} and row m starts with prime(m):
   1;
   2,  6;
   3,  4;
   5,  8;
   7,  9;
  11, 10;
  13, 12, 14, 15;
  17, 16;
  19, 18, 20, 21;
  23, 22, 25;
  29, 24, 26, 27;
  31, 28, 32, 33, 35; ...
		

Crossrefs

Programs

  • Mathematica
    nn = 120; c[] = False; f[n] := EulerPhi[n]/n; Array[Set[{a[#], c[#]}, {#, True}] &, 2]; j = a[2]; m = f[j]; u = 3; Do[k = u; If[PrimeQ[j], While[Nand[! c[k], f[k] < m], k++], While[Nand[! c[k], f[k] > m], k++]]; Set[{a[n], c[k], j, m}, {k, True, k, f[k]}]; If[k == u, While[c[u], u++]], {n, 3, nn}]; Array[a, nn]
Showing 1-4 of 4 results.