login
A138255
Smallest positive integer m such that n divides [2^m/m] (=A000799(m)).
9
1, 1, 5, 4, 6, 5, 9, 8, 7, 6, 12, 15, 14, 9, 13, 8, 10, 7, 21, 28, 13, 24, 48, 15, 22, 14, 19, 9, 30, 13, 11, 8, 31, 10, 13, 21, 38, 21, 14, 39, 22, 13, 29, 63, 13, 67, 135, 65, 43, 22, 10, 15, 35, 19, 24, 9, 21, 30, 120, 28, 62, 11, 13, 16, 14, 31, 69, 20, 67, 13, 145, 21, 19, 38
OFFSET
1,3
COMMENTS
This sequence is well-defined.
LINKS
Romanian Master in Mathematics Contest, Problem 3, Bucharest, 2007.
MAPLE
f:= proc(n) local m;
for m from 1 do if floor(2^m/m) mod n = 0 then return m fi od
end proc:
map(f, [$1..100]); # Robert Israel, Jun 07 2018
MATHEMATICA
a[n_] := For[m = 1, True, m++, If[Divisible[Floor[2^m/m], n], Return[m]]];
Array[a, 100] (* Jean-François Alcover, Mar 22 2019 *)
PROG
(Python)
from itertools import count
def A138255(n): return next(m for m in count(1) if not (1<<m)//m%n) # Chai Wah Wu, Aug 24 2023
KEYWORD
nonn
AUTHOR
Max Alekseyev, Mar 09 2008
STATUS
approved