OFFSET
1,2
COMMENTS
Next term after 409879 is greater than 10^6.
a(22) > 10^8. - Martin Fuller, Feb 25 2026
EXAMPLE
floor((4/3)^21) = 420 and 420 is divisible by 21, so 21 is in the sequence.
MATHEMATICA
t = 1; Do[t = 4t/3; If[Mod[Floor[t], n] == 0, Print[n]], {n, 10^6}]
PROG
(Python)
from itertools import count, islice
def A118502_gen(): # generator of terms
m, k = 1, 1
for n in count(1):
m <<= 2
k *= 3
if m//k % n == 0:
yield n
(PARI) \\ It is faster to update mixed fractions a+(b/c) than to divide 4^k/3^k each iteration.
{ my(a=1, b=0, c=1);
for(k=1, 10^6,
my(r = divrem(a<<2, 3)); a=r[1]; r=r[2];
b <<= 2; if(r==1, b+=c, r==2, b+=c<<1);
c *= 3;
if(b >= c, a++; b-=c);
if(a % k == 0, print1(k, ", "));
); } \\ Martin Fuller, Feb 25 2026
CROSSREFS
KEYWORD
nonn,more
AUTHOR
Ryan Propper, May 06 2006
EXTENSIONS
a(18) from Ryan Propper, Jul 21 2006
a(19) from Chai Wah Wu, Feb 13 2026
a(20),a(21) from Martin Fuller, Feb 25 2026
STATUS
approved
