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

A327492 Partial sums of A327491.

Original entry on oeis.org

0, 2, 3, 5, 7, 9, 10, 12, 15, 17, 18, 20, 22, 24, 25, 27, 31, 33, 34, 36, 38, 40, 41, 43, 46, 48, 49, 51, 53, 55, 56, 58, 63, 65, 66, 68, 70, 72, 73, 75, 78, 80, 81, 83, 85, 87, 88, 90, 94, 96, 97, 99, 101, 103, 104, 106, 109, 111, 112, 114, 116, 118, 119
Offset: 0

Views

Author

Peter Luschny, Sep 27 2019

Keywords

Crossrefs

Programs

  • Julia
    bitcount(n) = sum(digits(n, base = 2))
    A327492(n) = 2n - bitcount(n) + mod(n, 2)
    [A327492(n) for n in 0:62] |> println # Peter Luschny, Oct 03 2019
  • Maple
    # For len >= 1:
    A327492_list := len -> ListTools:-PartialSums([seq(A327491(j), j=0..len-1)]):
    A327492_list(99)
  • Mathematica
    a[n_] := 2*n + Mod[n, 2] - DigitCount[2*n, 2, 1]; Array[a, 100, 0] (* Amiram Eldar, Aug 30 2024 *)
  • PARI
    seq(n)={my(a=vector(n+1)); for(n=1, n, a[n+1] = a[n] + if(n%4, n%2 + 1, valuation(n,2))); a} \\ Andrew Howroyd, Sep 28 2019
    
  • PARI
    a(n) = n<<1 - hammingweight(n) + bittest(n,0); \\ Kevin Ryde, May 31 2022
    
  • SageMath
    @cached_function
    def A327492(n):
        if n == 0: return 0
        r = valuation(n, 2) if 4.divides(n) else n % 2 + 1
        return r + A327492(n-1)
    print([A327492(n) for n in (0..19)])
    

Formula

a(n) = A005187(n) + n mod 2.
a(n) ~ 2*n. - Amiram Eldar, Aug 30 2024

A327491 a(0) = 0. If 4 divides n then a(n) = valuation(n, 2) else a(n) = (n mod 2) + 1.

Original entry on oeis.org

0, 2, 1, 2, 2, 2, 1, 2, 3, 2, 1, 2, 2, 2, 1, 2, 4, 2, 1, 2, 2, 2, 1, 2, 3, 2, 1, 2, 2, 2, 1, 2, 5, 2, 1, 2, 2, 2, 1, 2, 3, 2, 1, 2, 2, 2, 1, 2, 4, 2, 1, 2, 2, 2, 1, 2, 3, 2, 1, 2, 2, 2, 1, 2, 6, 2, 1, 2, 2, 2, 1, 2, 3, 2, 1, 2, 2, 2, 1, 2, 4, 2, 1, 2, 2, 2, 1, 2
Offset: 0

Views

Author

Peter Luschny, Sep 27 2019

Keywords

Examples

			Seen as an irregular table for n >= 1:
  2,
  1, 2,
  2, 2, 1, 2,
  3, 2, 1, 2, 2, 2, 1, 2,
  4, 2, 1, 2, 2, 2, 1, 2, 3, 2, 1, 2, 2, 2, 1, 2,
  5, 2, 1, 2, 2, 2, 1, 2, 3, 2, 1, 2, 2, 2, 1, 2, 4, 2, 1, 2, ....
		

Crossrefs

Programs

  • Maple
    A327491 := n -> if n = 0 then 0
    elif 0 = irem(n, 4) then padic[ordp](n, 2)
    elif 0 = irem(n, 2) then 1 else 2 fi:
    seq(A327491(n), n=0..87);
  • Mathematica
    a[0] = 0; a[n_] := If[Divisible[n, 4], IntegerExponent[n, 2], Mod[n, 2] + 1]; Array[a, 100, 0] (* Amiram Eldar, Aug 30 2024 *)
  • PARI
    a(n)={if(n==0, 0, if(n%4, n%2 + 1, valuation(n,2)))} \\ Andrew Howroyd, Sep 28 2019
  • SageMath
    def A327491(n):
        if n == 0: return 0
        if 4.divides(n): return valuation(n, 2)
        return n % 2 + 1
    print([A327491(n) for n in (0..87)])
    

Formula

a(0) = 0; if n is odd then a(n) = 2, otherwise a(n) = A007814(n). - Andrey Zabolotskiy, Jan 08 2024
Asymptotic mean: Limit_{m->oo} (1/m) * Sum_{k=1..m} a(k) = 2. - Amiram Eldar, Aug 30 2024

A327494 a(n) = numerator(r(n)) where r(n) = Sum_{j=0..n} j!/(2^j*floor(j/2)!)^2.

Original entry on oeis.org

1, 5, 11, 47, 191, 779, 1563, 6287, 50331, 201639, 403341, 1614057, 6456459, 25828839, 51658107, 206638863, 3306228243, 13225022367, 26450056889, 105800458501, 423201880193, 1692808490741, 3385617069661, 13542470306761, 108339763130127, 433359069421483
Offset: 0

Views

Author

Peter Luschny, Sep 27 2019

Keywords

Examples

			r(n) = 1, 5/4, 11/8, 47/32, 191/128, 779/512, 1563/1024, 6287/4096, 50331/32768, 201639/131072, ...
		

Crossrefs

Denominators are in A327493.

Programs

Formula

Lim_{n -> oo} r(n) = (4/3)^(3/2) = A118273.

A327495 a(n) = numerator( Sum_{j=0..n} (j!/(2^j*floor(j/2)!)^2)^2 ).

Original entry on oeis.org

1, 17, 69, 1113, 17817, 285297, 1141213, 18260633, 1168681737, 18699007017, 74796032037, 1196736992841, 19147791938817, 306364680039081, 1225458720340365, 19607339566855065, 5019478929156305865, 80311662878468159865, 321246651514020383485, 5139946424277661728785
Offset: 0

Views

Author

Peter Luschny, Sep 27 2019

Keywords

Comments

This sequence is a variant of the Landau constants when the normalized central binomial is replaced by the normalized swinging factorial.
(1) A277233(n)/4^A005187(n) are the Landau constants. These constants are defined as G(n) = Sum_{j=0..n} g(j)^2 with the normalized central binomial
g(n) = (2*n)! / (2^n*n!)^2 = A001790(n)/A046161(n).
(2) A327495(n)/4^A327492(n) are the rationals considered here. These numbers are defined as H(n) = Sum_{j=0..n} h(j)^2 with the normalized swinging factorial
h(n) = n! / (2^n*floor(n/2)!)^2 = A163590(n)/A327493(n).
(3) In particular, this means that we have the pure integer representations
A277233(n) = Sum_{k=0..n}(A001790(k)*(2^(A005187(n) - A005187(k))))^2;
A327495(n) = Sum_{k=0..n}(A163590(k)*(2^(A327492(n) - A327492(k))))^2.
(4) A163590 is the odd part of the swinging factorial and A001790 is the odd part of the swinging factorial at even indices (see a comment from Aug 01 2009 in A001790). Similarly, A327493(2n)=A046161(2n) and A327493(2n+1) = 2*A046161(2n+1).
(5) A005187 are the partial sums of A001511, the 2-adic valuation of 2n, and A327492 are the partial sums of A327491.

Examples

			r(n) = 1, 17/16, 69/64, 1113/1024, 17817/16384, 285297/262144, 1141213/1048576, 18260633/16777216, ...
		

Crossrefs

Programs

  • Maple
    A327495 := n -> numer(add(j!^2/(2^j*iquo(j,2)!)^4, j=0..n)):
    seq(A327495(n), n=0..19);
  • PARI
    a(n)={ numerator(sum(j=0, n, (j!/(2^j*(j\2)!)^2)^2 )) } \\ Andrew Howroyd, Sep 28 2019

Formula

Denominator(r(n)) = 4^A327492(n) = A327493(n)^2 = A327496(n).
a(n) = Sum_{k=0..n} (A163590(k)*(2^(A327492(n) - A327492(k))))^2.

A327496 a(n) = a(n - 1) * 4^r where r = valuation(n, 2) if 4 divides n else r = (n mod 2) + 1; a(0) = 1. The denominators of A327495.

Original entry on oeis.org

1, 16, 64, 1024, 16384, 262144, 1048576, 16777216, 1073741824, 17179869184, 68719476736, 1099511627776, 17592186044416, 281474976710656, 1125899906842624, 18014398509481984, 4611686018427387904, 73786976294838206464, 295147905179352825856, 4722366482869645213696
Offset: 0

Views

Author

Peter Luschny, Sep 29 2019

Keywords

Crossrefs

Programs

  • Maple
    A327496 := n -> denom(add(j!^2 / (2^j*iquo(j, 2)!)^4, j=0..n)):
    seq(A327496(n), n=0..19);
  • PARI
    a(n) = 1 << (4*n - 2*hammingweight(n>>1)); \\ Kevin Ryde, May 31 2022
  • SageMath
    @cached_function
    def A327496(n):
        if n == 0: return 1
        r = valuation(n, 2) if 4.divides(n) else n % 2 + 1
        return 4^r * A327496(n-1)
    print([A327496(n) for n in (0..19)])
    

Formula

a(n) = denominator(r(n)) where r(n) = Sum_{j=0..n} j!^2 / (2^j*floor(j/2))^4.
a(n) = 4^A327492(n). - Kevin Ryde, May 31 2022
Showing 1-5 of 5 results.