OFFSET
1,2
COMMENTS
Consider the diagram with overlapping periodic curves that appears in the Links section (figure 2). The number of curves that contain the point [n,0] equals the number of divisors of n. The curve of diameter d represents the divisor d of n. Now consider only the lower part of the diagram (figure 3). Starting from point [1,0] we continue our journey walking along the semicircumference with smallest diameter not used previously (see the illustration of initial terms, figure 1). The sequence is formed by the values of n where the trajectory intercepts the x axis. - Omar E. Pol, Jan 14 2019
LINKS
Jinyuan Wang, Table of n, a(n) for n = 1..1000
Omar E. Pol, Illustration of initial terms (Fig. 1)
Omar E. Pol, Periodic curves and tau(n) (Fig. 2)
FORMULA
a(1) = 1; if a(n) is an even composite number then a(n+1) = a(n) - 1; otherwise a(n+1) = a(n) + A020639(a(n)). - Omar E. Pol, Jan 13 2019
PROG
(PARI) lista(nn) = {my(v=vector(nn, i, if(i<4, 2^i/2))); for(n=4, nn, if(v[n-1]%2, v[n]=v[n-1] + factor(v[n-1])[1, 1], v[n]=v[n-1] - 1)); v; } \\ Jinyuan Wang, Mar 14 2020
(Python)
from itertools import count, islice
from sympy import primefactors
def A168007_gen(): # generator of terms
yield (a := 1)
for n in count(2):
yield (a:=a+(min(primefactors(a), default=1) if a&1 or a==2 else -1))
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Omar E. Pol, Nov 19 2009
EXTENSIONS
More terms from Omar E. Pol, Jan 12 2019
STATUS
approved