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.

Showing 1-3 of 3 results.

A006127 a(n) = 2^n + n.

Original entry on oeis.org

1, 3, 6, 11, 20, 37, 70, 135, 264, 521, 1034, 2059, 4108, 8205, 16398, 32783, 65552, 131089, 262162, 524307, 1048596, 2097173, 4194326, 8388631, 16777240, 33554457, 67108890, 134217755, 268435484, 536870941, 1073741854, 2147483679, 4294967328, 8589934625
Offset: 0

Views

Author

Keywords

Comments

For numbers m=n+2^n such that equation x=2^(m-x) has solution x=2^n, see A103354. - Zak Seidov, Mar 23 2005
Primes of the form x^x+1 must be of the form 2^2^(a(n))+1, that is, Fermat number F_(a(n)) (Sierpiński 1958). - David W. Wilson, May 08 2005
a(n) = n-th Mersenne number + n + 1 = A000225(n) + n + 1. Partial sums of a(n) are A132925(n+1). - Jaroslav Krizek, Oct 16 2009
Intersection of A188916 and A188917: A188915(a(n)) = (2^n)^2 = 2^(2*n) = A000302(n). - Reinhard Zumkeller, Apr 14 2011
a(n) is also the number of all connected subtrees of a star tree, having n leaves. The star tree is a tree, where all n leaves are connected to one parent P. - Viktar Karatchenia, Feb 29 2016

Examples

			From _Viktar Karatchenia_, Feb 29 2016: (Start)
a(0) = 1. There are n=0 leaves, it is a trivial tree consisting of a single parent node P.
a(1) = 3. There is n=1 leaf, the tree is P-A, the subtrees are: 2 singles: P, A; 1 pair: P-A; 2+1 = 3 subtrees in total.
a(2) = 6. When n=2, the tree is P-A P-B, the subtrees are: 3 singles: P, A, B; 2 pairs: P-A, P-B; 1 triple: A-P-B (the whole tree); 3+2+1 = 6.
a(3) = 11. For n=3 leaf nodes, the tree is P-A P-B P-C, the subtrees are: 4 singles: P, A, B, C; 3 pairs: P-A, P-B, P-C; 3 triples: A-P-B, A-P-C, B-P-C; 1 quad: P-A P-B P-C (the whole tree); 4+3+3+1 = 11 in total.
a(4) = 20. For n=4 leaves, the tree is P-A P-B P-C P-D, the subtrees are: 5 singles: P, A, B, C, D; 4 pairs: P-A, P-B, P-C, P-D; 6 triples: A-P-B, A-P-C, B-P-C, A-P-D, B-P-D, C-P-D; 4 quads: P-A P-B P-C, P-A P-B P-D, P-A P-C P-D, P-B P-C P-D; the whole tree counts as 1; 5+4+6+4+1 = 20.
In general, for n leaves, connected to the parent node P, there will be: (n+1) singles; (n, 1) pairs; (n, 2) triples; (n, 3) quads; ... ; (n, n-1) subtrees having (n-1) edges; 1 whole tree, having all n edges. Thus, the total number of all distinct subtrees is: (n+1) + (n, 1) + (n, 2) + (n, 3) + ... + (n, n-1) + 1 = (n + (n, 0)) + (n, 1) + (n, 2) + (n, 3) + ... + (n, n-1) + (n, n) = n + (sum of all binomial coefficients of size n) = n + (2^n). (End)
		

References

  • John H. Conway, R. K. Guy, The Book of Numbers, Copernicus Press, p. 84.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Cf. A135227, A000079, A052944; A000051 (first differences).
Cf. A000325.

Programs

  • Haskell
    a006127 n = a000079 n + n
    a006127_list = s [1] where
       s xs = last xs : (s $ zipWith (+) [1..] (xs ++ reverse xs))
    Reinhard Zumkeller, May 19 2015, Feb 05 2011
    
  • Maple
    A006127:=(-1+z+z**2)/(2*z-1)/(z-1)**2; # conjectured by Simon Plouffe in his 1992 dissertation
  • Mathematica
    Table[2^n + n, {n, 0, 50}] (* Vladimir Joseph Stephan Orlovsky, May 19 2011 *)
    Table[BitXOr(i, 2^i), {i, 1, 100}] (* Peter Luschny, Jun 01 2011 *)
    LinearRecurrence[{4,-5,2},{1,3,6},40] (* Harvey P. Dale, Feb 08 2023 *)
  • PARI
    a(n)=1<Charles R Greathouse IV, Jul 19 2011
    
  • Python
    print([2**n + n for n in range(34)]) # Karl V. Keller, Jr., Aug 18 2020
    
  • Python
    def A006127(n): return (1<Chai Wah Wu, Jan 11 2023

Formula

Row sums of triangle A135227. - Gary W. Adamson, Nov 23 2007
Partial sums of A094373. G.f.: (1-x-x^2)/((1-x)^2(1-2x)). - Paul Barry, Aug 05 2004
Binomial transform of [1,2,1,1,1,1,1,...]. - Franklin T. Adams-Watters, Nov 29 2006
a(n) = 2*a(n-1) - n + 2 (with a(0)=1). - Vincenzo Librandi, Dec 30 2010
E.g.f.: exp(x)*(exp(x) + x). - Stefano Spezia, Dec 10 2021

A188915 Union of squares and powers of 2.

Original entry on oeis.org

0, 1, 2, 4, 8, 9, 16, 25, 32, 36, 49, 64, 81, 100, 121, 128, 144, 169, 196, 225, 256, 289, 324, 361, 400, 441, 484, 512, 529, 576, 625, 676, 729, 784, 841, 900, 961, 1024, 1089, 1156, 1225, 1296, 1369, 1444, 1521, 1600, 1681, 1764, 1849, 1936, 2025, 2048, 2116, 2209, 2304, 2401, 2500, 2601, 2704, 2809, 2916
Offset: 0

Views

Author

Reinhard Zumkeller, Apr 14 2011

Keywords

Comments

A188916 and A188917 give positions where squares and powers of 2 occur:
n^2: a(A188916(n)) = A000290(n);
2^n: a(A188917(n)) = A000079(n);
4^n: a(A006127(n)) = A000302(n), A006127 is the intersection of A188916 and A188917.

Crossrefs

Union of A000290 and A000079.
Disjoint union of A000290 and A004171.

Programs

  • Haskell
    import Data.List.Ordered (union)
    a188915 n = a188915_list !! n
    a188915_list = union a000290_list a000079_list
    -- Reinhard Zumkeller, May 19 2015, Apr 14 2011
    
  • Mathematica
    seq[lim_] := Union[2^Range[1, Floor[Log2[lim]], 2], Range[0, Floor[Sqrt[lim]]]^2]; seq[3000] (* Amiram Eldar, Apr 13 2025 *)
  • Python
    from math import isqrt
    def A188915(n):
        def bisection(f,kmin=0,kmax=1):
            while f(kmax) > kmax: kmax <<= 1
            while kmax-kmin > 1:
                kmid = kmax+kmin>>1
                if f(kmid) <= kmid:
                    kmax = kmid
                else:
                    kmin = kmid
            return kmax
        def f(x): return n+x-isqrt(x)-((m:=x.bit_length()-1)>>1)-(m&1)
        return bisection(f,n-1,n**2) # Chai Wah Wu, Sep 19 2024

Formula

A010052(a(n)) + A209229(a(n)) > 0. - Reinhard Zumkeller, May 19 2015
Sum_{n>=1} 1/a(n) = Pi^2/6 + 2/3. - Amiram Eldar, Apr 13 2025

A188917 Where powers of 2 occur in the union of squares and powers of 2.

Original entry on oeis.org

1, 2, 3, 4, 6, 8, 11, 15, 20, 27, 37, 51, 70, 97, 135, 189, 264, 371, 521, 734, 1034, 1459, 2059, 2908, 4108, 5805, 8205, 11599, 16398, 23185, 32783, 46356, 65552, 92698, 131089, 185381, 262162, 370746, 524307, 741475, 1048596, 1482931, 2097173, 2965842, 4194326, 5931664, 8388631
Offset: 0

Views

Author

Reinhard Zumkeller, Apr 14 2011

Keywords

Comments

A188915(a(n)) = A000079(n); A188915(A188916(n)) = A000290(n).

Crossrefs

Programs

  • Haskell
    a188917 n = a188917_list !! n
    a188917_list = filter ((== 1) . a209229. a188915) [0..]
    -- Reinhard Zumkeller, May 19 2015
    
  • Maple
    seq(floor((n+1)/2) + floor(2^(n/2)), n=0..100); # Robert Israel, Jun 13 2019
  • Mathematica
    Table[Floor[(n+1)/2] + Floor[2^(n/2)], {n, 0, 50}] (* Paolo Xausa, Oct 01 2024 *)
  • Python
    from math import isqrt
    def A188917(n): return (n+1>>1)+isqrt(1<Chai Wah Wu, Oct 01 2024

Formula

a(n) = floor((n+1)/2) + floor(2^(n/2)). - Robert Israel, Jun 13 2019
Showing 1-3 of 3 results.