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.

A064159 Numbers n such that g(n) + sopfr(n) = n, where g(n)= number of nonprimes <=n (A062298) and sopfr(n) = sum of primes dividing n with repetition (A001414).

Original entry on oeis.org

1, 24, 27, 30, 55, 65, 95, 145, 155, 185, 205, 822, 894, 2779, 2863, 8104, 64270, 174691, 174779, 1301989, 1302457, 3523478, 9554955, 9555045, 9556455, 70111213, 70111247, 514269523, 514269599, 10246934786, 10246934962, 204475046525, 554805817358, 4086199294828
Offset: 1

Views

Author

Jason Earls, Sep 15 2001

Keywords

Comments

That is, numbers n such that primepi(n) = sopfr(n). - Michel Marcus, Mar 25 2017

Programs

  • Maple
    with(numtheory):
    a:= proc(n) option remember; local k;
           for k from 1+ `if`(n=1, 0, a(n-1))
           while add(i[1]*i[2], i=ifactors(k)[2])<>pi(k) do od; k
        end:
    seq(a(n), n=1..17);  # Alois P. Heinz, Dec 18 2011
  • Mathematica
    a[n_] := a[n] = Module[{k}, For[k = 1 + If[n==1, 0, a[n-1]], Sum[i[[1]] * i[[2]], {i, FactorInteger[k]}] != PrimePi[k], k++]; k]; a[1] = 1;
    Table[Print["a(", n, ") = ", a[n]]; a[n], {n, 1, 25}] (* Jean-François Alcover, Mar 25 2017, after Alois P. Heinz *)
  • PARI
    sopfr(n) = my(fac=factor(n)); sum(i=1, #fac~, fac[i,1]*fac[i,2]);
    for (n=1,10^6, if (sopfr(n)==primepi(n), print1(n, ", "))) \\ edited by Michel Marcus, Mar 25 2017

Extensions

a(17)-a(21) from Alois P. Heinz, Dec 18 2011
a(22)-a(31) from Donovan Johnson, Jun 29 2012
a(32)-a(34) from Giovanni Resta, Mar 28 2017