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

A065358 The Jacob's Ladder sequence: a(n) = Sum_{k=1..n} (-1)^pi(k), where pi = A000720.

Original entry on oeis.org

0, 1, 0, 1, 2, 1, 0, 1, 2, 3, 4, 3, 2, 3, 4, 5, 6, 5, 4, 5, 6, 7, 8, 7, 6, 5, 4, 3, 2, 3, 4, 3, 2, 1, 0, -1, -2, -1, 0, 1, 2, 1, 0, 1, 2, 3, 4, 3, 2, 1, 0, -1, -2, -1, 0, 1, 2, 3, 4, 3, 2, 3, 4, 5, 6, 7, 8, 7, 6, 5, 4, 5, 6, 5, 4, 3, 2, 1, 0, 1, 2, 3, 4, 3, 2, 1, 0, -1, -2, -1, 0, 1, 2, 3, 4, 5, 6, 5, 4
Offset: 0

Views

Author

Jason Earls, Oct 31 2001

Keywords

Comments

Partial sums of A065357.

Crossrefs

Cf. A000720, A065357, A064940 (the zero terms).

Programs

  • Maple
    with(numtheory): f:=n->add((-1)^pi(k),k=1..n); [seq(f(n),n=0..60)]; # N. J. A. Sloane, Feb 20 2018
  • Mathematica
    Table[Sum[(-1)^(PrimePi[k]), {k,1,n}], {n,0,100}] (* G. C. Greubel, Feb 20 2018 *)
    a[0] = 0; a[n_] := a[n] = a[n - 1] + (-1)^PrimePi[n]; Array[a, 105, 0] (* Robert G. Wilson v, Feb 20 2018 *)
  • PARI
    { a=0; for (n=1, 1000, a+=(-1)^primepi(n); write("b065358.txt", n, " ", a) ) } \\ Harry J. Smith, Sep 30 2009
    [0] cat [(&+[(-1)^(#PrimesUpTo(k)):k in [1..n]]): n in [1..100]];  // G. C. Greubel, Feb 20 2018

Extensions

Edited by Frank Ellermann, Feb 02 2002
Edited by N. J. A. Sloane, Feb 20 2018 (added initial term a(0)=0, added name suggested by the Fraile et al. paper)

A064940 Values of k for which A065358(k) is 0.

Original entry on oeis.org

0, 2, 6, 34, 38, 42, 50, 54, 78, 86, 90, 106, 110, 114, 834, 842, 1390, 1406, 1410, 1470, 1578, 1586, 1650, 1662, 1842, 1850, 3382, 3490, 3506, 3514, 3518, 3546, 3658, 3690, 3718, 3746, 3778, 3818, 3822, 3842, 3850, 3854, 3870, 3898, 3938, 3946, 3986, 3990
Offset: 1

Views

Author

Jason Earls, Oct 31 2001

Keywords

Crossrefs

Programs

  • Maple
    m:= -1:
    t:= 0:
    Res:= 0,2:
    for i from 3 to 5*10^7 by 2 do
      if isprime(i) then m:= -m fi;
      t:= t+2*m;
      if t = 0 then Res:= Res, i+1 fi;
    od:
    Res; # Robert Israel, Feb 20 2018
  • Mathematica
    A065358 := Table[Sum[(-1)^(PrimePi[k]), {k,1,n}], {n,0,500}]; Select[Range[300], A065358[[#]] == 0 &] - 1  (* G. C. Greubel, Feb 20 2018 *)
    c = s = 0; k = 1; lst = {0}; While[k < 100000, c = Mod[c + Boole[PrimeQ[k]], 2]; s = s + (-1)^c; If[s == 0, AppendTo[lst, k]]; k++]; lst (* Robert G. Wilson v, Feb 20 2018 *)
  • PARI
    { n=s=0; for (m=1, 10^9, s+=(-1)^primepi(m); if (s==0, write("b064940.txt", n++, " ", m); if (n==150, return)) ) } \\ Harry J. Smith, Sep 30 2009
    
  • Python
    from sympy import nextprime
    A064940_list, p, d, n, r = [], 2, -1, 0, False
    while n <= 10**6:
        pn, k = p-n, d if r else -d
        if 0 < k <= pn:
            A064940_list.append(n+k-1)
        d += -pn if r else pn
        r, n, p = not r, p, nextprime(p) # Chai Wah Wu, Feb 21 2018

Extensions

Initial term 0 added by N. J. A. Sloane, Feb 20 2018

A373923 a(n) = Sum_{d|n} (-1)^pi(d).

Original entry on oeis.org

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

Views

Author

Wesley Ivan Hurt, Jun 22 2024

Keywords

Comments

Inverse Möbius transform of (-1)^pi(n) (A065357).

Crossrefs

Cf. A000720 (pi), A065357, A065358 (Jacob's Ladder sequence).

Programs

  • Maple
    f:= proc(n) local d; add((-1)^numtheory:-pi(d),d=numtheory:-divisors(n)) end proc:
    map(f, [$1..100]); # Robert Israel, Sep 13 2024
  • Mathematica
    Table[DivisorSum[n, (-1)^PrimePi[#] &], {n, 100}]

A373924 a(n) = Sum_{d|n} (-1)^pi(d) * mu(n/d).

Original entry on oeis.org

1, -2, 0, 2, -2, 0, 0, 0, 0, 4, -2, -2, 0, 2, 2, 0, -2, 0, 0, -2, 0, 4, -2, 0, 0, 0, -2, -4, 0, -2, -2, -2, 0, 2, 0, 0, 0, 2, 0, 0, -2, -2, 0, -2, 0, 4, -2, 0, -2, -2, 0, -2, 0, 4, 4, 2, 0, 2, -2, 0, 0, 4, 0, 2, 2, 0, -2, -2, 0, -4, 0, 2, -2, 0, -2, -4, 0, 0, 0, 0, 2
Offset: 1

Views

Author

Wesley Ivan Hurt, Jun 22 2024

Keywords

Comments

Möbius transform of (-1)^pi(n) (A065357).

Crossrefs

Cf. A000720 (pi), A008683 (mu), A065357, A373923.

Programs

  • Maple
    f:= proc(n) local d; add((-1)^numtheory:-pi(d)*numtheory:-mobius(n/d),d=numtheory:-divisors(n)) end proc:
    map(f, [$1..100]); # Robert Israel, Sep 13 2024
  • Mathematica
    Table[DivisorSum[n, (-1)^PrimePi[#] MoebiusMu[n/#] &], {n, 100}]
Showing 1-4 of 4 results.