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.

A300190 Number of solutions to 1 +- 2 +- 3 +- ... +- n == 0 (mod n).

Original entry on oeis.org

1, 0, 2, 4, 4, 0, 10, 32, 30, 0, 94, 344, 316, 0, 1096, 4096, 3856, 0, 13798, 52432, 49940, 0, 182362, 699072, 671092, 0, 2485534, 9586984, 9256396, 0, 34636834, 134217728, 130150588, 0, 490853416, 1908874584, 1857283156, 0, 7048151672, 27487790720
Offset: 1

Views

Author

Seiichi Manyama, Feb 28 2018

Keywords

Comments

Apparently a(2*n + 1) = A053656(2*n + 1) for n >= 0. - Georg Fischer, Mar 26 2019

Examples

			Solutions for n = 7:
--------------------------
1 +2 +3 +4 +5 +6 +7 =  28.
1 +2 +3 +4 +5 +6 -7 =  14.
1 +2 -3 +4 -5 -6 +7 =   0.
1 +2 -3 +4 -5 -6 -7 = -14.
1 +2 -3 -4 +5 +6 +7 =  14.
1 +2 -3 -4 +5 +6 -7 =   0.
1 -2 +3 +4 -5 +6 +7 =  14.
1 -2 +3 +4 -5 +6 -7 =   0.
1 -2 -3 -4 -5 +6 +7 =   0.
1 -2 -3 -4 -5 +6 -7 = -14.
		

Crossrefs

Number of solutions to 1 +- 2^k +- 3^k +- ... +- n^k == 0 (mod n): this sequence (k=1), A300268 (k=2), A300269 (k=3).
Cf. A016825 (4n+2).

Programs

  • Maple
    b:= proc(n, i, m) option remember; `if`(i=0, `if`(n=0, 1, 0),
          add(b(irem(n+j, m), i-1, m), j=[i, m-i]))
        end:
    a:= n-> b(0, n-1, n):
    seq(a(n), n=1..60);  # Alois P. Heinz, Mar 01 2018
  • Mathematica
    b[n_, i_, m_] := b[n, i, m] = If[i == 0, If[n == 0, 1, 0], Sum[b[Mod[n + j, m], i - 1, m], {j, {i, m - i}}]];
    a[n_] := b[0, n - 1, n];
    Array[a, 60] (* Jean-François Alcover, Apr 29 2020, after Alois P. Heinz *)
  • Ruby
    def A(n)
      ary = [1] + Array.new(n - 1, 0)
      (1..n).each{|i|
        i1 = 2 * i
        a = ary.clone
        (0..n - 1).each{|j| a[(j + i1) % n] += ary[j]}
        ary = a
      }
      ary[(n * (n + 1) / 2) % n] / 2
    end
    def A300190(n)
      (1..n).map{|i| A(i)}
    end
    p A300190(100)

Formula

a(4*n+1) = A000016(n), a(4*n+2) = 0, a(4*n+3) = A000016(n), a(4*n+4) = 2 * A000016(n) for n > 0.
a(2^n) = 2^A000325(n) for n > 1.

A000116 Number of even sequences with period 2n (bisection of A000013).

Original entry on oeis.org

1, 2, 4, 8, 20, 56, 180, 596, 2068, 7316, 26272, 95420, 349716, 1290872, 4794088, 17896832, 67110932, 252648992, 954444608, 3616828364, 13743921632, 52357746896, 199911300472, 764877836468, 2932031358484, 11258999739560, 43303843861744, 166799988689300
Offset: 0

Views

Author

Keywords

References

  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Programs

  • Haskell
    a000116 n = a000116_list !! n
    a000116_list = bis a000013_list where bis (x:_:xs) = x : bis xs
    -- Reinhard Zumkeller, Jul 08 2013
  • Maple
    with(numtheory):
    a:= n-> `if`(n=0, 1, add(phi(2*d)*2^(2*n/d), d=divisors(2*n))/(4*n)):
    seq(a(n), n=0..20);  # Alois P. Heinz, Mar 25 2012
  • Mathematica
    a[n_] := Sum[ EulerPhi[2d]*2^(2n/d), {d, Divisors[2n]}]/(4n); a[0]=1; Table[a[n], {n, 0, 27}] (* Jean-François Alcover, Sep 13 2012, after Alois P. Heinz *)

Formula

a(2*n) + a(n) = 2 * A000208(2*n); a(2*n+1) = 2 * A000208(2*n+1). - Reinhard Zumkeller, Jul 08 2013
a(n) ~ 4^(n-1) / n. - Cedric Lorand, Apr 18 2022

Extensions

More terms from David W. Wilson, Jan 13 2000

A100447 Bisection of A000031.

Original entry on oeis.org

2, 4, 8, 20, 60, 188, 632, 2192, 7712, 27596, 99880, 364724, 1342184, 4971068, 18512792, 69273668, 260301176, 981706832, 3714566312, 14096303344, 53634713552, 204560302844, 781874936816, 2994414645860, 11488774559636
Offset: 0

Views

Author

N. J. A. Sloane, Nov 21 2004

Keywords

Crossrefs

Cf. A000031, A100446. Equals 2*A026119.

Programs

  • Maple
    with(numtheory):seq((1/(2*n+1))*add(phi(d)*2^((2*n+1)/d),d=divisors(2*n+1)),n=0..30); (C. Ronaldo)

Extensions

More terms from C. Ronaldo (aga_new_ac(AT)hotmail.com), Jan 19 2005
Showing 1-3 of 3 results.