login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A permutation of the positive integers formed by reversing the order of the composites within each run of composites (1 and primes are left alone).
1

%I #19 Jul 13 2016 12:02:55

%S 1,2,3,4,5,6,7,10,9,8,11,12,13,16,15,14,17,18,19,22,21,20,23,28,27,26,

%T 25,24,29,30,31,36,35,34,33,32,37,40,39,38,41,42,43,46,45,44,47,52,51,

%U 50,49,48,53,58,57,56,55,54,59,60,61,66,65,64,63,62,67,70,69,68,71,72

%N A permutation of the positive integers formed by reversing the order of the composites within each run of composites (1 and primes are left alone).

%H Alois P. Heinz, <a href="/A119257/b119257.txt">Table of n, a(n) for n = 1..20000</a>

%H <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the natural numbers</a>

%F a(n) = Sum_{k=1..2n} floor(cos^2(Pi*(n-1)!^(k-1)/(k-1)!)) - Sum_{k=1..n} floor(cos^2(Pi*(k-1)!^n/n!)). - _Anthony Browne_, May 24 2016

%e The run of composites (24,25,26,27,28) becomes (28,27,26,25,24).

%t Block[{$MaxExtraPrecision = 1000}, Table[Sum[Floor[Cos[Pi (n - 1)!^(k - 1)/(k - 1)!]^2], {k, 2 n}] - Sum[ Floor[Cos[Pi (k - 1)!^n/n!]^2], {k, n}], {n, 72}]] (* _Michael De Vlieger_, May 24 2016 *)

%o (PARI) {m=73; print1(1,","); n=2; while(n<=m, while(isprime(n), print1(n,","); n++); k=n; while(!isprime(n),n++); forstep(a=n-1,k,-1, print1(a,",")))} \\ _Klaus Brockhaus_, Aug 16 2006

%K nonn

%O 1,2

%A _Leroy Quet_, Jul 23 2006

%E More terms from _Klaus Brockhaus_, Aug 16 2006