A168007 Jumping divisor sequence (see Comments lines for definition).
1, 2, 4, 3, 6, 5, 10, 9, 12, 11, 22, 21, 24, 23, 46, 45, 48, 47, 94, 93, 96, 95, 100, 99, 102, 101, 202, 201, 204, 203, 210, 209, 220, 219, 222, 221, 234, 233, 466, 465, 468, 467, 934, 933, 936, 935, 940, 939, 942, 941, 1882, 1881, 1884, 1883, 1890, 1889, 3778, 3777, 3780, 3779, 7558, 7557, 7560, 7559
Offset: 1
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)
- Omar E. Pol, Periodic curves and tau(n), lower part upside down (Fig. 3)
Programs
-
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)) A168007_list = list(islice(A168007_gen(),20)) # Chai Wah Wu, Mar 14 2023
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
Extensions
More terms from Omar E. Pol, Jan 12 2019
Comments