A130249 Maximal index k of a Jacobsthal number such that A001045(k)<=n (the 'lower' Jacobsthal inverse).
0, 2, 2, 3, 3, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8
Offset: 0
Keywords
Examples
a(12)=5, since A001045(5)=11<=12, but A001045(6)=21>12.
Links
- G. C. Greubel, Table of n, a(n) for n = 0..10000
Crossrefs
Programs
-
Magma
[Floor(Log(3*n+1)/Log(2)): n in [0..30]]; // G. C. Greubel, Jan 08 2018
-
Mathematica
Table[Floor[Log[2, 3*n + 1]], {n, 0, 50}] (* G. C. Greubel, Jan 08 2018 *)
-
PARI
for(n=0, 30, print1(floor(log(3*n+1)/log(2)), ", ")) \\ G. C. Greubel, Jan 08 2018
-
PARI
a(n) = logint(3*n+1, 2); \\ Ruud H.G. van Tol, May 12 2024
-
Python
def A130249(n): return (3*n+1).bit_length()-1 # Chai Wah Wu, Jun 08 2022
Formula
a(n) = floor(log_2(3n+1)).
G.f.: 1/(1-x)*(Sum_{k>=1} x^A001045(k)).
a(n) = A000523(3*n+1). - Ruud H.G. van Tol, May 12 2024
Comments