login
A361470
a(n) = gcd(n+1, A135504(n)).
3
1, 3, 2, 1, 6, 1, 8, 9, 2, 1, 12, 1, 14, 3, 16, 1, 18, 1, 20, 21, 2, 1, 24, 5, 2, 27, 28, 1, 30, 1, 32, 3, 2, 35, 36, 1, 38, 3, 40, 1, 42, 1, 44, 45, 2, 1, 48, 49, 50, 3, 4, 1, 54, 55, 56, 57, 2, 1, 60, 1, 62, 63, 64, 5, 66, 1, 68, 3, 70, 1, 72, 1, 74, 75, 76, 77, 6, 1, 80, 81, 2, 1, 84, 85, 2, 3, 88
OFFSET
1,2
LINKS
FORMULA
a(n) = (n+1) / A135506(n).
MATHEMATICA
MapIndexed[GCD[First[#2] + 1, #1] &, RecurrenceTable[{a[1] == 1, a[n] == a[n - 1] + LCM[a[n - 1], n]}, a, {n, 87}] ] (* Michael De Vlieger, May 11 2023 *)
PROG
(PARI)
up_to = 65537;
A361470list(up_to_n) = { my(v=vector(up_to), x1=1, x2); for(n=2, 1+up_to_n, x2 = x1+lcm(x1, n); v[n-1] = gcd(x1, n); x1=x2); (v); };
v361470 = A361470list(up_to);
A361470(n) = v361470[n];
(Python)
from math import gcd
from itertools import count, islice
def A361470_gen(): # generator of terms
x = 1
for n in count(2):
yield (y:=gcd(x, n))
x += x*n//y
A361470_list = list(islice(A361470_gen(), 20)) # Chai Wah Wu, May 11 2023
CROSSREFS
Sequence in context: A089145 A324644 A364256 * A134199 A323417 A102189
KEYWORD
nonn
AUTHOR
Antti Karttunen, Mar 26 2023
STATUS
approved