login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A276572 Simple self-inverse permutation of natural numbers: after a(0)=0, list each block of A260734(n) numbers in reverse order, from A260732(n) to A260733(1+n). 4

%I #10 Sep 08 2016 17:52:02

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

%T 28,27,26,25,24,37,36,35,34,33,32,31,44,43,42,41,40,39,38,52,51,50,49,

%U 48,47,46,45,62,61,60,59,58,57,56,55,54,53,71,70,69,68,67,66,65,64,63,81,80,79,78,77,76,75,74,73,72

%N Simple self-inverse permutation of natural numbers: after a(0)=0, list each block of A260734(n) numbers in reverse order, from A260732(n) to A260733(1+n).

%C Maps between A276573 and A276574.

%H Antti Karttunen, <a href="/A276572/b276572.txt">Table of n, a(n) for n = 0..10028</a>

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

%F a(0) = 0; for n >= 1, a(n) = (A260733(1+A276571(n))-n)+A260732(A276571(n)).

%t f[n_] := NestWhileList[# - (If[First@ # > 0, 1, Length[First@ Split@ #] + 1] &@ SquaresR[Range@ 4, #]) &, n^2, # != 0 &]; t = Table[Table[n, {Length[#] - 1 &@ NestWhileList[# - (If[First@ # > 0, 1, Length[First@ Split@ #] + 1] &@ SquaresR[Range@ 4, #]) &, ((n + 1)^2) - 1, # != (n^2) - 1 &]}], {n, 20}] // Flatten ; {0}~Join~Table[Length@ f@ t[[n]] - 1 + Length@ f[t[[n]] + 1] - n - 2, {n, 81}] (* _Michael De Vlieger_, Sep 08 2016 *)

%o (Scheme) (define (A276572 n) (if (zero? n) n (+ (- (A260733 (+ 1 (A276571 n))) n) (A260732 (A276571 n)))))

%Y Cf. A260732, A260733, A260734, A276573, A276574.

%K nonn

%O 0,3

%A _Antti Karttunen_, Sep 07 2016

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 19 19:02 EDT 2024. Contains 371798 sequences. (Running on oeis4.)