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.

A135044 a(1)=1, then a(c) = p and a(p) = c, where c = T_c(r,k) and p = T_p(r,k), and where T_p contains the primes arranged in rows by the prime index chain and T_c contains the composites arranged in rows by the order of compositeness. See Formula.

Original entry on oeis.org

1, 4, 9, 2, 16, 7, 6, 13, 3, 19, 26, 17, 8, 23, 41, 5, 12, 67, 10, 29, 59, 37, 14, 83, 179, 11, 43, 331, 20, 47, 39, 109, 277, 157, 53, 431, 22, 1063, 31, 191, 15, 2221, 27, 61, 211, 71, 30, 599, 1787, 919, 241, 3001, 35, 73, 8527, 127, 1153, 79, 21, 19577, 44, 89, 283
Offset: 1

Views

Author

Katarzyna Matylla, Feb 11 2008

Keywords

Comments

Exchanges primes with composites, primeth primes with composith composites, etc.
Exchange the k-th prime of order j with the k-th composite of order j and vice versa.
Self-inverse permutation of positive integers.
If n is the composite number A236536(r,k), then a(n) is the corresponding prime A236542(r,k) at the same position (r,k). Vice versa, if n is the prime A236542(r,k), then a(n) is the corresponding composite A236536(r,k) at the same position. - Andrew Weimholt, Jan 28 2014
The original name for this entry did not produce this sequence, but instead A236854, which differs from this permutation for the first time at n=8, where A236854(8)=23, while here a(8)=13. - Antti Karttunen, Feb 01 2014

Examples

			From _Andrew Weimholt_, Jan 29 2014: (Start)
More generally, takes the primes organized in an array according to the sieving process described in the Fernandez paper:
        Row[1](n) = 2, 7, 13, 19, 23, ...
        Row[2](n) = 3, 17, 41, 67, 83, ...
        Row[3](n) = 5, 59, 179, ...
        Row[4](n) = 11, 277, ...
        Lets call this  T_p (n, k)
Also take the composites organized in a similar manner, except we use "composite" numbered positions in our sieve:
        Row[1](n) = 4, 6, 8, 10, 14, 20, 22, ...
        Row[2](n) = 9, 12, 15, 18, 24, ...
        Row[3](n) = 16, 21, 25, ...
        Lets call this T_c (n, k)
If we now take the natural numbers and swap each number (except for 1) with the number which holds the same spot in the other array, then we get the sequence: 1, 4, 9, 2, 16, 7, 6, 13, with for example a(8) = 13 (13 holds the same position in the 'prime' table as 8 does in the 'composite' table). (End)
		

Crossrefs

Programs

  • Maple
    A135044 := proc(n)
        if n = 1 then
            1;
        elif isprime(n) then
            idx := -1 ;
            for r from 1 do
                for c from 1 do
                    if A236542(r,c) = n then
                        idx := [r,c] ;
                    end if;
                    if A236542(r,c) >= n then
                        break;
                    end if;
                end do:
                if type(idx,list)  then
                    break;
                end if;
            end do:
            A236536(r,c) ;
        else
            idx := -1 ;
            for r from 1 do
                for c from 1 do
                    if A236536(r,c) = n then
                        idx := [r,c] ;
                    end if;
                    if A236536(r,c) >= n then
                        break;
                    end if;
                end do:
                if type(idx,list)  then
                    break;
                end if;
            end do:
            A236542(r,c) ;
        end if;
    end proc: # R. J. Mathar, Jan 28 2014
  • Mathematica
    Composite[n_Integer] := Block[{k = n + PrimePi@n + 1}, While[k != n + PrimePi@k + 1, k++ ]; k]; Compositeness[n_] := Block[{c = 1, k = n}, While[ !(PrimeQ@k || k == 1), k = k - 1 - PrimePi@k; c++ ]; c]; Primeness[n_] := Block[{c = 1, k = n}, While[ PrimeQ@k, k = PrimePi@k; c++ ]; c];
    ckj[k_, j_] := Select[ Table[Composite@n, {n, 10000}], Compositeness@# == j &][[k]]; pkj[k_, j_] := Select[ Table[Prime@n, {n, 3000}], Primeness@# == j &][[k]]; f[0]=0; f[1] = 1;
    f[n_] := If[ PrimeQ@ n, pn = Primeness@n; ckj[ Position[ Select[ Table[ Prime@ i, {i, 150}], Primeness@ # == pn &], n][[1, 1]], pn], cn = Compositeness@n; pkj[ Position[ Select[ Table[ Composite@ i, {i, 500}], Compositeness@ # == cn &], n][[1, 1]], cn]]; Array[f, 64] (* Robert G. Wilson v *)

Formula

a(1)=1, a(A236536(r,k))=A236542(r,k), a(A236542(r,k))=A236536(r,k)

Extensions

Edited, corrected and extended by Robert G. Wilson v, Feb 18 2008
Name corrected by Andrew Weimholt, Jan 29 2014

A236536 Array T(n,k) read along antidiagonals: the composites of order of compositeness n in row n.

Original entry on oeis.org

4, 6, 9, 8, 12, 16, 10, 15, 21, 26, 14, 18, 25, 33, 39, 20, 24, 28, 38, 49, 56, 22, 32, 36, 42, 55, 69, 78, 27, 34, 48, 52, 60, 77, 94, 106, 30, 40, 50, 68, 74, 84, 105, 125, 141, 35, 45, 57, 70, 93, 100, 115, 140, 164, 184, 44, 51, 64, 80, 95, 124, 133, 152, 183, 212, 236, 46, 63, 72, 88, 110, 126, 162, 174, 198, 235, 270, 299
Offset: 1

Views

Author

R. J. Mathar, Jan 28 2014

Keywords

Comments

Row n contains the composites A002808(j) for which A059981(j) = n.
The 1st row contains the composites with a nonprime index, A002808(1)=4, A002808(2)=6, A002808(3)=8, A002808(5)=10, A002808(7)=14,...
The 2nd row contains the composites with an index in the 1st row.
Recursively the followup rows contain the composites that need a higher number of applications of A002808 to reach a nonprime.

Examples

			The array starts:
  4,  6,  8, 10, 14, 20, 22, 27, 30, 35,...
  9, 12, 15, 18, 24, 32, 34, 40, 45, 51,...
 16, 21, 25, 28, 36, 48, 50, 57, 64, 72,...
 26, 33, 38, 42, 52, 68, 70, 80, 88, 98,...
 39, 49, 55, 60, 74, 93, 95,110,119,130,...
 56, 69, 77, 84,100,124,126,145,156,170,...
 78, 94,105,115,133,162,165,188,203,218,...
106,125,140,152,174,209,213,242,259,278,...
141,164,183,198,222,266,272,305,326,348,...
		

Crossrefs

Cf. A006508 (column 1), A022449 (row 1), A135044, A236542, A002808.

Programs

  • Maple
    A236536 := proc(n,k)
        option remember ;
        if n = 1 then
            A022449(k) ;
        else
            A002808(procname(n-1,k)) ;
        end if:
    end proc:
    for d from 2 to 10 do
         for k from d-1 to  by -1 do
            printf("%3d,",A236536(d-k,k)) ;
         end do:
    end do:
  • Mathematica
    Composite[n_] := FixedPoint[n + PrimePi[#] + 1&, n + PrimePi[n] + 1];
    T[n_, k_] := T[n, k] = If[n == 1, Composite[If[k == 1, 1, Prime[k - 1]]], Composite[T[n - 1, k]]];
    Table[T[n - k + 1, k], {n, 1, 12}, {k, n, 1, -1}] // Flatten (* Jean-François Alcover, Sep 16 2023 *)

Formula

T(1,k) = A022449(k).
T(n,k) = A002808( T(n-1,k) ), n>1 .

A095165 n divided by A095163(n).

Original entry on oeis.org

1, 1, 1, 2, 1, 2, 1, 2, 3, 2, 1, 3, 1, 2, 3, 4, 1, 3, 1, 5, 3, 2, 1, 4, 5, 2, 3, 4, 1, 6, 1, 4, 3, 2, 5, 6, 1, 2, 3, 5, 1, 7, 1, 4, 5, 2, 1, 8, 7, 5, 3, 4, 1, 9, 5, 8, 3, 2, 1, 6, 1, 2, 7, 8, 5, 6, 1, 4, 3, 7, 1, 9, 1, 2, 5, 4, 7, 6, 1, 10, 9, 2, 1, 7, 5, 2, 3, 11, 1, 10, 7, 4, 3, 2, 5, 12, 1, 7, 11, 10, 1, 6
Offset: 1

Views

Author

Amarnath Murthy, Jun 01 2004

Keywords

Comments

Differs from A059981 and A033676 at n = 20. - Franklin T. Adams-Watters, Dec 07 2006

Crossrefs

Programs

Extensions

More terms from Franklin T. Adams-Watters, Dec 07 2006

A260621 Let b(k, n) = number obtained when the map x->A002808(x) is applied k times to n; a(n) is the smallest k such that b(k, n) + 1 is prime.

Original entry on oeis.org

1, 1, 12, 2, 1, 1, 3, 11, 1, 1, 7, 9, 1, 2, 10, 4, 2, 1, 1, 6, 8, 3, 3, 1, 9, 3, 1, 1, 18, 3, 1, 5, 7, 2, 2, 1, 4, 8, 2, 14, 1, 1, 6, 17, 2, 6, 1, 4, 6, 1, 1, 2, 2, 3, 7, 1, 13, 6, 1, 4, 16, 5, 16, 1, 5, 31, 35, 3, 5, 2, 1, 2, 3, 1, 1, 2, 6, 1, 1, 12, 5, 1, 2
Offset: 1

Views

Author

Matthew Campbell, Sep 25 2015

Keywords

Comments

a(n) is also the smallest value of k at which b(k, n+1) - b(k, n) > 1.

Examples

			When n = 3, writing Composite(x) for A002808(x):
1. Composite(3) = 8. 8 + 1 = 9 = 3^2. 9 is not prime.
2. Composite(8) = 15. 15 + 1 = 16 = 2^4. 16 is not prime.
3. Composite(15) = 25. 25 + 1 = 26 = 2*13. 26 is not prime.
4. Composite(25) = 38. 38 + 1 = 39 = 3*13. 39 is not prime.
5. Composite(38) = 55. 55 + 1 = 56 = 2^3*7. 56 is not prime.
6. Composite(55) = 77. 77 + 1 = 78 = 2*3*13. 78 is not prime.
7. Composite(77) = 105. 105 + 1 = 106 = 2*53. 106 is not prime.
8. Composite(105) = 140. 140 + 1 = 141 = 3*47. 141 is not prime.
9. Composite(140) = 183. 183 + 1 = 184 = 2^3*23. 184 is not prime.
10. Composite(183) = 235. 235 + 1 = 236 = 2^2*59. 236 is not prime.
11. Composite(235) = 298. 298 + 1 = 299 = 13*23. 299 is not prime.
12. Composite(298) = 372. 372 + 1 = 373. 373 is prime.
--------------------------------------------------------------
Since the composite function was applied 12 times, a(3)=12.
		

Crossrefs

Primes and nonprimes: A000040, A002808, A008578, A018252.
a(1) = p, a(n+1) = a(n)-th composite number: A006508, A022450, A022451, A025010, A025011, A059407, A059408.
Composites with order n > 1: A050435, A050436, A050438, A050439, A050440.
Composites with order n = b, n >= 1: A022449.
Composites with prime subscripts: A065858.
Composites without prime subscripts: A175251.
Order of compositeness: A059981, A236536.
Prime(n)-1: A006093.

Programs

  • Mathematica
    c = Select[Range[10^5], CompositeQ]; Table[k = 1; While[! PrimeQ[Nest[c[[#]] &, n, k] + 1], k++]; k, {n, 120}] (* Michael De Vlieger, Jul 15 2016 *)

Extensions

Terms from a(12) onward from Jon E. Schoenfield, Sep 27 2015

A377181 Rectangular array, by antidiagonals: (row 1) = r(1) = A002808 (composite numbers); (row n) = r(n) = A002808(r(n-1)) for n>=1.

Original entry on oeis.org

4, 6, 9, 8, 12, 16, 9, 15, 21, 26, 10, 16, 25, 33, 39, 12, 18, 26, 38, 49, 56, 14, 21, 28, 39, 55, 69, 78, 15, 24, 33, 42, 56, 77, 94, 106, 16, 25, 36, 49, 60, 78, 105, 125, 141, 18, 26, 38, 52, 69, 84, 106, 140, 164, 184, 20, 28, 39, 55, 74, 94, 115, 141, 183, 212, 236
Offset: 1

Views

Author

Clark Kimberling, Oct 19 2024

Keywords

Examples

			 corner:
   4     6     8     9    10    12    14    15    16    18
   9    12    15    16    18    21    24    25    26    28
  16    21    25    26    28    33    36    38    39    42
  26    33    38    39    42    49    52    55    56    60
  39    49    55    56    60    69    74    77    78    84
  56    69    77    78    84    94   100   105   106   115
  78    94   105   106   115   125   133   140   141   152
		

Crossrefs

Cf. A002808 (row 1), A050545 (row 2), A280327 (row 3), A006508 (column 1), A022450 (column 2), A023451 (column 3), A059981, A236356, A280327 (principal diagonal), A377173, A114577 (dispersion of the composite numbers).

Programs

  • Mathematica
    c[n_] := c[n] = Select[Range[500], CompositeQ][[n]]
    r[0] = Table[c[n], {n, 1, 10}]
    r[n_] := r[n] = c[r[n - 1]]
    Grid[Table[r[n], {n, 0, 6}]]  (* array *)
    p[n_, k_] := r[n][[k]];
    Table[p[n - k + 1, k], {n, 0, 9}, {k, n + 1, 1, -1}] // Flatten  (* sequence *)

Formula

A059981(n) = number of appearances of A002808(n).
Showing 1-5 of 5 results.