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.

A236542 Array T(n,k) read along descending antidiagonals: row n contains the primes with n steps in the prime index chain.

Original entry on oeis.org

2, 7, 3, 13, 17, 5, 19, 41, 59, 11, 23, 67, 179, 277, 31, 29, 83, 331, 1063, 1787, 127, 37, 109, 431, 2221, 8527, 15299, 709, 43, 157, 599, 3001, 19577, 87803, 167449, 5381, 47, 191, 919, 4397, 27457, 219613, 1128889, 2269733, 52711
Offset: 1

Views

Author

R. J. Mathar, Jan 28 2014

Keywords

Comments

Row n contains the primes A000040(j) for which A049076(j) = n.

Examples

			The array starts:
    2,    7,   13,   19,   23,   29,   37,   43,   47,   53,...
    3,   17,   41,   67,   83,  109,  157,  191,  211,  241,...
    5,   59,  179,  331,  431,  599,  919, 1153, 1297, 1523,...
   11,  277, 1063, 2221, 3001, 4397, 7193, 9319,10631,12763,...
   31, 1787, 8527,19577,27457,42043,72727,96797,112129,137077,...
		

Crossrefs

Cf. A007821 (row 1), A049078 (row 2), A049079 (row 3), A007097 (column 1), A058010 (diagonal), A057456 - A057457 (columns), A135044, A236536.

Programs

  • Maple
    A236542 := proc(n,k)
        option remember ;
        if n = 1 then
            A007821(k) ;
        else
            ithprime(procname(n-1,k)) ;
        end if:
    end proc:
    for d from 2 to 10 do
        for k from d-1 to 1 by -1 do
                printf("%d,",A236542(d-k,k)) ;
        end do:
    end do:
  • Mathematica
    A007821 = Prime[Select[Range[15], !PrimeQ[#]&]];
    T[n_, k_] := T[n, k] = If[n == 1, If[k <= Length[A007821], A007821[[k]], Print["A007821 must be extended"]; Abort[]], Prime[T[n-1, k]]];
    Table[T[n-k+1, k], {n, 1, 9}, {k, n, 1, -1}] // Flatten (* Jean-François Alcover, Apr 16 2020 *)

Formula

T(1,k) = A007821(k).
T(n,k) = prime( T(n-1,k) ), n>1 .

A238538 A fourth-order linear divisibility sequence: a(n) = (2^n + 1)*(2^(3*n) - 1)/ ( (2 + 1)*(2^3 - 1) ).

Original entry on oeis.org

1, 15, 219, 3315, 51491, 811395, 12882499, 205321155, 3278747331, 52408827075, 838132189379, 13406842675395, 214483303960771, 3431523432591555, 54902699475185859, 878429788032676035, 14054769379960303811, 224875452250864496835, 3598000373385828511939
Offset: 1

Views

Author

Peter Bala, Feb 28 2014

Keywords

Comments

This is a fourth-order linear divisibility sequence, that is, the sequence satisfies a linear recurrence of order 4 and if n | m then a(n) | a(m). This is a consequence of the following more general result: The polynomials P(n,x,y) := (x^n + y^n)*(x^(3*n) - y^(3*n)) form a fourth-order linear divisibility sequence in the polynomial ring Z[x,y]. See the Bala link.
Hence, for a fixed integers M and N, the normalized sequence (M^n + N^n)*(M^(3*n) - N^(3*n))/ ( (M + N)*(M^3 - N^3) ) for n = 1,2,3,... is a linear divisibility sequence of order 4. It has the rational o.g.f. x*(1 - 2*M*N*(M^2 - M*N + N^2)*x + (M*N)^4*x^2)/( (1 - M^4*x)*(1 - M^3*N*x)*(1 - M*N^3*x)*(1 - N^4*x) ). This is the case M = 2, N = 1. For other cases see A238539(M = 2, N = -1), A238540(M = 3, N = 1) and A238541(M = 3, N = 2). See also A238536, A238537 and A215466.
Note, these sequences do not belong to the family of linear divisibility sequences of the fourth order studied by Williams and Guy, which have o.g.f.s of the form x*(1 - q*x^2)/Q(x), Q(x) a quartic polynomial and q an integer parameter.

Crossrefs

Programs

  • Maple
    seq(1/21*(2^n + 1)*(2^(3*n) - 1), n = 1..20);
  • Mathematica
    LinearRecurrence[{27,-202,432,-256},{1,15,219,3315},20] (* Harvey P. Dale, Jul 04 2019 *)

Formula

a(n) = (1/21)*(2^n + 1)*(2^(3*n) - 1) = A000051(n)*A024088(n)/21.
a(n) = (1/21)*(4^n - 1)*(8^n - 1)/(2^n - 1).
O.g.f.: x*(1 - 12*x + 16*x^2)/((1 - x)*(1 - 2*x)*(1 - 8*x)*(1 - 16*x)).
Recurrence equation: a(n) = 27*a(n-1) - 202*a(n-2) + 432*a(n-4) - 256*a(n-4).

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

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