OFFSET
1,2
COMMENTS
a(n) mod 420 is periodic. This can be seen because if b = A396771(a(n)) does not divide a(n) and also not divide a(n)+420 then b will also not divide a(n)+j*420 for some j under the restriction that gcd(420, b) does not divide k. This last condition is always met as we observe that A396771(a(n) mod 420) <= 8 for all n and thus gcd(420, b) = b for b < 8. - Thomas Scheuerle, Jun 06 2026
LINKS
Michael S. Branicky, Table of n, a(n) for n = 1..10000
Index entries for linear recurrences with constant coefficients, signature (1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, -1).
FORMULA
a(n + 98) = a(n) + 420 for n >= 10. - David Radcliffe, Jun 04 2026
a(n) = a(n-1) + a(n-98) - a(n-99) for n >= 108. - Thomas Scheuerle, Jun 04 2026
EXAMPLE
The numbers that do not divide 4 are 3, 5, 6, 7, ..., so a(3) = 4+5 = 9.
Here are the beginnings of the trajectories of some small numbers:
...1--4--9---13--16--21--25--28--32--37--40---
.............|...................|...|
......5--8---+...............29--+...|
.....................................|
...2--6--11--14--18--23--26--30------+
.............|...........|...........|
...3--7--10--+...........|.......33--+
.........................|
.............12--19--22--+
.................|.......|
.............15--+.......|
.........................|
.................17--20--+
..............................................
.........................24--31--34--38--42---
.............................|.......|
.........................27--+...35--+
MATHEMATICA
f[n_] := (k = 1; s = {}; While[ True, k++; If[ !Divisible[n, k], AppendTo[s, k]]; If[Length[s] == 2, Break[]]]; n + Last[s]); NestList[f, 1, 58] (* Jean-François Alcover, Oct 05 2011 *)
(* Alternative: *)
NestList[#+Complement[Range[100], Divisors[#]][[2]]&, 1, 60] (* Harvey P. Dale, Apr 27 2012 *)
PROG
(Python)
from itertools import islice
def f(x):
nd1 = next(k for k in range(2, x+2) if x%k)
return x + next(k for k in range(nd1+1, x+3) if x%k)
def agen(x=1): # generator of terms
while True: yield x; x = f(x)
print(list(islice(agen(), 59))) # Michael S. Branicky, Jun 03 2026
CROSSREFS
Cf. A396771.
KEYWORD
nonn,easy
AUTHOR
Eric Angelini, Jun 25 2008
EXTENSIONS
More terms from Stefan Steinerberger, Jul 01 2008
STATUS
approved
