OFFSET
0,4
COMMENTS
a(n) = A000045(n) for n = 0,1,2,3,4,5 and a(n) = A139047(n-1) for n = 1,2,3,...,10. Also, a(n) = n for n = 0,1,5 and a(n) < n for n = 2,3,4,6,7,8,11.
The values of n for which n divides a(n) are given in A343456 and the corresponding quotients are given in A343457.
If r and s are consecutive terms from A343456, then a(r+1) will divide the terms a(r) through a(s). Proof: Clearly, a(r+1) divides itself. Since a(r+1) = a(r)/r implies that r = a(r)/a(r+1), a(r+1) divides a(r). So, a(r+2) = a(r+1)+a(r) is also divisible by a(r+1). Similarly, the remaining terms a(r+3) = a(r+2)+a(r+1) through a(s) = a(s-1)+a(s-2) will also be divisible by a(r+1). QED
Example: a(r) = a(43) = 86903 = 2021*43 = a(44)*(1*43+0)
a(44) = 2021 = 2021* 1 = a(44)*(0*43+1)
a(45) = 88924 = 2021*44 = a(44)*(1*43+1)
a(46) = 90945 = 2021*45 = a(44)*(1*43+2)
a(s) = a(47) = 179869 = 2021*89 = a(44)*(2*43+3).
Notice that the values b and c in a(43+k) = a(44)*(b*43+c) for k = 0,1,2,3,4 follow the extended Fibonacci sequence A212804. In general, any run of terms a(r) through a(s) between successive divisions will be given by a(r+k) = a(r+1)*(A212804(k)*r+A212804(k+1)) for k = 0,1,2,...,s-r.
2 divides a(10) through a(32), 3 divides a(134) through a(144), 5 and 7 divide a(116) through a(140), and 11 divides a(89) through a(297). Conjecture: For any prime p, there exist r and s = k*p from A343456 for which p divides a(r) through a(s).
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..5000
EXAMPLE
a(2) = a(1)/1 = 1, a(3) = a(2)+a(1) = 2, a(4) = a(3)+a(2) = 3, a(5) = a(4)+a(3) = 5, a(6) = a(5)/5 = 1, a(7) = a(6)+a(5) = 6, ...
MAPLE
a:= proc(n) option remember; local q; `if`(n<2, n,
`if`(irem(a(n-1), n-1, 'q')=0, q, a(n-1)+a(n-2)))
end:
seq(a(n), n=0..50); # Alois P. Heinz, Apr 21 2021
MATHEMATICA
Block[{a = {0, 1}}, Do[AppendTo[a, If[Mod[#, i] == 0, #/i, # + a[[-2]] ]] &@ a[[-1]], {i, 48}]; a] (* Michael De Vlieger, Apr 22 2021 *)
PROG
(PARI) lista(nn) = {my(va = vector(nn)); va[1] = 1; for (n=2, nn, if (va[n-1] % (n-1), va[n] = va[n-1] + va[n-2], va[n] = va[n-1]/(n-1)); ); concat(0, va); } \\ Michel Marcus, Apr 20 2021
(Python)
a = [0, 1]
print("0 0")
print("1 1")
for n in range (2, 101):
if a[n-1] % (n - 1) == 0: a.append(a[n-1]//(n-1))
else: a.append(a[n-1] + a[n-2])
print(n, a[n]) # Karl-Heinz Hofmann, Apr 23 2021
CROSSREFS
KEYWORD
nonn
AUTHOR
Timothy L. Tiffin, Apr 13 2021
STATUS
approved