login
A338666
a(1)=1 and a(2)=2. For all n > 2, a(n) is the smallest number > a(n-1) by a number > the difference between a(n-1) and a(n-2) so that consecutive terms of sequence are always relatively prime.
2
1, 2, 5, 9, 14, 23, 33, 46, 61, 77, 94, 113, 133, 155, 178, 203, 229, 256, 285, 316, 349, 383, 418, 455, 493, 532, 573, 616, 661, 707, 754, 803, 853, 904, 957, 1013, 1070, 1129, 1189, 1250, 1313, 1377, 1442, 1509, 1577, 1646, 1717, 1789, 1862, 1937, 2013, 2092, 2173, 2256, 2341
OFFSET
1,2
LINKS
EXAMPLE
Term after 33 cannot be 44 because 33 and 44 have a common factor of 11.
MATHEMATICA
a[1]=1; a[2]=2; a[n_]:=a[n]=Module[{d=a[n-1]-a[n-2]+1}, While[!CoprimeQ[a[n-1]+d, a[n-1]], d++]; a[n-1]+d]; a/@Range[70] (* Ivan N. Ianakiev, Apr 23 2021 *)
CROSSREFS
Sequence in context: A123690 A199935 A090937 * A325717 A291942 A071609
KEYWORD
nonn
AUTHOR
J. Lowell, Apr 22 2021
STATUS
approved