login
A055935
a(0)=1; a(n) = Sum_{j<n, gcd(n,a(j)) = 1} a(j).
2
1, 1, 2, 4, 2, 10, 2, 22, 2, 46, 2, 72, 2, 168, 2, 88, 2, 428, 2, 858, 2, 620, 2, 2294, 2, 4006, 2, 7546, 2, 16192, 2, 29472, 2, 7442, 2, 60960, 2, 127972, 2, 38738, 2, 296980, 2, 593962, 2, 798786, 2, 1986714, 2, 3926978, 2, 5023380, 2, 12923792, 2, 16513952
OFFSET
0,3
COMMENTS
For j > 0, a(2j) = 2 and a(j+1) is even.
LINKS
EXAMPLE
a(9) = 46 because all previous terms are relatively prime to 9 and the sum of all previous terms is 46.
PROG
(Python)
from math import gcd
def A055935_list(nmax):
A = [1, 1]
for n in range(2, nmax+1):
if n%2 > 1:
A.append(2)
else:
A.append(sum(i for i in A if gcd(n, i) ==1))
return A # John Tyler Rascoe, Jun 12 2024
CROSSREFS
Cf. A055934.
Sequence in context: A072866 A061393 A260361 * A086930 A235798 A099585
KEYWORD
easy,nonn
AUTHOR
Leroy Quet, Jul 17 2000
STATUS
approved