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.

A330038 a(1) = 1, a(n) = [n/2] + a([n/2]) + a([(n+1)/2]) for n > 1, where [x] = floor(x).

This page as a plain text file.
%I A330038 #28 Sep 08 2022 08:46:24
%S A330038 1,3,5,8,10,13,16,20,22,25,28,32,35,39,43,48,50,53,56,60,63,67,71,76,
%T A330038 79,83,87,92,96,101,106,112,114,117,120,124,127,131,135,140,143,147,
%U A330038 151,156,160,165,170,176,179,183,187,192,196,201,206,212,216,221,226,232
%N A330038 a(1) = 1, a(n) = [n/2] + a([n/2]) + a([(n+1)/2]) for n > 1, where [x] = floor(x).
%C A330038 a(n) is a sharp lower bound of the greatest whole number k such that there is a hypergraph (V, H) with |V| = k having no isolated vertices and containing no partitions of size greater than n (see Brian & Larson link, i.e. Definition 3.1, Lemma 4.2 and Proof of Theorem 4.6).
%C A330038 Partial sums of A063787. - _Robert Israel_, Nov 28 2019
%H A330038 Will Brian and Paul B. Larson, <a href="https://arxiv.org/abs/1908.10914">Choosing between incompatible ideals</a>, arXiv:1908.10914 [math.CO], 2019.
%F A330038 G.f. g(z) satisfies g(z) = z^2/((1+z)(1-z)^2) + (1+z)^2 g(z^2)/z. - _Robert Israel_, Nov 28 2019
%F A330038 From _Kevin Ryde_, Dec 16 2021: (Start)
%F A330038 a(n) = A000788(n-1) + n.
%F A330038 a(n) = (1/2) * Sum_{i=1..k} (e[i]+2*i) * 2^e[i], where binary expansion n = 2^e[1] + ... + 2^e[k] with descending exponents e[1] > e[2] > ... > e[k] (A272011).
%F A330038 (End)
%p A330038 f:= proc(n) option remember;
%p A330038 floor(n/2) + procname(floor(n/2)) + procname(floor((n+1)/2))
%p A330038 end proc:
%p A330038 f(1):= 1:
%p A330038 map(f, [$1..100]); # _Robert Israel_, Nov 28 2019
%t A330038 a[1] = 1; a[n_] := a[n] = Floor[n/2] + a[Floor[n/2]] + a[Floor[(n + 1)/2]];  Array[a, 60] (* _Amiram Eldar_, Nov 28 2019 *)
%o A330038 (Magma) I:=[1]; [n le 1 select I[n] else Floor(n/2)+Self(Floor(n/2))+Self(Floor((n+1)/2)): n in [1..60]];
%o A330038 (PARI) a(n) = my(v=binary(n),t=#v); for(i=1,#v, if(v[i],v[i]=t++,t--);); fromdigits(v,2)>>1; \\ _Kevin Ryde_, Dec 16 2021
%o A330038 (Python) # Kevin Ryde's first formula
%o A330038 def a(n): return sum(bin(i).count("1") for i in range(n)) + n
%o A330038 print([a(n) for n in range(1, 61)]) # _Michael S. Branicky_, Dec 16 2021
%o A330038 (Python) # Kevin Ryde's second formula
%o A330038 def a(n):
%o A330038     b = list(map(int, bin(n)[2:]))
%o A330038     e = [i for i, bi in enumerate(b[::-1]) if bi][::-1]
%o A330038     return sum((ei + 2*i)*2**ei for i, ei in enumerate(e, 1))//2
%o A330038 print([a(n) for n in range(1, 61)]) # _Michael S. Branicky_, Dec 16 2021
%Y A330038 Cf. A004526, A063787 (first differences), A000788, A272011.
%Y A330038 Cf. A144935, A325831.
%K A330038 nonn
%O A330038 1,2
%A A330038 _Stefano Spezia_, Nov 28 2019