A145819 Union of A145812 and A145818 with double repetition of 1, so that a(1)=1, a(2)=1.
1, 1, 3, 5, 9, 11, 17, 21, 33, 35, 41, 43, 65, 69, 81, 85, 129, 131, 137, 139, 161, 163, 169, 171, 257, 261, 273, 277, 321, 325, 337, 341
Offset: 1
This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
If n=13, we have n-1 = 12 = 2^3 + 2^2. Therefore a(13) = 1 + 2(4^3 + 4^2) = 161. If m=521 and thus 2(521-1) = 1040 = 2^10 + 2^4, then the equation a(x)=521 has the unique solution x = 2^4 + 2^1 + 1 = 19. [_Vladimir Shevelev_, Oct 25 2008]
a145812 n = a145812_list !! (n-1) a145812_list = filter f [1, 3 ..] where f v = v == 0 || even w && f w where w = v `div` 4 -- Reinhard Zumkeller, Mar 13 2014
filter:= proc(n) local L; L:= convert(n,base,2); andmap(i -> L[2*i+1]=0,[$1..(nops(L)-1)/2]) end proc: select(filter, [seq(i,i=1..10000,2)]); # Robert Israel, Aug 20 2017
a[1]=1; a[2]=3; a[n_] := a[n] = If[OddQ[n], 4*a[(n+1)/2]-3, 4*a[n/2]-1]; Array[a, 50] (* Jean-François Alcover, Nov 14 2017, after Robert Israel *)
isok(n) = {if (! (n % 2), return (0)); b = binary(n); forstep (i = #b, 1, -1, rpos = #b - i + 1; if ((rpos > 1) && (rpos % 2) && b[i], return (0));); return (1);} \\ Michel Marcus, Jan 19 2014
If m=46, then we have 46=1*3^0+2*3^2+1*3^3, thus a(l)=1+1*3^3=28 and the required decomposition is: 46=28+3*4, such that a(s)=4. We see that l=4, s=2, i.e. "index coordinates" of 46 are (4, 2). Thus we have a one-to-one map of integers m==1(mod 3), m>=4, to the positive lattice points on the plane.
isok(n) = {my(d=Vecrev(digits(n, 3)), k=3); while (k <= #d, if (d[k], return (0)); k += 2;); d[1] == 1;} \\ Michel Marcus, Dec 09 2018
fQ[n_] := Module[{d = Reverse[IntegerDigits[n, 3]], k = 3, ans = True}, While[k <= Length[d], If[d[[k]] > 0, ans = False]; k += 2]; ans && d[[1]] == 1]; aQ[n_] := Mod[n + 1, 3] == 0 && fQ[(n + 1)/3]; Select[Range[10000], aQ] (* Amiram Eldar, Dec 09 2018 *)
isa(n) = {my(d=Vecrev(digits(n, 3)), k=3); while (k <= #d, if (d[k], return (0)); k += 2;); d[1] == 1;} \\ A146085 isok(n) = !((n+1) % 3) && isa((n+1)/3); \\ Michel Marcus, Dec 09 2018
isa(n) = {my(d=Vecrev(digits(n, 3)), k=3); while (k <= #d, if (d[k], return (0)); k += 2;); d[1] == 1;} \\ A146085 isok(n) = !((n+2) % 3) && isa((n+2)/3); \\ Michel Marcus, Dec 09 2018
Comments