[go: up one dir, main page]

login
Solution to Popular Computing Problem 196.
1

%I #16 Nov 19 2023 13:01:45

%S 6,8,10,9,14,12,4,15,22,5,26,21,18,32,34,7,38,40,24,33,46,27,50,39,30,

%T 56,58,11,62,48,36,51,70,13,74,57,42,60,82,45,86,88,16,69,94,17,98,75,

%U 54,104,106,19,110,84,20,87,118,63,122,93,66,128,130,23,134

%N Solution to Popular Computing Problem 196.

%C See link for statement of the problem.

%H Alois P. Heinz, <a href="/A256964/b256964.txt">Table of n, a(n) for n = 1..10000</a>

%H Popular Computing (Calabasas, CA), <a href="/A249990/a249990.png">Problems 195 and 196</a>, Vol. 5 (No. 55, 1977), annotated and scanned copy of page PC55-4. See Problem 196.

%t A256964 = {}; nlist = Range[3, 2 10^4 + 10]; Do[x = nlist[[i]]; AppendTo[ A256964, nlist[[x+i]]]; nlist[[x+i]] = x, {i, 10^4}]; A256964 (* _Jean-François Alcover_, May 31 2019, after _Chai Wah Wu_ *)

%o (Python)

%o A256964_list, nlist = [], list(range(3,2*10**4+10))

%o for i in range(10**4):

%o x = nlist[i]

%o A256964_list.append(nlist[x+i])

%o nlist[x+i] = x # _Chai Wah Wu_, Apr 16 2015

%Y Cf. A249990.

%K nonn

%O 1,1

%A _N. J. A. Sloane_, Apr 16 2015