# A087717 for range 1 .. 100000 computed by Antti Karttunen, 2019-01-03 # in GP/PARI CALCULATOR Version 2.9.4 (released) amd64 running linux (x86-64/GMP-6.1.2 kernel) 64-bit version, compiled: Dec 19 2017, gcc version 7.3.0 (Ubuntu 7.3.0-1ubuntu1), threading engine: pthread # with the following program: # # default(parisizemax,2^31); # A322982(n) = if((1==n)||isprime(n),n+n-1,n/vecmin(factor(n)[,1])); # A087717(n) = { my(visited = Map(), visited_at_step = Map(), j=0, m=0, t); while(!mapisdefined(visited, n), mapput(visited, n, j); mapput(visited_at_step, j, n); j++; n = A322982(n)); for(k=mapget(visited,n), j-1, t = mapget(visited_at_step,k); if(!m || (t