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

A084561 Numbers with a square number of 1's in their binary expansion.

Original entry on oeis.org

0, 1, 2, 4, 8, 15, 16, 23, 27, 29, 30, 32, 39, 43, 45, 46, 51, 53, 54, 57, 58, 60, 64, 71, 75, 77, 78, 83, 85, 86, 89, 90, 92, 99, 101, 102, 105, 106, 108, 113, 114, 116, 120, 128, 135, 139, 141, 142, 147, 149, 150, 153, 154, 156, 163, 165, 166, 169, 170, 172, 177, 178
Offset: 1

Views

Author

Jason Earls, Jun 27 2003

Keywords

Comments

Begins to differ from A084345 at the 22nd term.
There are A003099(n) terms with at most n bits, so a(n) is n sqrt log n times a bounded function of n (which does not tend toward a limit). - Charles R Greathouse IV, Mar 26 2013

Crossrefs

Programs

  • Mathematica
    Select[Range[0,178],IntegerQ[Sqrt[Count[IntegerDigits[#,2],1]]]&] (* Jayanta Basu, May 24 2013 *)
  • PARI
    is(n)=issquare(hammingweight(n)) \\ Charles R Greathouse IV, Mar 26 2013

A255569 Primes whose binary representation encodes an irreducible polynomial over GF(2) and has a nonprime number of 1's.

Original entry on oeis.org

2, 1019, 1279, 1531, 1663, 1759, 1783, 1789, 2011, 2027, 2543, 2551, 2687, 2879, 2927, 2999, 3037, 3319, 3517, 3547, 3559, 3709, 3833, 3947, 4007, 4013, 4021, 4051, 4073, 4591, 5023, 5039, 5051, 5107, 5563, 5591, 5743, 5821, 5981, 6067, 6271, 6607, 6637, 6779, 6959, 7079, 7351, 7411, 7517, 7541, 7591, 7603, 7727, 7741, 7823, 7907, 7963, 7993
Offset: 1

Views

Author

Antti Karttunen, May 14 2015 after Joerg Arndt's Nov 01 2013 comment in A091206

Keywords

Crossrefs

Intersection of A091206 and A084345.
Intersection of A014580 and A255564.

Programs

  • Maple
    filter:= proc(n)
      local a, i,x;
      if not isprime(n) then return false fi;
      a:= convert(n,base,2);
      not isprime(convert(a,`+`)) and (Irreduc(add(x^(i-1)*a[i],i=1..nops(a))) mod 2)
    end proc:
    select(filter, [2,2*j+1$j=1..10000]); # Robert Israel, May 14 2015
  • Mathematica
    okQ[p_?PrimeQ] := Module[{id, pol, x}, id = IntegerDigits[p, 2] // Reverse; pol = id.x^Range[0, Length[id]-1]; IrreduciblePolynomialQ[pol, Modulus -> 2] && !PrimeQ[Count[id, 1]]];
    Select[Prime[Range[1000]], okQ] (* Jean-François Alcover, Feb 09 2023 *)
  • PARI
    isA014580(n) = polisirreducible(Pol(binary(n))*Mod(1, 2)); \\ This function from Charles R Greathouse IV
    i = 0; forprime(n=2, 2^31, if(isA014580(n)&&!isprime(hammingweight(n)), i++; write("b255569.txt", i, " ", n); if(i>=10000,return(n))));

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)))))))

A317294 Numbers with a noncomposite number of 1's in their binary expansion.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 16, 17, 18, 19, 20, 21, 22, 24, 25, 26, 28, 31, 32, 33, 34, 35, 36, 37, 38, 40, 41, 42, 44, 47, 48, 49, 50, 52, 55, 56, 59, 61, 62, 64, 65, 66, 67, 68, 69, 70, 72, 73, 74, 76, 79, 80, 81, 82, 84, 87, 88, 91, 93, 94, 96, 97, 98, 100
Offset: 1

Views

Author

Omar E. Pol, Aug 10 2018

Keywords

Comments

Union of powers of 2 and pernicious numbers.
All powers of 2 are in the sequence because the binary expansion of a power of 2 contains only one digit "1" and 1 is a noncomposite number (A008578).
If k is in the sequence then so is 2*k. - David A. Corneth, Aug 10 2018

Examples

			8 is in the sequence because the binary expansion of 8 is 1000 and 1000 has one 1, and 1 is a noncomposite number (A008578).
26 is in the sequence because the binary expansion of 26 is 11010 and 11010 has three 1's, and 3 is a noncomposite number.
		

Crossrefs

Union of A000079 and A052294.
The complement is A317295.
All terms of A000051 are in this sequence.

Programs

  • Maple
    filter:= proc(n) local w;
      w:= convert(convert(n,base,2),`+`);
      w=1 or isprime(w)
    end proc:
    select(filter, [$1..1000]); # Robert Israel, Aug 15 2018
  • Mathematica
    Select[Range[100], !CompositeQ[DigitCount[#, 2, 1]] &] (* Amiram Eldar, Jul 23 2023 *)
  • PARI
    is(n) = my(h=hammingweight(n)); ispseudoprime(h) || h==1 \\ Felix Fröhlich, Aug 10 2018

A317295 Numbers with a composite number of 1's in their binary expansion.

Original entry on oeis.org

15, 23, 27, 29, 30, 39, 43, 45, 46, 51, 53, 54, 57, 58, 60, 63, 71, 75, 77, 78, 83, 85, 86, 89, 90, 92, 95, 99, 101, 102, 105, 106, 108, 111, 113, 114, 116, 119, 120, 123, 125, 126, 135, 139, 141, 142, 147, 149, 150, 153, 154, 156, 159, 163, 165, 166, 169, 170, 172, 175, 177, 178, 180, 183, 184, 187, 189, 190
Offset: 1

Views

Author

Omar E. Pol, Aug 10 2018

Keywords

Comments

By definition no power of 2 is in the sequence.

Examples

			23 is in the sequence because the binary expansion of 23 is 10111 and 10111 has four 1's, and 4 is a composite number (A002808).
		

Crossrefs

Programs

  • Mathematica
    Select[Range[200], CompositeQ[DigitCount[#, 2, 1]] &] (* Amiram Eldar, Jul 23 2023 *)
  • PARI
    isok(n) = my(w = hammingweight(n)); (w != 1) && !isprime(w); \\ Michel Marcus, Aug 15 2018
    
  • Python
    from sympy import isprime; isok = lambda n: n & (n-1) and not isprime(bin(n).count('1')) # David Radcliffe, Aug 15 2018
Showing 1-5 of 5 results.