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.

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