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 21-30 of 37 results. Next

A177798 First primes of record chains of consecutive primes such that all of them are odious (A027697).

Original entry on oeis.org

2, 7, 167, 199, 6271, 12227, 168713, 579907, 5937157, 6829751, 8059943, 66858173, 167857663, 661416709, 2322857987, 12012698381, 14641587607, 26304771553, 49671709081, 1244930533403, 1922085626009
Offset: 1

Views

Author

Vladimir Shevelev, Dec 12 2010

Keywords

Comments

The corresponding record lengths are: 1,3,6,9,11,15, etc. (A177800).

Crossrefs

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

Programs

  • PARI
    back(p,k)=while(k--,p=precprime(p-1));precprime(p-1)
    r=s=0;forprime(p=2,1e9,if(hammingweight(p)%2,s++,if(s>r,r=s;print1(back(p,r)", "));s=0)) \\ Charles R Greathouse IV, Mar 29 2013

Extensions

More terms from D. S. McNeil, Dec 12 2010
a(20)-a(21) from Amiram Eldar, Dec 09 2020

A194991 Primes whose squares are odious.

Original entry on oeis.org

2, 5, 7, 11, 17, 19, 23, 29, 31, 41, 43, 59, 67, 71, 79, 89, 97, 101, 103, 113, 127, 131, 139, 149, 157, 163, 167, 173, 179, 181, 193, 197, 223, 227, 229, 239, 251, 257, 263, 271, 283, 307, 313, 349, 353, 373, 379, 383, 389, 401, 409, 421, 431, 433, 439, 449, 457, 467, 479, 487, 509, 523, 547, 563
Offset: 1

Views

Author

Vladimir Shevelev, Sep 07 2011

Keywords

Comments

Subsequence of the numbers 1, 2, 4, 5, 7, 8, 9, 10, 11, 14, 16, 17, 18, 19, 20, 22, 23, 25, 28, 29, 31, 32, 33, ... which have odious squares. See A235331. - R. J. Mathar, Sep 20 2011

Crossrefs

Programs

A230070 a(n) is the number of odious integers (A000069) not exceeding n and respectively prime to n.

Original entry on oeis.org

1, 1, 2, 1, 3, 1, 3, 2, 5, 2, 5, 3, 6, 3, 8, 4, 9, 4, 9, 5, 8, 5, 12, 5, 12, 6, 13, 5, 15, 5, 15, 8, 14, 8, 12, 8, 18, 9, 17, 8, 20, 8, 22, 10, 19, 11, 23, 11, 18, 11, 24, 12, 27, 12, 21, 10, 25, 14, 29, 11, 30, 15, 24, 16, 26, 13, 33, 17, 32, 12, 36, 16, 36
Offset: 1

Views

Author

Vladimir Shevelev, Oct 10 2013

Keywords

Comments

Let b(n) is the number of evil integers (A001969) not exceeding n and respectively prime to n. Then a(n) + b(n) = phi(n) (phi = A000010). For which numbers a(n) < b(n)? This sequence begins 28,... . For n = 1,2,3,15, we have a(n) = phi(n). What other solutions has this equation? When a(n) = phi(n)/2, we call n a balanced number. The sequence of balanced numbers begins 4,6,7,8,10,11,13,14,16,19,22,...

Examples

			For n = 30, we have the following numbers respectively prime to n: 1, 7, 11, 13, 17, 19, 23, 29, from which only 5 numbers 1, 7, 11, 13 and 19 are odious. So, a(30) = 5.
		

Crossrefs

Programs

  • Mathematica
    odiouses=Select[Range[rng=100],OddQ[DigitCount[#,2][[1]]]&]; tmp=1; Table[Count[Map[CoprimeQ[n,#]&, Take[odiouses, tmp=NestWhile[#+1&,tmp+1, odiouses[[#]]
    				
  • PARI
    a(n) = sum(k = 1, n, gcd(k, n) == 1 && hammingweight(k) % 2); \\ Amiram Eldar, Nov 10 2024

Formula

For odd prime p, a(p) = (p + 1 or - 1)/2. Primes p for which a(p) = (p+1)/2 are 3, 5, 17, 23, 29,..., i.e., evil primes (A027699), while odd primes p for which a(p) = (p-1)/2 are 7,11,13,19,..., i.e., odious primes (A027697).

A291762 Restricted growth sequence transform of ((-1)^A000120(n))*A046523(n); filter combining the parity of binary weight with the prime signature of n.

Original entry on oeis.org

1, 2, 3, 4, 3, 5, 2, 6, 7, 5, 2, 8, 2, 9, 5, 10, 3, 8, 2, 8, 9, 9, 3, 11, 4, 9, 12, 13, 3, 14, 2, 15, 5, 5, 9, 16, 2, 9, 5, 11, 2, 17, 3, 13, 8, 5, 2, 18, 4, 13, 5, 13, 3, 11, 9, 19, 5, 5, 2, 20, 2, 9, 8, 21, 5, 14, 2, 8, 9, 17, 3, 22, 2, 9, 8, 13, 5, 14, 2, 18, 10, 9, 3, 23, 5, 5, 9, 19, 3, 20, 9, 8, 9, 9, 5, 24, 2, 13, 8, 25, 3, 14, 2, 19, 14, 5, 2, 22, 2, 17
Offset: 1

Views

Author

Antti Karttunen, Sep 11 2017

Keywords

Comments

Equally, restricted growth sequence transform of sequence b defined as b(1) = 1; b(n) = A046523(n) + A010060(n) for n > 1, which starts as 1, 3, 2, 5, 2, 6, 3, 9, 4, 6, 3, 12, 3, 7, 6, 17, 2, 12, 3, 12, 7, 7, ...

Crossrefs

Cf. A101296, A286163, A291761 (related or similar filtering sequences).
Cf. A027697 (positions of 2's), A027699 (of 3's), A130593 (of 5's and 7's), A230095 (of 9's).
Cf. also A231431, A235001.

Programs

  • PARI
    rgs_transform(invec) = { my(om = Map(), outvec = vector(length(invec)), u=1); for(i=1, length(invec), if(mapisdefined(om,invec[i]), my(pp = mapget(om, invec[i])); outvec[i] = outvec[pp] , mapput(om,invec[i],i); outvec[i] = u; u++ )); outvec; };
    write_to_bfile(start_offset,vec,bfilename) = { for(n=1, length(vec), write(bfilename, (n+start_offset)-1, " ", vec[n])); }
    A046523(n) = { my(f=vecsort(factor(n)[, 2], , 4), p); prod(i=1, #f, (p=nextprime(p+1))^f[i]); };  \\ This function from Charles R Greathouse IV, Aug 17 2011
    write_to_bfile(1,rgs_transform(vector(65537,n,((-1)^hammingweight(n))*A046523(n))),"b291762_upto65537.txt");
    \\ Or alternatively:
    A010060(n) = (hammingweight(n)%2);
    f(n) = if(1==n,n,A046523(n)+A010060(n));
    write_to_bfile(1,rgs_transform(vector(16385,n,f(n))),"b291762.txt");

A177800 The maximal length of the chain of consecutive primes starting with A177798(n) such that all of them are odious.

Original entry on oeis.org

1, 3, 6, 9, 11, 15, 17, 18, 22, 23, 25, 26, 28, 29, 33, 34, 35, 36, 38, 39, 42
Offset: 1

Views

Author

Vladimir Shevelev, Dec 12 2010

Keywords

Comments

In contrast to sequence of all positive integers, where the length of a chain of consecutive odious numbers cannot exceed 2, we conjecture that over primes the length is not bounded.

Crossrefs

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

Extensions

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

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.

A255564 Primes having in binary representation a nonprime number of 1's.

Original entry on oeis.org

2, 23, 29, 43, 53, 71, 83, 89, 101, 113, 139, 149, 163, 197, 263, 269, 277, 281, 293, 311, 317, 337, 347, 349, 353, 359, 373, 383, 389, 401, 449, 461, 467, 479, 503, 509, 523, 547, 571, 593, 599, 619, 643, 673, 683, 691, 739, 751, 773, 797, 811, 821, 839, 853, 857, 863, 881, 887, 907, 937, 977, 983, 991, 1013, 1019, 1021, 1031, 1049, 1061
Offset: 1

Views

Author

Antti Karttunen, May 14 2015

Keywords

Comments

Equally: 2 followed by all primes with their hamming weight a composite number.

Examples

			2, which in binary (A007088) is "10", has just one 1-bit, and 1 is not a prime, thus 2 is included in the sequence.
23, which in binary is "10111", has four 1-bits, and 4 is not a prime, thus 23 is included in the sequence.
		

Crossrefs

Complement among primes: A081092.
Intersection of A000040 and A084345.
Subsequences: A027699 \ A019434, A085448, A095077, A255569.
Cf. A000120.

Programs

  • PARI
    i = 0; forprime(n=2, 2^31, if(!isprime(hammingweight(n)), i++; write("b255564.txt", i, " ", n); if(i>=10000,return(n))));
    
  • Scheme
    ;; With Antti Karttunen's IntSeq-library
    (define A255564 (MATCHING-POS 1 1 (lambda (n) (and (prime? n) (not (prime? (A000120 n)))))))

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

A125494 Composite evil numbers.

Original entry on oeis.org

6, 9, 10, 12, 15, 18, 20, 24, 27, 30, 33, 34, 36, 39, 40, 45, 46, 48, 51, 54, 57, 58, 60, 63, 65, 66, 68, 72, 75, 77, 78, 80, 85, 86, 90, 92, 95, 96, 99, 102, 105, 106, 108, 111, 114, 116, 119, 120, 123, 125, 126, 129, 130, 132, 135, 136, 141, 142, 144, 147, 150, 153
Offset: 1

Views

Author

Tanya Khovanova, Dec 27 2006

Keywords

Examples

			12 is in the sequence since it is composite and its base-2 representation (1100) has an even number of 1's.
		

Crossrefs

Intersection of A002808 (composite numbers) and A001969 (evil numbers).
Cf. A027699 (evil primes).

Programs

  • Maple
    a:=proc(n) local n2: n2:=convert(n,base,2): if add(n2[j],j=1..nops(n2)) mod 2 = 0 and isprime(n)=false then n else fi end: seq(a(n),n=1..180); # Emeric Deutsch, Jan 01 2007
  • Mathematica
    Select[Range[153], EvenQ @ DigitCount[#, 2][[1]] && CompositeQ[#] &] (* Amiram Eldar, Dec 09 2019 *)
  • PARI
    isok(n) = (n>0) && !isprime(n) && !(hammingweight(n) % 2); \\ Michel Marcus, Mar 29 2019

Extensions

Corrected and extended by Emeric Deutsch, Jan 01 2007

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
Previous Showing 21-30 of 37 results. Next