A371908 a(n) = 2-adic valuation of A008336(2*n).
0, 1, 3, 2, 5, 4, 2, 1, 5, 4, 2, 1, 4, 3, 1, 0, 5, 4, 2, 1, 4, 3, 1, 0, 4, 3, 1, 0, 3, 2, 0, 1, 7, 6, 4, 3, 0, 1, 3, 2, 6, 5, 3, 2, 5, 4, 2, 1, 6, 5, 3, 4, 1, 0, 2, 1, 5, 4, 2, 1, 4, 3, 1, 0, 7, 6, 4, 3, 0, 1, 3, 2, 6, 5, 3, 2, 5, 4, 2, 1, 6, 5, 3, 2, 5, 4, 2
Offset: 1
Examples
Let b(n) = A008336(n) and let f(x) = A007814(x). a(1) = 0 since b(2*1) = 1 and f(b(2)) = 0. a(2) = 1 since b(2*2) = 6 and f(b(4)) = 1. a(3) = 3 since b(2*3) = 120 and f(b(6)) = 3, etc.
Links
- Michael De Vlieger, Table of n, a(n) for n = 1..10000
Programs
-
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]]
-
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 A371908_list = list(islice(A371908_gen(),20)) # Chai Wah Wu, Apr 15 2024
Comments