(38G) OEIS A2516, A(A(N))=2*N

+- HP Forums (http://www.hpmuseum.org/forum)
+-- Forum: HP Software Libraries (/forum-10.html)
+--- Forum: General Software Library (/forum-13.html)
+--- Thread: (38G) OEIS A2516, A(A(N))=2*N (/thread-8769.html)



(38G) OEIS A2516, A(A(N))=2*N - Gerald H - Today 08:05 AM

A programme to enter symbolics in the Sequence App to reproduce the sequence

https://oeis.org/A002516

Code:

A002516

RECURSE(U,IFTE(N MOD 2==0,2*U1(N/2),IFTE(N MOD 4==1,N+2,2*(N-2))),3,6)►U1(N):
CHECK 1: