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.

A108546 Lexicographically earliest permutation of primes such that for n>1 forms 4*k+1 and 4*k+3 alternate.

Original entry on oeis.org

2, 3, 5, 7, 13, 11, 17, 19, 29, 23, 37, 31, 41, 43, 53, 47, 61, 59, 73, 67, 89, 71, 97, 79, 101, 83, 109, 103, 113, 107, 137, 127, 149, 131, 157, 139, 173, 151, 181, 163, 193, 167, 197, 179, 229, 191, 233, 199, 241, 211, 257, 223, 269, 227, 277, 239, 281, 251, 293
Offset: 1

Views

Author

Reinhard Zumkeller, Jun 10 2005

Keywords

Crossrefs

Cf. A000040, A002144, A002145, A102261, A108547 (fixed points), A108548, A111745, A332806 (inverse), A332807.
Cf. also A267101, A332211.

Programs

  • Haskell
    import Data.List (transpose)
    a108546 n = a108546_list !! (n-1)
    a108546_list =  2 : concat
       (transpose [a002145_list, a002144_list])
    -- Reinhard Zumkeller, Nov 13 2014, Feb 22 2011
    
  • Mathematica
    terms = 60; A111745 = Module[{prs = Prime[Range[2terms]], m3, m1, min}, m3 = Select[prs, Mod[#, 4] == 3&]; m1 = Select[prs, Mod[#, 4] == 1&]; min = Min[Length[m1], Length[m3]]; Riffle[Take[m3, min], Take[m1, min]]]; a[1] = 2; a[n_] := A111745[[n-1]]; Table[a[n], {n, 1, terms}] (* Jean-François Alcover, May 18 2017, using Harvey P. Dale's code for A111745 *)
  • PARI
    up_to = 10000;
    A108546list(up_to) = { my(v=vector(up_to), p,q); v[1] = 2; v[2] = 3; v[3] = 5; for(n=4,up_to, p = v[n-2]; q = nextprime(1+p); while(q%4 != p%4, q=nextprime(1+q)); v[n] = q); (v); };
    v108546 = A108546list(up_to);
    A108546(n) = v108546[n]; \\ Antti Karttunen, Feb 27 2020

Formula

a(n) mod 4 = 3 - 2 * (n mod 2) for n>1.
For n > 1: a(n) = A111745(n-1).
a(2*n+1) - a(2*n) = A102261(n).
From Antti Karttunen, Feb 27 2020: (Start)
a(1) = 2, a(2n) = A002145(n), a(2n+1) = A002144(n).
a(n) = A000040(A332807(n)).
(End)

A332806 Permutation of primes, inverse of A108546.

Original entry on oeis.org

2, 3, 5, 7, 13, 11, 17, 19, 29, 23, 37, 31, 41, 43, 53, 47, 61, 59, 71, 79, 67, 89, 101, 73, 83, 97, 107, 113, 103, 109, 131, 139, 127, 151, 137, 163, 149, 173, 181, 157, 193, 167, 199, 179, 191, 223, 229, 239, 251, 197, 211, 263, 227, 271, 233, 281, 241, 293, 257, 269, 311, 277, 317, 337, 283, 307, 349, 313, 359, 331, 347, 373, 383, 353
Offset: 1

Views

Author

Antti Karttunen, Feb 27 2020

Keywords

Crossrefs

Differs from its inverse A108546 for the first time at n=19, where a(19) = 71, while A108546(19) = 73.

Programs

  • PARI
    up_to = 10000;
    A332806list(up_to) = { my(v=vector(2), xs=Map(), lista=List([]), p,q,u); v[2] = 3; v[1] = 5; mapput(xs,1,1); mapput(xs,2,2); mapput(xs,3,3);  for(n=4,up_to, p = v[2-(n%2)]; q = nextprime(1+p); while(q%4 != p%4, q=nextprime(1+q)); v[2-(n%2)] = q; mapput(xs,primepi(q),n)); for(i=1, oo, if(!mapisdefined(xs, i, &u), return(Vec(lista)), listput(lista, prime(u)))); };
    v332806 = A332806list(up_to);
    A332806(n) = v332806[n];

Formula

a(n) = A000040(A332805(n)).
a(A000720(A108547(n))) = A108547(n).

A108549 Fixed points for A108548.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 14, 15, 16, 17, 18, 19, 20, 21, 24, 25, 27, 28, 30, 32, 34, 35, 36, 38, 40, 41, 42, 43, 45, 48, 49, 50, 51, 54, 56, 57, 60, 63, 64, 68, 70, 72, 75, 76, 80, 81, 82, 84, 85, 86, 90, 95, 96, 98, 100, 102, 105, 108, 112, 114, 119, 120, 123, 125
Offset: 1

Views

Author

Reinhard Zumkeller, Jun 10 2005

Keywords

Comments

A108548(a(n)) = a(n); multiplicative closure of A108547.

Crossrefs

Cf. A108546.

A332805 a(n) = A000720(A332806(n)).

Original entry on oeis.org

1, 2, 3, 4, 6, 5, 7, 8, 10, 9, 12, 11, 13, 14, 16, 15, 18, 17, 20, 22, 19, 24, 26, 21, 23, 25, 28, 30, 27, 29, 32, 34, 31, 36, 33, 38, 35, 40, 42, 37, 44, 39, 46, 41, 43, 48, 50, 52, 54, 45, 47, 56, 49, 58, 51, 60, 53, 62, 55, 57, 64, 59, 66, 68, 61, 63, 70, 65, 72, 67, 69, 74, 76, 71, 78, 80, 73, 75, 77, 79, 82, 81, 84, 83, 86, 88, 85
Offset: 1

Views

Author

Antti Karttunen, Feb 27 2020

Keywords

Crossrefs

Cf. A000040, A108546, A332806, A332807 (inverse permutation).
Fixed points are given by A000720(A108547(n)), n>=1.
Cf. also A267100.

Programs

  • PARI
    up_to = 10000;
    A332805list(up_to) = { my(v=vector(2), xs=Map(), lista=List([]), p,q); v[2] = 3; v[1] = 5; mapput(xs,1,1); mapput(xs,2,2); mapput(xs,3,3);  for(n=4,up_to, p = v[2-(n%2)]; q = nextprime(1+p); while(q%4 != p%4, q=nextprime(1+q)); v[2-(n%2)] = q; mapput(xs,primepi(q),n)); for(i=1, oo, if(!mapisdefined(xs, i, &u), return(Vec(lista)), listput(lista, u))); };
    v332805 = A332805list(up_to);
    A332805(n) = v332805[n];

Formula

For all n >= 1, A108546(a(n)) = A000040(n).

A332807 a(n) = A000720(A108546(n)).

Original entry on oeis.org

1, 2, 3, 4, 6, 5, 7, 8, 10, 9, 12, 11, 13, 14, 16, 15, 18, 17, 21, 19, 24, 20, 25, 22, 26, 23, 29, 27, 30, 28, 33, 31, 35, 32, 37, 34, 40, 36, 42, 38, 44, 39, 45, 41, 50, 43, 51, 46, 53, 47, 55, 48, 57, 49, 59, 52, 60, 54, 62, 56, 65, 58, 66, 61, 68, 63, 70, 64, 71, 67, 74, 69, 77, 72, 78, 73, 79, 75, 80, 76, 82, 81, 84, 83, 87, 85, 88, 86
Offset: 1

Views

Author

Antti Karttunen, Feb 27 2020

Keywords

Crossrefs

Cf. A332805 (inverse permutation).
Fixed points are given by A000720(A108547(n)), n>=1.
Cf. also A267100.

Programs

  • PARI
    up_to = 50507;
    A332807list(up_to) = { my(v=vector(up_to), p,q); v[1] = 2; v[2] = 3; v[3] = 5; for(n=4,up_to, p = v[n-2]; q = nextprime(1+p); while(q%4 != p%4, q=nextprime(1+q)); v[n] = q); apply(primepi,v); };
    v332807 = A332807list(up_to);
    A332807(n) = v332807[n];

Formula

a(n) = A000720(A108546(n)).
Showing 1-5 of 5 results.