OFFSET
1,2
COMMENTS
a(2^k) = 2^k. - Robert G. Wilson v, Feb 22 2005
Fixed points: A029747. - Reinhard Zumkeller, Aug 23 2006
Question: Is there a simple proof that a(c) = c would never allow an odd composite c as a solution? See also A364551. - Antti Karttunen, Jul 30 2023
REFERENCES
J. H. Conway, personal communication.
N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
LINKS
FORMULA
a(n) = h(g(n,1,1), 0) / 2 + 1 with h(n, m) = if n=0 then m else h(floor(n/2), 2*m + n mod 2) and g(n, i, x) = if n=1 then x else (if n mod prime(i) = 0 then g(n/prime(i), i, 2*x+1) else g(n, i+1, 2*x)). - Reinhard Zumkeller, Aug 23 2006
a(n) = 1 + A156552(n). - Antti Karttunen, Jun 26 2014
MAPLE
A005941 := proc(n)
local k ;
for k from 1 do
if A005940(k) = n then # code reuse
return k;
end if;
end do ;
end proc: # R. J. Mathar, Mar 06 2010
MATHEMATICA
f[n_] := Block[{p = Partition[ Split[ Join[ IntegerDigits[n - 1, 2], {2}]], 2]}, Times @@ Flatten[ Table[q = Take[p, -i]; Prime[ Count[ Flatten[q], 0] + 1]^q[[1, 1]], {i, Length[p]}] ]]; t = Table[ f[n], {n, 10^5}]; Flatten[ Table[ Position[t, n, 1, 1], {n, 64}]] (* Robert G. Wilson v, Feb 22 2005 *)
PROG
(Python)
from sympy import primepi, factorint
def A005941(n): return sum((1<<primepi(p)-1)<<i for i, p in enumerate(factorint(n, multiple=True)))+1 # Chai Wah Wu, Mar 11 2023
(PARI) A005941(n) = { my(f=factor(n), p, p2=1, res=0); for(i=1, #f~, p = 1 << (primepi(f[i, 1])-1); res += (p * p2 * (2^(f[i, 2])-1)); p2 <<= f[i, 2]); (1+res) }; \\ (After David A. Corneth's program for A156552) - Antti Karttunen, Jul 30 2023
CROSSREFS
KEYWORD
nonn
AUTHOR
EXTENSIONS
More terms from Robert G. Wilson v, Feb 22 2005
a(61) inserted by R. J. Mathar, Mar 06 2010
STATUS
approved