login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

a(n) = a(n-1) + a(n-2) + gcd(a(n-1), n), a(1) = a(2) = 1.
0

%I #24 Mar 04 2023 15:14:05

%S 1,1,3,5,13,19,33,53,87,141,229,371,601,973,1575,2549,4125,6677,10803,

%T 17481,28287,45769,74057,119827,193885,313713,507625,821339,1328965,

%U 2150309,3479275,5629585,9108861,14738447,23847309,38585765,62433075,101018841,163451919,264470761,427922681,692393443

%N a(n) = a(n-1) + a(n-2) + gcd(a(n-1), n), a(1) = a(2) = 1.

%F a(n) = a(n-1) + a(n-2) + gcd(a(n-1), n), a(1) = a(2) = 1.

%e a(5) = 3 + 5 + gcd(5, 5) = 13.

%p a:= proc(n) option remember; procname(n-1)+procname(n-2) + igcd(procname(n-1),n) end proc:

%p a(1):= 1: a(2):= 1:

%p map(a, [$1..50]); # _Robert Israel_, Feb 28 2023

%o (Python)

%o from math import gcd

%o a = [0, 1, 1]

%o [a.append(a[n-1]+a[n-2]+gcd(a[n-1], n)) for n in range(3, 65)]

%o print(a[1:])

%o # With help from _Michael S. Branicky_, Feb 25 2023

%K nonn,easy

%O 1,3

%A _Jack Braxton_, Feb 25 2023