cp's OEIS Frontend

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.

A274593 a(0) = 0; thereafter, a(2*n+1) = a(n)+2*n+1, otherwise a(n) = n.

This page as a plain text file.
%I A274593 #33 Jul 14 2022 02:19:55
%S A274593 0,1,2,4,4,7,6,11,8,13,10,18,12,19,14,26,16,25,18,32,20,31,22,41,24,
%T A274593 37,26,46,28,43,30,57,32,49,34,60,36,55,38,71,40,61,42,74,44,67,46,88,
%U A274593 48,73,50,88,52,79,54,101,56,85,58,102
%N A274593 a(0) = 0; thereafter, a(2*n+1) = a(n)+2*n+1, otherwise a(n) = n.
%C A274593 a(n) gives the sum of the values k for which 2^j*(k+1)-1 = n (A153733(n) gives the least value of k).
%C A274593 In general, for i >= 2, in the sequences of type "a(0) = 0; thereafter, a(i*n+1) = a(n)+i*n+1, otherwise a(n) = n.", a(n) gives the sum of the values k for which (i^j*((i-1)*(k+1)-i+2)-1)/(i-1) = n.
%H A274593 Robert Israel, <a href="/A274593/b274593.txt">Table of n, a(n) for n = 0..10000</a>
%F A274593 a(n) = (2^A001511(n+1)-1)*(2*A025480(n)+1)-A001511(n+1).
%F A274593 From _Robert Israel_, Jul 04 2016: (Start)
%F A274593 G.f. g(x) satisfies g(x) = x*g(x^2) + x/(1-x)^2.
%F A274593 a(n) = 2*n + 1 - A007814(n+1) - A000265(n+1). (End)
%e A274593 11 = 2^0*(11+1)-1 = 2^1*(5+1)-1 = 2^2*(2+1)-1, so a(11) = 11+5+2 = 18.
%p A274593 f:= proc(n) option remember; if n::even then n else n + procname((n-1)/2) fi end proc:
%p A274593 map(f, [$0..100]); # _Robert Israel_, Jul 04 2016
%t A274593 a[0] = 0; a[n_] := a[n] = If[OddQ@ n, a[#] + 2 # + 1 &[(n - 1)/2], n]; Table[a@ n, {n, 0, 59}] (* _Michael De Vlieger_, Jul 04 2016 *)
%o A274593 (Python)
%o A274593 def A274593(n): return (((m:=~(n+1)&n)<<1)+1)*((n>>(k:=m.bit_length()))|1)-k-1 # _Chai Wah Wu_, Jul 13 2022
%Y A274593 Cf. A001511, A000265, A007814, A025480, A153733.
%K A274593 nonn,look
%O A274593 0,3
%A A274593 _Gionata Neri_, Jul 03 2016