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.

Previous Showing 31-40 of 40 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.

A268483 Primes p such that the numbers of primes not exceeding p in A268476 and A268477 are equal.

Original entry on oeis.org

13, 43, 53, 139, 151, 193, 199, 223, 229, 239, 317, 397, 4751, 4889, 4909, 4937, 4951, 4967, 5011, 5023, 5077, 5087, 5113, 5297, 5351, 5419, 6007, 6053, 6211, 6247, 6301, 6317, 6343, 6857, 9209, 9421, 9473, 9491, 10937, 11047, 11329, 11399, 11423, 11443, 11491
Offset: 1

Views

Author

Vladimir Shevelev, Feb 05 2016

Keywords

Comments

In contrast to the analogous sequence for odious and evil primes (A027697, A027699), which, as we conjecture, consists of only primes 3,7,29 (see also our 2007-conjecture in A027697, A027699), here we conjecture that the sequence is infinite.

Crossrefs

Programs

  • Mathematica
    lim = 1500; s = Select[Prime@ Range@ lim, EvenQ@ Length[Split@ IntegerDigits[#, 2] /. {0, _} -> Nothing] &]; t = Select[Prime@ Range@ lim, OddQ@ Length[Split@ IntegerDigits[#, 2] /. {0, _} -> Nothing] &] ; Select[Prime@ Range@ lim, Count[s, p_ /; p <= #] == Count[t, q_ /; q <= #] &] (* Michael De Vlieger, Feb 08 2016 *)

Extensions

More terms from Peter J. C. Moses, Feb 05 2016

A127977 The minimum excess in the prime race of odious primes versus evil primes in the interval (2^(n-1),2^n).

Original entry on oeis.org

0, 1, 4, 7, 13, 19, 39, 53, 104, 138, 251, 334, 590, 715, 1353, 1855, 3659, 5221, 10484, 14933, 27491, 35474, 68816, 97342, 186405, 265255
Offset: 5

Views

Author

Jonathan Vos Post, Jun 07 2007

Keywords

Comments

Shevelev conjectures (p.2) that for all natural numbers n other than 5 and 6, the number of evil primes not exceeding n <= the number of odious primes not exceeding n. Odious primes are A027697. Evil primes are A027699.

Examples

			OdiPrimePi(x) for x >= 32 is 6, 6, 6, 6, 6, 7, 7, 7, 7, 8,.. and EviPrimePi(x) for x>=32 is 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6,...
The difference OdiPrimePi(x)-EviPrimePi(x) is 1, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 2, 2, 2, 2, 3,.. so the minimum of the difference in the interval 2^(6-1)..2^6 is 1, yielding a(6)=1.
		

Crossrefs

Programs

  • Maple
    read("transforms") ; # see oeis.org/transforms.txt
    isA000069 := proc(n) type(wt(n),'odd') ; end proc;
    isA027697 := proc(n) isprime(n) and isA000069(n) ; end proc:
    isA027699 := proc(n) isprime(n) and not isA000069(n) ; end proc:
    odiPi := proc(n) option remember; if n = 0 then 0; else an1 := procname(n-1) ; if isA027697(n) then an1+1 ; else an1 ; end if; end if; end proc:
    eviPi := proc(n) option remember; if n = 0 then 0; else an1 := procname(n-1) ; if isA027699(n) then an1+1 ; else an1 ; end if; end if; end proc:
    oddPi := proc(n) odiPi(n)-eviPi(n) ; end proc:
    A127977 := proc(n) local a,x ; a := 2^(n+1) ; for x from 2^(n-1)+1 to 2^n-1 do a := min(a,oddPi(x)) ; end do: a; end proc:
    for n from 5 do print(n,A127977(n)) ; end do; # R. J. Mathar, Sep 03 2011
  • Mathematica
    wt[n_] := DigitCount[n, 2, 1];
    isA000069[n_] := OddQ[wt[n]];
    isA027697[n_] := PrimeQ[n] && isA000069[n];
    isA027699[n_] := PrimeQ[n] && !isA000069[n];
    odiPi[n_] := odiPi[n] = If[n==0, 0, an1 = odiPi[n-1]; If[isA027697[n], an1+1, an1]];
    eviPi[n_] := eviPi[n] = If[n==0, 0, an1 = eviPi[n-1]; If[isA027699[n], an1+1, an1]];
    oddPi[n_] := odiPi[n] - eviPi[n];
    A127977[n_] := Module[{a, x}, a = 2^(n+1); For[x = 2^(n-1)+1, x <= 2^n-1, x++, a = Min[a, oddPi[x]]]; a];
    Table[an = A127977[n]; Print[an]; an, {n, 5, 30}] (* Jean-François Alcover, Jan 23 2018, after R. J. Mathar *)

Extensions

Published numbers corrected and checked up to n=23 by R. J. Mathar, Sep 03 2011

A173209 Partial sums of A000069.

Original entry on oeis.org

1, 3, 7, 14, 22, 33, 46, 60, 76, 95, 116, 138, 163, 189, 217, 248, 280, 315, 352, 390, 431, 473, 517, 564, 613, 663, 715, 770, 826, 885, 946, 1008, 1072, 1139, 1208, 1278, 1351, 1425, 1501, 1580, 1661, 1743, 1827, 1914, 2002, 2093, 2186, 2280, 2377, 2475, 2575
Offset: 1

Views

Author

Jonathan Vos Post, Feb 12 2010

Keywords

Comments

Partial sums of odious numbers. Second differences give A007413. The subsequence of prime partial sums of odious numbers begins: 3, 7, 163, 431, 613, 2377, 3691, which is a subsequence of A027697. The subsequence of odious partial sums of odious numbers begins: 1, 7, 14, 22, 76, 138, 217, 280, 352, 431, 517, 613, 770, 885.

Examples

			a(65) = 1 + 2 + 4 + 7 + 8 + 11 + 13 + 14 + 16 + 19 + 21 + 22 + 25 + 26 + 28 + 31 + 32 + 35 + 37 + 38 + 41 + 42 + 44 + 47 + 49 + 50 + 52 + 55 + 56 + 59 + 61 + 62 + 64 + 67 + 69 + 70 + 73 + 74 + 76 + 79 + 81 + 82 + 84 + 87 + 88 + 91 + 93 + 94 + 97 + 98 + 100 + 103 + 104 + 107 + 109 + 110 + 112 + 115 + 117 + 118 + 121 + 122 + 124 + 127 + 128.
		

Crossrefs

Programs

Formula

a(n) = SUM[i=1..n] A000069(i) = SUM[i=1..n] {i such that A010060(i)=1}.
a(n) = n^2 - n/2 + O(1). - Charles R Greathouse IV, Mar 22 2013

A177801 Record lengths of chains of consecutive evil primes, starting with A177748(n).

Original entry on oeis.org

2, 3, 5, 7, 8, 12, 16, 20, 23, 25, 26, 30, 31, 32, 34, 38, 39, 40, 41, 42, 44
Offset: 1

Views

Author

Vladimir Shevelev, Dec 12 2010

Keywords

Comments

In contrast to the sequence of all positive integers, where the length of every chain of consecutive evil numbers cannot exceed 2, we conjecture that for the sequence of primes such length is not bounded with growth of n.

Crossrefs

Cf. A177800 (odious version), A177748, A177798, A000069, A001969, A027697, A027699.

Programs

  • PARI
    {l=0;r=0; forprime( p=1, default(primelimit), if( bittest( norml2(binary(p)),0), l>r & print1(r=l ", "); l & l=0, l++))} \\ M. F. Hasler, Dec 12 2010

Extensions

Extended by D. S. McNeil, Dec 12 2010
a(18)-a(21) from Amiram Eldar, Dec 09 2020

A227921 Odd odious numbers (A000069), all divisors of which are odious.

Original entry on oeis.org

1, 7, 11, 13, 19, 31, 37, 41, 47, 49, 59, 61, 67, 73, 79, 91, 97, 103, 107, 109, 121, 127, 131, 133, 137, 143, 151, 157, 167, 173, 179, 181, 191, 193, 199, 211, 217, 223, 227, 229, 233, 239, 241, 247, 251, 259, 271, 283, 307, 313, 331, 341, 361, 367, 379, 397, 403
Offset: 1

Views

Author

Vladimir Shevelev, Oct 09 2013

Keywords

Comments

All primes are in A027697.

Crossrefs

Programs

  • Maple
    odious:= proc(n) option remember;
      n::odd xor procname(floor(n/2))
    end proc:
    odious(0):= false:
    odious(1):= true:
    filter:= proc(n) andmap(odious, numtheory:-divisors(n)) end proc:
    select(filter, [seq(i,i=1..500,2)]); # Robert Israel, Aug 18 2019
  • Mathematica
    odiusQ[n_]:=OddQ[Total[IntegerDigits[n,2]]]; Select[Range[1,411,2], odiusQ[ #]&&AllTrue[Divisors[#],odiusQ]&] (* The program uses the AllTrue function from Mathematica version 10 *) (* Harvey P. Dale, Jun 08 2019 *)
  • PARI
    isodious(n) = {b = binary(n); sum(i=1, #b, b[i]==1) % 2;}
    isok(n) = {if (!(n % 2), return (0)); fordiv(n, div, if (! isodious(div), return (0))); return (1);} \\ Michel Marcus, Oct 12 2013

A235985 Primes p such that 3p-1 has even Hamming weight.

Original entry on oeis.org

2, 7, 23, 29, 31, 71, 103, 107, 109, 113, 127, 151, 157, 167, 199, 227, 229, 233, 263, 283, 313, 347, 349, 359, 367, 373, 379, 383, 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499, 503, 509, 541, 569, 599, 607, 619, 631, 647, 739, 761, 797
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Jan 17 2014

Keywords

Comments

Primes p such that A000120(3p-1) is even.
Smallest prime p such that A000120(np-1) is even: 7, 2, 2, 7, 5, 3, 3, 2, 2, 3, 5, 2, 7,...

Examples

			23 is in this sequence because A000120(3*23-1) = A000120(68) = 2 (even number).
29 is in this sequence because A000120(3*29-1) = A000120(86) = 4 (even number).
		

Crossrefs

Cf. A019434 (odd primes p having Hamming weight 2), A027697 (primes p having odd Hamming weight), A027699 (primes p having an even Hamming weight).

Programs

  • Mathematica
    Select[Prime@Range@200, EvenQ@ First@ DigitCount[3#-1, 2] &] (* Giovanni Resta, Jan 26 2014 *)
  • PARI
    isok(p) = isprime(p) && !(hammingweight(3*p-1) % 2); \\ Michel Marcus, Jan 18 2014

A237499 Odious Mersenne exponents.

Original entry on oeis.org

2, 7, 13, 19, 31, 61, 107, 127, 521, 607, 1279, 3217, 11213, 21701, 44497, 132049, 216091, 756839, 1257787, 3021377, 6972593, 20996011, 24036583, 30402457, 37156667, 43112609, 82589933
Offset: 1

Views

Author

Keywords

Crossrefs

Intersection of A000043 and A027697.

Programs

  • Mathematica
    Select[MersennePrimeExponent[Range[47]], OddQ @ DigitCount[#, 2][[1]] &] (* Amiram Eldar, Dec 10 2019 *)

Extensions

a(13) and a(18) inserted and more terms added by Amiram Eldar, Dec 10 2019
a(27) added by Harvey P. Dale, Feb 01 2025

A269458 Primes p such that the numbers of negabinary evil primes and negabinary odious primes not exceeding p are equal (see comment).

Original entry on oeis.org

3, 53, 61, 71, 89, 101, 107, 7121, 7129, 7159, 7187, 424891, 29739371, 29740511, 29740523, 29740723, 1844046469, 1844046481, 1844046517, 1844046571, 1844046629, 1844046679, 1844046733, 1844046793, 1844046851, 1844047357, 1844047421, 1844047501, 1845540199, 1847154073, 1847154109
Offset: 1

Views

Author

Vladimir Shevelev, Feb 27 2016

Keywords

Comments

Negabinary evil and odious primes are primes in A268272 and A268273 correspondingly.
They are 2,5,7,13,17,19,31,37,61,67,73,79,...
and 3,11,23,29,41,43,47,53,59,71,83,89,...
In contrast to the analogous sequences for odious and evil primes (A027697, A027699), which, as we conjecture, consists of only primes 3,7,29 (see also our 2007-conjecture in A027697, A027699), here we conjecture that the sequence is infinite.

Crossrefs

Programs

  • Mathematica
    aQ[n_] := EvenQ @ Total @ Rest @ Reverse @ Mod[NestWhileList[(# - Mod[#, 2])/-2 &, n, # != 0 &], 2]; s = {}; p = 2; c = 0; Do[If[aQ[p], c++, c--]; If[c == 0, AppendTo[s, p]]; p = NextPrime[p], {10^3}]; s (* Amiram Eldar, Sep 22 2019 after Michael De Vlieger at A268272 *)

Extensions

More terms from Peter J. C. Moses, Feb 27 2016
More terms from Amiram Eldar, Sep 22 2019

A361071 Let c1(p) be the number of primes <= p with an odd number of 1's in base 2, and let c2(p) be the number of primes <= p with an even number of 1's in base 2. a(n) is the least prime p such that abs(c1(p) - c2(p)) >= n.

Original entry on oeis.org

2, 13, 41, 61, 67, 79, 109, 131, 137, 173, 179, 181, 191, 193, 211, 223, 227, 229, 233, 239, 241, 251, 587, 613, 617, 641, 653, 659, 661, 719, 727, 733, 761, 769, 829, 953, 967, 971, 1009, 1021, 1039, 1069, 1087, 1193, 1201, 1213, 1697, 1721, 1753, 1759, 1777, 1783, 1787
Offset: 1

Views

Author

Jean-Marc Rebert, Mar 01 2023

Keywords

Examples

			a(1) = 2, because c1(2) = 1 and c2(2) = 0, so abs(c1(2) - c2(2)) = 1 >= 1, and no lesser prime satisfies this.
		

Crossrefs

Programs

  • PARI
    { r = 0; n = 1; forprime (p = 2, 1787, r += (-1)^hammingweight(p); if (n==abs(r), print1 (p", "); n++;);); } \\ Rémy Sigrist, Mar 01 2023
Previous Showing 31-40 of 40 results.