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.

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

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

A327493 a(n) = 2^A327492(n).

Original entry on oeis.org

1, 4, 8, 32, 128, 512, 1024, 4096, 32768, 131072, 262144, 1048576, 4194304, 16777216, 33554432, 134217728, 2147483648, 8589934592, 17179869184, 68719476736, 274877906944, 1099511627776, 2199023255552, 8796093022208, 70368744177664, 281474976710656, 562949953421312
Offset: 0

Views

Author

Peter Luschny, Sep 27 2019

Keywords

Crossrefs

Programs

  • Julia
    bitcount(n) = sum(digits(n, base = 2))
    A327493(n) = 2^(2n - bitcount(n) + mod(n, 2))
    [A327493(n) for n in 0:26] |> println # Peter Luschny, Oct 03 2019
  • Maple
    A327493 := n -> 2^(A327492_list(n+1)[n+1]):
    seq(A327493(n), n = 0..26);
  • PARI
    seq(n)={my(a=vector(n+1)); a[1]=1; for(n=1, n, a[n+1] = a[n] * 2^if(n%4, n%2 + 1, valuation(n,2))); a} \\ Andrew Howroyd, Sep 28 2019
    
  • PARI
    a(n)={ denominator(sum(j=0, n, j!/(2^j*(j\2)!)^2)) } \\ Andrew Howroyd, Sep 28 2019
    

Formula

a(n) = denominator(b(n)) where b(n) = n!/(2^n*floor(n/2)!)^2 is the normalized swinging factorial (A056040).

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