Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Search: a115319 -id:a115319
     Sort: relevance | references | number | modified | created      Format: long | short | data
Lexicographically earliest permutation of the natural numbers such that each prime number is followed by exactly two composite numbers.
+10
5
1, 2, 4, 6, 3, 8, 9, 5, 10, 12, 7, 14, 15, 11, 16, 18, 13, 20, 21, 17, 22, 24, 19, 25, 26, 23, 27, 28, 29, 30, 32, 31, 33, 34, 37, 35, 36, 41, 38, 39, 43, 40, 42, 47, 44, 45, 53, 46, 48, 59, 49, 50, 61, 51, 52, 67, 54, 55, 71, 56, 57, 73, 58, 60, 79, 62, 63, 83, 64, 65, 89, 66
OFFSET
1,2
COMMENTS
Inverse: A115318.
Fixed points = {1,2,27,28,29,30,33,34}, also for A115317, A115318, A115319.
FORMULA
a(a(n)) = A115317(n).
a(3*n-2) = A018252(2*n-1), a(3*n-1) = A000040(n), a(3*n) = A018252(2*n);
a(n+1+floor((n+1)/2)) = A002808(n).
MATHEMATICA
terms = 72;
np = Ceiling[terms/3] + 1;
nc = Ceiling[(2/3) terms];
pp = Prime[Range[np]];
cc = Partition[Select[Range[FindRoot[n == nc + PrimePi[n] + 1, {n, nc, 2nc}][[1, 2]] // Floor], CompositeQ], 2];
Join[{1}, Riffle[pp, cc] // Flatten][[1 ;; terms]] (* Jean-François Alcover, Nov 15 2021 *)
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Reinhard Zumkeller, Jan 20 2006
STATUS
approved
Inverse of A115316.
+10
3
1, 2, 5, 3, 8, 4, 11, 6, 7, 9, 14, 10, 17, 12, 13, 15, 20, 16, 23, 18, 19, 21, 26, 22, 24, 25, 27, 28, 29, 30, 32, 31, 33, 34, 36, 37, 35, 39, 40, 42, 38, 43, 41, 45, 46, 48, 44, 49, 51, 52, 54, 55, 47, 57, 58, 60, 61, 63, 50, 64, 53, 66, 67, 69, 70, 72, 56, 73, 75, 76, 59, 78
OFFSET
1,2
FORMULA
a(a(n)) = A115319(n).
a(n) = A115316(A115319(n)) = A115319(A115316(n)).
MATHEMATICA
nmax = 72;
nn = nmax + 10; (* estimated length of A115316 - should be increased in case of message "NotFound" in the output *)
np = Ceiling[nn/3] + 1;
nc = Ceiling[(2/3) nn];
pp = Prime[Range[np]];
cc = Partition[Select[Range[FindRoot[n == nc + PrimePi[n] + 1, {n, nc, 2nc}][[1, 2]] // Floor], CompositeQ], 2];
A115316 = Join[{1}, Riffle[pp, cc] // Flatten][[1 ;; nn]];
a[n_] := FirstPosition[A115316, n][[1]];
Table[a[n], {n, 1, nmax}] (* Jean-François Alcover, Nov 15 2021 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Reinhard Zumkeller, Jan 20 2006
STATUS
approved
a(n) = A115316(A115316(n)).
+10
2
1, 2, 6, 8, 4, 5, 10, 3, 12, 14, 9, 11, 16, 7, 18, 20, 15, 17, 22, 13, 24, 25, 21, 26, 23, 19, 27, 28, 29, 30, 31, 32, 33, 34, 36, 37, 35, 43, 41, 38, 42, 39, 40, 53, 47, 44, 61, 45, 46, 71, 48, 59, 57, 49, 50, 63, 51, 52, 89, 67, 54, 68, 55, 56, 74, 73, 58, 107, 60, 79, 113, 62
OFFSET
1,2
COMMENTS
Inverse integer permutation of A115319;
A115318(a(n)) = a(A115318(n)) = A115316(n).
MATHEMATICA
nmax = 72; (* length of this sequence *)
nn = nmax + 20 (* estimated length of A115316 - should be increased if insufficient *);
np = Ceiling[nn/3] + 1;
nc = Ceiling[(2/3) nn];
pp = Prime[Range[np]];
cc = Partition[Select[Range[FindRoot[n == nc + PrimePi[n] + 1, {n, nc, 2nc}][[1, 2]] // Floor], CompositeQ], 2];
A115316 = Join[{1}, Riffle[pp, cc] // Flatten][[1 ;; nn]];
a[n_] := A115316[[A115316[[n]]]];
Table[a[n], {n, 1, nmax}] (* Jean-François Alcover, Nov 15 2021 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Reinhard Zumkeller, Jan 20 2006
STATUS
approved

Search completed in 0.015 seconds