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-2 of 2 results.

A220466 a((2*n-1)*2^p) = 4^p*(n-1) + 2^(p-1)*(1+2^p), p >= 0 and n >= 1.

Original entry on oeis.org

1, 3, 2, 10, 3, 7, 4, 36, 5, 11, 6, 26, 7, 15, 8, 136, 9, 19, 10, 42, 11, 23, 12, 100, 13, 27, 14, 58, 15, 31, 16, 528, 17, 35, 18, 74, 19, 39, 20, 164, 21, 43, 22, 90, 23, 47, 24, 392, 25, 51, 26, 106, 27, 55, 28, 228, 29, 59, 30, 122, 31, 63, 32, 2080, 33, 67, 34, 138, 35
Offset: 1

Views

Author

Johannes W. Meijer, Dec 24 2012

Keywords

Comments

The a(n) appeared in the analysis of A220002, a sequence related to the Catalan numbers.
The first Maple program makes use of a program by Peter Luschny for the calculation of the a(n) values. The second Maple program shows that this sequence has a beautiful internal structure, see the first formula, while the third Maple program makes optimal use of this internal structure for the fast calculation of a(n) values for large n.
The cross references lead to sequences that have the same internal structure as this sequence.

Crossrefs

Cf. A000027 (the natural numbers), A000120 (1's-counting sequence), A000265 (remove 2's from n), A001316 (Gould's sequence), A001511 (the ruler function), A003484 (Hurwitz-Radon numbers), A003602 (a fractal sequence), A006519 (highest power of 2 dividing n), A007814 (binary carry sequence), A010060 (Thue-Morse sequence), A014577 (dragon curve), A014707 (dragon curve), A025480 (nim-values), A026741, A035263 (first Feigenbaum symbolic sequence), A037227, A038712, A048460, A048896, A051176, A053381 (smooth nowhere-zero vector fields), A055975 (Gray code related), A059134, A060789, A060819, A065916, A082392, A085296, A086799, A088837, A089265, A090739, A091512, A091519, A096268, A100892, A103391, A105321 (a fractal sequence), A109168 (a continued fraction), A117973, A129760, A151930, A153733, A160467, A162728, A181988, A182241, A191488 (a companion to Gould's sequence), A193365, A220466 (this sequence).

Programs

  • Haskell
    -- Following Ralf Stephan's recurrence:
    import Data.List (transpose)
    a220466 n = a006519_list !! (n-1)
    a220466_list = 1 : concat
       (transpose [zipWith (-) (map (* 4) a220466_list) a006519_list, [2..]])
    -- Reinhard Zumkeller, Aug 31 2014
  • Maple
    # First Maple program
    a := n -> 2^padic[ordp](n, 2)*(n+1)/2 : seq(a(n), n=1..69); # Peter Luschny, Dec 24 2012
    # Second Maple program
    nmax:=69: for p from 0 to ceil(simplify(log[2](nmax))) do for n from 1 to ceil(nmax/(p+2)) do a((2*n-1)*2^p) := 4^p*(n-1)  + 2^(p-1)*(1+2^p) od: od: seq(a(n), n=1..nmax);
    # Third Maple program
    nmax:=69: for p from 0 to ceil(simplify(log[2](nmax))) do n:=2^p: n1:=1: while n <= nmax do a(n) := 4^p*(n1-1)+2^(p-1)*(1+2^p): n:=n+2^(p+1): n1:= n1+1: od: od:  seq(a(n), n=1..nmax);
  • Mathematica
    A220466 = Module[{n, p}, p = IntegerExponent[#, 2]; n = (#/2^p + 1)/2; 4^p*(n - 1) + 2^(p - 1)*(1 + 2^p)] &; Array[A220466, 50] (* JungHwan Min, Aug 22 2016 *)
  • PARI
    a(n)=if(n%2,n\2+1,4*a(n/2)-2^valuation(n/2,2)) \\ Ralf Stephan, Dec 17 2013
    

Formula

a((2*n-1)*2^p) = 4^p*(n-1) + 2^(p-1)*(1+2^p), p >= 0 and n >= 1. Observe that a(2^p) = A007582(p).
a(n) = ((n+1)/2)*(A060818(n)/A060818(n-1))
a(n) = (-1/64)*(q(n+1)/q(n))/(2*n+1) with q(n) = (-1)^(n+1)*2^(4*n-5)*(2*n)!*A060818(n-1) or q(n) = (1/8)*A220002(n-1)*1/(A098597(2*n-1)/A046161(2*n))*1/(A008991(n-1)/A008992(n-1))
Recurrence: a(2n) = 4a(n) - 2^A007814(n), a(2n+1) = n+1. - Ralf Stephan, Dec 17 2013

A105321 Convolution of binomial(1,n) and Gould's sequence A001316.

Original entry on oeis.org

1, 3, 4, 6, 6, 6, 8, 12, 10, 6, 8, 12, 12, 12, 16, 24, 18, 6, 8, 12, 12, 12, 16, 24, 20, 12, 16, 24, 24, 24, 32, 48, 34, 6, 8, 12, 12, 12, 16, 24, 20, 12, 16, 24, 24, 24, 32, 48, 36, 12, 16, 24, 24, 24, 32, 48, 40, 24, 32, 48, 48, 48, 64, 96, 66, 6, 8, 12, 12, 12, 16, 24, 20, 12, 16
Offset: 0

Views

Author

Paul Barry, Apr 01 2005

Keywords

Comments

A universal function related to the spherical growth of repeated truncations of maps.
a(n) = (number of ones in row n of triangle A249133) = (number of odd terms in row n of triangle A249095) = A000120(A249184(n)). - Reinhard Zumkeller, Nov 14 2014

Examples

			From _Omar E. Pol_, May 29 2010: (Start)
If written as a triangle:
  1;
  3;
  4;
  6,6;
  6,8,12,10;
  6,8,12,12,12,16,24,18;
  6,8,12,12,12,16,24,20,12,16,24,24,24,32,48,34;
  6,8,12,12,12,16,24,20,12,16,24,24,24,32,48,36,12,16,24,24,24,32,48,40,24,32,48,48,48,64,96,66; (End)
		

Crossrefs

Programs

  • Haskell
    a105321 n = if n == 0 then 1 else a001316 n + a001316 (n - 1)
    -- Reinhard Zumkeller, Nov 14 2014
    
  • Maple
    nmax := 74: A001316 := n -> if n <= -1 then 0 else 2^add(i, i=convert(n, base, 2)) fi: for p from 0 to ceil(log[2](nmax)) do for n from 1 to nmax/(p+2)+1 do a((2*n-1)*2^p) := (2^p+2)  * A001316(n-1) od: od: a(0) :=1: seq(a(n), n=0..nmax); # Johannes W. Meijer, Jan 28 2013
  • Mathematica
    f[n_] := Sum[Binomial[1, n - k]Mod[Binomial[k, j], 2], {k, 0, n}, {j, 0, k}]; Array[f, 75, 0] (* Robert G. Wilson v, Jun 28 2010 *)
  • PARI
    a(n) = sum(k=0, n, binomial(1, n-k)*sum(j=0, k, binomial(k, j) % 2)); \\ Michel Marcus, Apr 29 2018
    
  • Python
    def A105321(n): return (1<Chai Wah Wu, Jul 30 2025
    
  • Python
    # (fast way for big vectors)
    import numpy # (version >= 2.0.0)
    n_up_to = 2**22
    A000079 = 1 << numpy.arange(n_up_to.bit_length())
    A001316 = A000079[(numpy.bitwise_count(numpy.arange(n_up_to)))]
    A105321 = A001316
    A105321[1:] += A001316[0:-1]
    print(A105321[0:100]) # Karl-Heinz Hofmann, Aug 01 2025

Formula

G.f. (1+x)*Product{k>=0, 1+2x^(2^k)};
a(n) = Sum_{k=0..n, binomial(1, n-k)*Sum_{j=0..k, binomial(k, j) mod 2}}.
a(n) = 2*A048460(n) for n>=2. - Omar E. Pol, Jan 02 2011
a((2*n-1)*2^p) = (2^p+2)*A001316(n-1), p >= 0 and n >= 1, with a(0) = 1. - Johannes W. Meijer, Jan 28 2013
a(n) = A001316(n) + A001316(n-1) for n > 0. - Reinhard Zumkeller, Nov 14 2014
Showing 1-2 of 2 results.