OFFSET
0,4
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..20000
EXAMPLE
a(12)+a(13) = 4. There are two divisors of 14 which are coprime to 4. (These divisors are 1 and 7.) So a(14) = 2.
MAPLE
with(numtheory): a[0]:=1: a[1]:=1: for n from 2 to 130 do div:=divisors(n): ct:=0: for j from 1 to tau(n) do if igcd(div[j], a[n-1]+a[n-2])=1 then ct:=ct+1 else ct:=ct: fi: od: a[n]:=ct: od: seq(a[n], n=0..130); # Emeric Deutsch, Apr 26 2007
# Alternative:
A128864 := proc(nmax) local a, n, dvs, resl, d ; a := [1, 1] ; while nops(a) < nmax do n := nops(a) ; dvs := numtheory[divisors](n) ; resl :=0 ; for d from 1 to nops(dvs) do if gcd(op(d, dvs), op(-1, a)+op(-2, a)) = 1 then resl := resl+1 ; fi ; od ; a := [op(a), resl] ; od ; RETURN(a) ; end: A128864(100) ; # R. J. Mathar, Apr 27 2007
# Alternative:
a:= proc(n) option remember; `if`(n<2, 1, (g-> nops(select(d->
igcd(g, d)=1, numtheory[divisors](n))))(a(n-1)+a(n-2)))
end:
seq(a(n), n=0..104); # Alois P. Heinz, Mar 22 2026
CROSSREFS
KEYWORD
nonn
AUTHOR
Leroy Quet, Apr 17 2007
EXTENSIONS
More terms from Emeric Deutsch and R. J. Mathar, Apr 26 2007
STATUS
approved
