OFFSET
1,3
LINKS
Michael De Vlieger, Table of n, a(n) for n = 1..10000
EXAMPLE
MATHEMATICA
k = 1; nn = 240; p[_] := 0; r = 0; q = Prime[k];
{0}~Join~Reap[
Do[If[AnyTrue[#, p[#1] < #2 & @@ # &],
Map[p[#1] += #2 & @@ # &, #],
Map[p[#1] -= #2 & @@ # &, #] ] &@
Map[{PrimePi[#1], #2} & @@ # &, FactorInteger[n]];
If[Divisible[n, q], Sow[p[k] ] ], {n, nn}] ][[-1, 1]]
PROG
(Python)
from itertools import count, islice
def A371908_gen(): # generator of terms
m = 1
for n in count(1, 2):
a, b = divmod(m, n)
m = m*n if b else a
yield (~m&m-1).bit_length()
a, b = divmod(m, n+1)
m = m*(n+1) if b else a
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Michael De Vlieger, Apr 11 2024
STATUS
approved