A297163 Permutation of natural numbers: a(n) = A156552(1+A005940(1+n)).
1, 2, 3, 4, 5, 8, 9, 6, 7, 16, 15, 32, 65, 128, 35, 64, 11, 10, 33, 18, 27, 1024, 513, 12, 25, 130, 515, 2048, 77, 36, 8193, 34, 17, 256, 129, 512, 71, 8192, 63, 4096, 133, 524288, 65537, 131072, 271, 72, 519, 24, 262145, 70, 8195, 33554432, 16389, 34359738368, 1073741825, 1048576, 65543, 9007199254740992, 131079
Offset: 0
Keywords
Links
- Antti Karttunen, Table of n, a(n) for n = 0..440
- David Newman, et al, New sequences from old, Discussion on SeqFan-mailing list, January 2018.
- Index entries for sequences related to binary expansion of n
- Index entries for sequences that are permutations of the natural numbers
- Index entries for sequences computed from indices in prime factorization
Programs
-
PARI
A005940(n) = { my(p=2, t=1); n--; until(!n\=2, if((n%2), (t*=p), p=nextprime(p+1))); t }; \\ Modified from code of M. F. Hasler A064989(n) = {my(f); f = factor(n); if((n>1 && f[1,1]==2), f[1,2] = 0); for (i=1, #f~, f[i,1] = precprime(f[i,1]-1)); factorback(f)}; A156552(n) = if(1==n, 0, if(!(n%2), 1+(2*A156552(n/2)), 2*A156552(A064989(n)))); A297163(n) = A156552(1+A005940(1+n));
-
Scheme
(define (A297163 n) (A156552 (+ 1 (A005940 (+ 1 n)))))
Comments