09-10-2017, 04:57 PM
The programme inserts symbolics in the Sequence App to produce the sequence
https://oeis.org/A008904
NB The position indexes in the Sequence App start at 1, while the OEIS starts the sequence at index zero.
NB This sequence does NOT become periodic.
https://oeis.org/A008904
NB The position indexes in the Sequence App start at 1, while the OEIS starts the sequence at index zero.
NB This sequence does NOT become periodic.
Code:
RECURSE(U,IFTE(N<6,IFTE(N==3,2,IFTE(N==4,6,4)),(IFTE(U3(N)<2,6,IFTE(U3(N)==2,12,IFTE(U3(N)==3,36,IFTE(U3(N)<7,24,IFTE(U3(N)==7,48,IFTE(U3(N)==8,24,36))))))*3^(U2(N) MOD 4)*U1(U2(N)+1)) MOD 10),1,1)►U1(N):
CHECK 1:
RECURSE(U,INT((N-1)/5),0,0)►U2(N):
RECURSE(U,(N-1) MOD 10,0,1)►U3(N):