OFFSET
1,3
LINKS
FORMULA
a(n) = A002487(1+sigma(n)).
a(2^n) = 1 for all n >= 0, but also for some other numbers, e.g., a(25) = 1.
MATHEMATICA
A002487[m_] := Module[{a = 1, b = 0, n = m}, While[n > 0, If[OddQ[n], b = a + b, a = a + b]; n = Floor[n/2]]; b];
a[n_] := A002487[1 + DivisorSigma[1, n]];
Table[a[n], {n, 1, 100}] (* Jean-François Alcover, Mar 11 2023 *)
PROG
(PARI)
A002487(n) = { my(s=sign(n), a=1, b=0); n = abs(n); while(n>0, if(bitand(n, 1), b+=a, a+=b); n>>=1); (s*b); };
(Python)
from functools import reduce
from sympy import divisor_sigma
def A324294(n): return reduce(lambda x, y:(x[0], x[0]+x[1]) if int(y) else (x[0]+x[1], x[1]), bin(divisor_sigma(n)+1)[-1:1:-1], (1, 0))[1] # Chai Wah Wu, Jun 19 2022
CROSSREFS
KEYWORD
nonn
AUTHOR
Antti Karttunen, Feb 22 2019
STATUS
approved