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.

A334344 Binary Moran numbers: numbers k such that k divided by its binary weight (A000120) is a prime number.

This page as a plain text file.
%I A334344 #18 Apr 24 2020 09:41:43
%S A334344 2,6,10,21,34,55,69,92,115,116,155,172,185,205,212,222,246,284,295,
%T A334344 318,321,332,355,356,366,395,404,438,452,474,498,514,535,556,565,596,
%U A334344 606,623,652,749,788,822,835,865,889,905,973,978,1041,1052,1076,1086,1108,1124
%N A334344 Binary Moran numbers: numbers k such that k divided by its binary weight (A000120) is a prime number.
%H A334344 Amiram Eldar, <a href="/A334344/b334344.txt">Table of n, a(n) for n = 1..10000</a>
%e A334344 2 is a term since its binary weight is 1 and 2/1 = 2, which is a prime number.
%e A334344 6 (110 in binary) has a binary weight of 2 and 6/2 = 3, which is prime, so 6 is also in the sequence. Likewise 10 (1010 in binary) also has a binary weight of 2, and 10/2 = 5, which is prime, so 10 is also in the sequence.
%e A334344 14 (1110 in binary) has binary weight of 3. But 14/3 is not prime, so 14 is not in the sequence.
%p A334344 q:= n-> (p-> is(p, integer) and isprime(p))(n/add(i, i=Bits[Split](n))):
%p A334344 select(q, [$1..1200])[];  # _Alois P. Heinz_, Apr 23 2020
%t A334344 Select[Range[1000], PrimeQ[# / DigitCount[#, 2, 1]] &]
%o A334344 (Scala) def isPrime(num: Int): Boolean = Math.abs(num) match {
%o A334344   case 0 => false; case 1 => false; case n => (2 to Math.floor(Math.sqrt(n)).toInt) forall (p => n % p != 0)
%o A334344 }
%o A334344 (1 to 1000).filter{ n => val binWt = Integer.bitCount(n); (n % binWt) == 0 && isPrime(n / binWt) } // _Alonso del Arte_, Apr 23 2020
%o A334344 (PARI) isok(m) = iferr(isprime(m/hammingweight(m)), E, 0); \\ _Michel Marcus_, Apr 24 2020
%Y A334344 Subsequence of A049445.
%Y A334344 Cf. A000120, A001101.
%K A334344 nonn,base
%O A334344 1,1
%A A334344 _Amiram Eldar_, Apr 23 2020