OFFSET
1,2
LINKS
FORMULA
MATHEMATICA
f[m_] := Module[{a = 1, b = 0, n = m}, While[n > 0, If[OddQ[n], b += a, a += b]; n = Floor[n/2]]; b]; Array[Times @@ Map[2^f@ # &, FactorInteger[#][[All, -1]] ] - Boole[# == 1] &, 105] (* after Jean-François Alcover at A002487 *)
PROG
(PARI)
A002487(n) = { my(a=1, b=0); while(n>0, if(bitand(n, 1), b+=a, a+=b); n>>=1); (b); }; \\ From A002487
(Python)
from functools import reduce
from sympy import factorint
def A318307(n): return 1<<sum(sum(reduce(lambda x, y:(x[0], x[0]+x[1]) if int(y) else (x[0]+x[1], x[1]), bin(e)[-1:2:-1], (1, 0))) for e in factorint(n).values()) # Chai Wah Wu, May 18 2023
CROSSREFS
KEYWORD
nonn,mult
AUTHOR
Antti Karttunen, Aug 29 2018
STATUS
approved