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.

A152715 Primes in A065049 which are not in A139370.

Original entry on oeis.org

277, 337, 349, 373, 853, 1093, 1109, 1117, 1237, 1297, 1301, 1303, 1361, 1367, 1373, 1381, 1399, 1429, 1489, 1493, 1621, 1861, 1873, 1877, 1879, 2389, 3413, 3541, 4177, 4357, 4373, 4421, 4423, 4441, 4447, 4549, 4561, 4567, 4597, 4933, 4951, 4957, 5077, 5189, 5197, 5209, 5233, 5237
Offset: 1

Views

Author

Vladimir Shevelev, Dec 11 2008, Dec 12 2008

Keywords

Comments

In the notation of A139370, a prime p is in the sequence iff e(p)>o(p) and e(p)-o(p)== 4 or 5 (mod 6). [Vladimir Shevelev, Dec 12 2008]

Crossrefs

Programs

  • Mathematica
    aQ[n_] := PrimeQ[n] && EvenQ[Count[IntegerDigits[n, 2], 1]] == OddQ[Mod[n, 3]] && Module[{d = Reverse[IntegerDigits[n, 2]]}, Total@d[[1;; -1;; 2]] >= Total@d[[2;; -1;; 2]]]; Select[Range[5300], aQ] (* Amiram Eldar, Dec 15 2018 *)
  • PARI
    isokp(p) = (p>2) && isprime(p) && ((hammingweight(p) % 2) != ((p % 3) % 2)); \\ A065049
    isok0(n) = {my(irb = Vec(select(x->(x%2), Vecrev(binary(n)), 1))); #select(x->(x%2), irb) < #irb/2;} \\ A139370
    isok(p) = isokp(p) && !isok0(p); \\ Michel Marcus, Dec 15 2018

Extensions

Missing 853 and more terms from Michel Marcus, Dec 15 2018

A139370 Let the binary expansion of n be n = Sum_{k} 2^{r_k}, let e(n) be the number of r_k's that are even, o(n) the number that are odd; sequence lists n such that e(n) < o(n).

Original entry on oeis.org

2, 8, 10, 11, 14, 26, 32, 34, 35, 38, 40, 41, 42, 43, 44, 46, 47, 50, 56, 58, 59, 62, 74, 98, 104, 106, 107, 110, 122, 128, 130, 131, 134, 136, 137, 138, 139, 140, 142, 143, 146, 152, 154, 155, 158, 160, 161, 162, 163, 164, 166, 167, 168, 169, 170, 171
Offset: 1

Views

Author

Nadia Heninger and N. J. A. Sloane, Jun 07 2008

Keywords

Comments

e(n)+o(n) = A000120(n), the binary weight of n. For e(n) = o(n) see A039004.
Primes of this sequence are in A065049; but A065049 contains also other primes (see A152715). [Vladimir Shevelev, Dec 11 2008]

Crossrefs

Programs

  • Fortran
    c See link in A139351
    
  • Mathematica
    aQ[n_] := Module[{d = Reverse[IntegerDigits[n,2]]}, Total@d[[1;;-1;;2]] < Total@d[[2;;-1;;2]]]; Select[Range[180], aQ] (* Amiram Eldar, Dec 15 2018 *)
  • PARI
    isok(n) = {my(irb = Vec(select(x->(x%2), Vecrev(binary(n)), 1))); #select(x->(x%2), irb) < #irb/2;} \\ Michel Marcus, Dec 15 2018

A065079 Primes > 3 for which the alternating bit sum (A065359) is not equal to 1 or 2.

Original entry on oeis.org

11, 41, 43, 47, 59, 107, 131, 137, 139, 163, 167, 173, 179, 191, 227, 233, 239, 251, 277, 337, 349, 373, 419, 431, 443, 491, 521, 523, 547, 557, 563, 569, 571, 587, 617, 619, 641, 643, 647, 653, 659, 673, 677, 683, 691, 701, 719, 739, 743, 751, 761, 809
Offset: 1

Views

Author

Robert G. Wilson v, Nov 08 2001

Keywords

Comments

Differs from A065049 beginning with 683.

Examples

			11 is in the sequence because 11d = 1011b, so the alternating digits sum of 11 is 1 -1 +0 -1 = -1 which is neither 1 nor 2.
		

References

  • William Paulsen, wpaulsen(AT)csm.astate.edu, personal communication.

Crossrefs

Cf. A065049.

Programs

  • Mathematica
    Do[d = Reverse[ IntegerDigits[ Prime[n], 2]]; l = Length[d]; s = 0; k = 1; While[k < l + 1, s = s - (-1)^k*d[[k]]; k++ ]; If[s != 1 && s != 2, Print[ Prime[n]]], {n, 3, 141} ]
  • PARI
    baseE(x, b)= { local(d, e=0, f=1); while (x>0, d=x-b*(x\b); x\=b; e+=d*f; f*=10); return(e) } SumAD(x)= { local(a=1, s=0); while (x>9, s+=a*(x-10*(x\10)); x\=10; a=-a); return(s + a*x) } { n=0; for (m=3, 10^9, p=prime(m); s=SumAD(baseE(p, 2)); if (s!=1 && s!=2, write("b065079.txt", n++, " ", p); if (n==1000, return)) ) } \\ Harry J. Smith, Oct 06 2009
    
  • PARI
    f(p)={s=0;u=1;for(k=0,#binary(p)-1,s+=bittest(p,k)*u;u=-u);return(s)};forprime(p=5,809,F=f(p);if((F!=1)&&(F!=2),print1(p,", "))) \\ Washington Bomfim, Jan 18 2011

Extensions

"> 3" added to definition by Harry J. Smith, Oct 06 2009

A065123 Primes which, although they have correct parity, are not in the prime number maze.

Original entry on oeis.org

683, 2699, 2729, 2731, 6827, 8363, 8747, 8867, 10427, 10667, 10799, 10859, 10883, 10889, 10891, 10937, 10939, 10979, 10987, 11003, 11171, 11177, 11243, 11939, 12011, 12203, 14891, 15017, 15083, 17749, 21589, 21841, 23893, 27179, 27299
Offset: 1

Views

Author

William Paulsen (wpaulsen(AT)csm.astate.edu), Nov 13 2001

Keywords

Comments

The prime number maze is a maze of prime numbers where two primes are connected if and only if their base 2 representations differ in just one bit.

Crossrefs

Programs

  • Mathematica
    f[ n_ ] := Block[ {d = Reverse[ IntegerDigits[ n, 2 ] ], l = s = 0, k = 1}, l = Length[ d ]; While[ k < l + 1, s = s - (-1)^k*d[ [ k ] ]; k++ ]; Return[ s ] ]; Select[ Range[ 5, 40000, 2 ], PrimeQ[ # ] && EvenQ[ Count[ IntegerDigits[ #, 2 ], 1 ] ] != OddQ[ Mod[ #, 3 ] ] && (f[ # ] > 2 || f[ # ] < 1) & ]

Extensions

More terms from Robert G. Wilson v, Dec 15 2001

A152810 Let the binary expansion of n be n = Sum_{k} 2^{r_k}, let e(n) be the number of r_k's that are even, o(n) the number that are odd; sequence gives odd n such that e(n) > o(n) and e(n)-o(n) == 1 or 2 (mod 6).

Original entry on oeis.org

1, 5, 7, 13, 17, 19, 23, 25, 29, 31, 37, 49, 53, 55, 61, 65, 67, 71, 73, 77, 79, 83, 89, 91, 95, 97, 101, 103, 109, 113, 115, 119, 121, 125, 127, 133, 145, 149, 151, 157, 181, 193, 197, 199, 205, 209, 211, 215, 217, 221, 223, 229, 241, 245, 247, 253, 257, 259
Offset: 1

Views

Author

Vladimir Shevelev, Dec 13 2008

Keywords

Comments

Primes in the sequence are not in A065049.

Crossrefs

Programs

  • Mathematica
    aQ[n_] := Module[{d = Reverse[IntegerDigits[n, 2]]}, e = Total@d[[1 ;; -1 ;; 2]]; o = Total@d[[2 ;; -1 ;; 2]]; e > o && MemberQ[{1, 2}, Mod[e - o, 6]]]; Select[Range[1, 260, 2], aQ] (* Amiram Eldar, Sep 12 2019 *)

Extensions

More terms from Amiram Eldar, Sep 12 2019
Showing 1-5 of 5 results.