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

A340316 Square array A(n,k), n>=1, k>=1, read by antidiagonals, where row n is the increasing list of all squarefree numbers with n primes.

Original entry on oeis.org

2, 3, 6, 5, 10, 30, 7, 14, 42, 210, 11, 15, 66, 330, 2310, 13, 21, 70, 390, 2730, 30030, 17, 22, 78, 462, 3570, 39270, 510510, 19, 26, 102, 510, 3990, 43890, 570570, 9699690, 23, 33, 105, 546, 4290, 46410, 690690, 11741730, 223092870
Offset: 1

Views

Author

Peter Dolland, Jan 04 2021

Keywords

Comments

This is a permutation of all squarefree numbers > 1.

Examples

			First six rows and columns:
      2     3     5     7    11    13
      6    10    14    15    21    22
     30    42    66    70    78   102
    210   330   390   462   510   546
   2310  2730  3570  3990  4290  4830
  30030 39270 43890 46410 51870 53130
		

Crossrefs

Cf. A005117 (squarefree numbers), A072047 (number of prime factors), A340313 (indexing), A078840 (all natural numbers, not only squarefree).
Columns k=1..2: A002110, A306237.
Main diagonal gives A340467.
Cf. A358677.

Programs

  • Haskell
    a340316 n k = a340316_row n !! (k-1)
    a340316_row n = [a005117_list !! k | k <- [0..], a072047_list !! k == n]
    
  • Python
    from math import prod, isqrt
    from sympy import prime, primerange, integer_nthroot, primepi
    def A340316_T(n,k):
        if n == 1: return prime(k)
        def g(x,a,b,c,m): yield from (((d,) for d in enumerate(primerange(b+1,isqrt(x//c)+1),a+1)) if m==2 else (((a2,b2),)+d for a2,b2 in enumerate(primerange(b+1,integer_nthroot(x//c,m)[0]+1),a+1) for d in g(x,a2,b2,c*b2,m-1)))
        def f(x): return int(k+x-sum(primepi(x//prod(c[1] for c in a))-a[-1][0] for a in g(x,0,1,1,n)))
        def bisection(f,kmin=0,kmax=1):
            while f(kmax) > kmax: kmax <<= 1
            while kmax-kmin > 1:
                kmid = kmax+kmin>>1
                if f(kmid) <= kmid:
                    kmax = kmid
                else:
                    kmin = kmid
            return kmax
        return bisection(f) # Chai Wah Wu, Aug 31 2024

Formula

A(A072047(n), A340313(n)) = A005117(n) for n > 1.

A307540 Irregular triangle T(n,k) such that squarefree m with gpf(m) = prime(n) in each row are arranged according to increasing values of phi(m)/m.

Original entry on oeis.org

1, 2, 6, 3, 30, 10, 15, 5, 210, 42, 70, 14, 105, 21, 35, 7, 2310, 330, 462, 66, 770, 110, 154, 1155, 22, 165, 231, 33, 385, 55, 77, 11, 30030, 2730, 4290, 6006, 390, 546, 858, 10010, 78, 910, 1430, 2002, 130, 15015, 182, 286, 1365, 2145, 26, 3003, 195, 273, 429
Offset: 0

Views

Author

Michael De Vlieger, Apr 13 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 A000720(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} to achieve codes M -> m for each row n, which is tantamount to ordering according to A059894.
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.

Examples

			Triangle begins:
1;
2;
6, 3;
30, 10, 15, 5;
210, 42, 70, 14, 105, 21, 35, 7;
...
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. The x axis plots
according to primepi(gpf(m)), while the y axis plots k according to
phi(m)/m:
    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)
...
		

Crossrefs

Programs

  • Mathematica
    Prepend[Array[SortBy[#, Last] &@ Map[{#1, #2, EulerPhi[#1]/#1} & @@ {Times @@  MapIndexed[Prime[First@ #2]^#1 &, Reverse@ #], FromDigits@ #} &, Map[Prepend[Reverse@ #, 1] &, Tuples[{1, 0}, # - 1]]] &, 6], {{1, 0, 1}}][[All, All, 1]] // Flatten

Formula

For n > 0, row lengths = A000079(n - 1).
T(n, 1) = A002110(n) = p_n#.
T(n, 2) = A306237(n) = p_n#/prime(n - 1).
T(n, 2^(n - 1) - 1) = A006094(n).
T(n, 2^(n - 1)) = A000040(n) = prime(n) for n >= 1.
Last even term in row n = A077017(n).
First odd term in row n = A070826(n).

A362855 a(n) = n for n <= 3; for n > 3, a(n) is the least novel multiple of k, the product of all distinct prime factors of a(n-2) that do not divide a(n-1).

Original entry on oeis.org

1, 2, 3, 4, 6, 5, 12, 10, 9, 20, 15, 8, 30, 7, 60, 14, 45, 28, 75, 42, 25, 84, 35, 18, 70, 21, 40, 63, 50, 105, 16, 210, 11, 420, 22, 315, 44, 525, 66, 140, 33, 280, 99, 350, 132, 175, 198, 245, 264, 385, 24, 770, 27, 1540, 36, 1155, 26, 2310, 13, 4620, 39, 3080, 78, 1925, 156, 2695, 234, 3465, 52, 5775
Offset: 1

Views

Author

Keywords

Comments

Motivated by A362631, but instead of using one prime divisor of a(n-2) which does not divide a(n-1), the product of all such primes is used to compute a(n). - David James Sycamore, May 07 2023
From Michael De Vlieger, May 27 2023: (Start)
Primes p(k) enter the sequence in order and fairly regularly through a(20543) = p(15) = 47, immediately following primorial A002110(k-1). However, a(87723) = p(17) = 59 is the next prime to appear, following a(87722) = A002110(16).
Conjecture: all primes appear eventually, but not in order. (End)
Similar to A280866, except that the denominator here is rad(a(n-1)) instead of rad(a(n-2)). Also related to A369825. - David James Sycamore, Jan 27 2024
From Michael De Vlieger, Apr 23 2024: (Start)
Conjecture: permutation of natural numbers.
Conjecture: the smallest missing number is always either prime or a powerful number.
Primes do not appear in order; a(87723) = 59 but a(91307) = 53.
Powerful numbers appear in clusters, e.g., for n roughly between 91200 and 91320.
Though it appears primorials are always followed by primes, it is logically possible but rare that primorials can be followed by a composite number. (End)

Examples

			From _Michael De Vlieger_, Apr 23 2024: (Start)
Let rad(x) = A007947(x) and let P(x) = A002110(x).
Let S = { prime p : p | a(n-2) } and let T = { prime p : p | a(n-1) }. Then k = Product_{p in S\T} p = rad(a(n-2)*a(n-1))/rad(a(n-1)).
a(3) = 3 since rad(1*2)/rad(2) = 1; a(1) = 1, a(2) = 2, therefore a(3) = 3*1.
a(4) = 4 since rad(2*3)/rad(3) = 2; a(2) = 2, thus a(4) = 2*2.
a(5) = 6 since rad(3*4)/rad(4) = 6/2 = 3; a(3) = 3, thus a(5) = 2*3.
a(91305) = 108 and a(91306) = P(17), therefore k = 1 since rad(108) | P(17). The smallest missing number is 53, therefore a(91307) = 53*1. Related sequence A368133 = b is such that it is coincident with this sequence until b(91307) = 61, since prime(18) = 61 is the smallest prime that does not divide b(91306) = P(17). (End)
		

Crossrefs

Programs

  • Mathematica
    nn = 100; c[] := False; m[] := 1;
    f[x_] := f[x] = Times @@ FactorInteger[x][[All, 1]];
    Array[Set[{a[#], c[#], m[#]}, {#, True, 2}] &, 2]; i = 1; j = r = 2;
    Do[(While[c[Set[k, # m[#]]], m[#]++]) &[r/f[j]];
      Set[{a[n], c[k], i, j, r}, {k, True, j, k, f[j*k]}], {n, 3, nn}];
    Array[a, nn] (* Michael De Vlieger, Feb 21 2024 *)

Formula

A007947(a(n) * a(n+1)) | A007947(a(n+1) * a(n+2)). - Peter Munn, Apr 18 2024

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).

A308596 a(n) is the product of the prime(n) smallest primes other than prime(n).

Original entry on oeis.org

15, 70, 6006, 1385670, 674612557710, 1006366256282310, 6899316550553351234310, 29365306848773629524600810, 1033423560710676120463066852232970, 1090001884152331303039489872122195258388782310
Offset: 1

Views

Author

Francesco Vissani, Jun 09 2019

Keywords

Examples

			  |    p =   |    a(n) = product of p smallest
n | prime(n) |            primes other than p
--+----------+--------------------------------------------
1 |     2    |      15 =     3 * 5
2 |     3    |      70 = 2     * 5 * 7
3 |     5    |    6006 = 2 * 3     * 7 * 11 * 13
4 |     7    | 1385670 = 2 * 3 * 5     * 11 * 13 * 17 * 19
		

Crossrefs

Programs

  • Mathematica
    Table[a[i]=Product[Prime[j],{j,1,Prime[i]+1}]/Prime[i],{i,10}]

Formula

a(n) = prime(prime(n)+1)#/prime(n).
Showing 1-5 of 5 results.