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

A230120 a(n) is the number of evil integers (A001969) not exceeding n and prime to n.

Original entry on oeis.org

0, 0, 0, 1, 1, 1, 3, 2, 1, 2, 5, 1, 6, 3, 0, 4, 7, 2, 9, 3, 4, 5, 10, 3, 8, 6, 5, 7, 13, 3, 15, 8, 6, 8, 12, 4, 18, 9, 7, 8, 20, 4, 20, 10, 5, 11, 23, 5, 24, 9, 8, 12, 25, 6, 19, 14, 11, 14, 29, 5, 30, 15, 12, 16, 22, 7, 33, 15, 12, 12, 34, 8, 36, 18, 10, 18
Offset: 1

Views

Author

Vladimir Shevelev, Oct 10 2013

Keywords

Comments

See comment in A230070, taking into account the equality a(n) = phi(n) - A230070(n), where phi(n) is Euler totient function (A000010).

Crossrefs

Programs

  • Mathematica
    upTo[n_] := Block[{c, i, e = Select[Range[n], EvenQ@ DigitCount[#, 2, 1] &]}, Table[c = 0; i = 1; While[i <= Length@ e && e[[i]] < k, c += Boole@ CoprimeQ[e[[i]], k]; i++]; c, {k, n}]]; upTo[100] (* Giovanni Resta, Apr 14 2025 *)
  • PARI
    a(n) = sum(k = 1, n, gcd(k, n) == 1 && !(hammingweight(k) % 2)); \\ Amiram Eldar, Nov 10 2024

Formula

For odd evil prime p (A027699), a(p) = (p-3)/2; for odd odious prime p (A027697), a(p) = (p-1)/2.

A256651 Numbers k for which both the number of evil numbers <= k and relatively prime to k, and the number of odious numbers <= k and relatively prime to k, are primes.

Original entry on oeis.org

7, 8, 10, 11, 14, 20, 22, 24, 27, 28, 30, 39, 45, 46, 47, 48, 59, 60, 66, 81, 94, 96, 107, 118, 124, 147, 166, 167, 172, 179, 189, 192, 200, 203, 210, 214, 225, 227, 231, 247, 259, 277, 285, 296, 304, 309, 315, 323, 324, 325, 327, 334, 358, 360, 407, 412, 436
Offset: 1

Views

Author

Vladimir Shevelev, Apr 06 2015

Keywords

Comments

For odious-evil partition of positive integers, see A000069, A001969; for odious-evil partition of relatively prime to n numbers <=n, see A230070, A230120.
Since Euler totient sequence A000010 takes only even values, then for some of them we have a representations as a sum of two primes.

Crossrefs

Programs

  • PARI
    is(k) = {my(c1 = 0, c2 = 0, h); for(i = 1, k, if(gcd(i, k) == 1, h = hammingweight(i) % 2; c1 += h; c2 += !h)); isprime(c1) && isprime(c2);} \\ Amiram Eldar, Nov 10 2024

Extensions

More terms from Peter J. C. Moses, Apr 06 2015
Showing 1-2 of 2 results.