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

A095292 Number of A095282-primes in range ]2^n,2^(n+1)].

Original entry on oeis.org

1, 0, 1, 1, 3, 4, 9, 14, 23, 47, 88, 152, 295, 540, 1004, 1933, 3572, 6805, 12909, 24461, 46767, 89481, 171327, 328638, 631302, 1215243, 2342291, 4520976, 8736608, 16899331, 32727125, 63446234, 123106396
Offset: 1

Views

Author

Antti Karttunen, Jun 04 2004

Keywords

Crossrefs

a(n) = A036378(n)-A095293(n). Cf. A095006.

Programs

A095283 Primes whose binary-expansion ends with an odd number of 1's.

Original entry on oeis.org

5, 7, 13, 17, 23, 29, 31, 37, 41, 53, 61, 71, 73, 89, 97, 101, 103, 109, 113, 127, 137, 149, 151, 157, 167, 173, 181, 193, 197, 199, 223, 229, 233, 241, 257, 263, 269, 277, 281, 293, 311, 313, 317, 337, 349, 353, 359, 373, 383, 389, 397, 401, 409
Offset: 1

Views

Author

Antti Karttunen, Jun 04 2004

Keywords

Crossrefs

Intersection of A000040 & A079523. Complement of A095282 in A000040. Cf. A027697, A095293.

Programs

  • Maple
    q:= proc(n) local i, l, r; l, r:= convert(n, base, 2), 0;
          for i to nops(l) while l[i]=1 do r:=r+1 od; is(r, odd)
        end:
    select(q, [ithprime(i)$i=1..150])[];  # Alois P. Heinz, Dec 15 2019
  • Mathematica
    Select[Prime[Range[100]], MatchQ[IntegerDigits[#, 2], {b:(1)..}|{_, 0, b:(1)..} /; OddQ[Length[{b}]]]&] (* Jean-François Alcover, Jan 03 2022 *)
  • PARI
    is(n)=valuation(n+1,2)%2 && isprime(n) \\ Charles R Greathouse IV, Oct 09 2013
    
  • Python
    from sympy import isprime
    def ok(n): b = bin(n); return (len(b)-len(b.rstrip("1")))%2 and isprime(n)
    print([k for k in range(1, 401) if ok(k)]) # Michael S. Branicky, Jan 03 2022

A227930 Primes p such that p-1 and p+1 have an even Hamming weight.

Original entry on oeis.org

11, 19, 47, 59, 67, 79, 107, 131, 179, 191, 211, 227, 239, 251, 271, 283, 307, 331, 367, 379, 419, 431, 443, 463, 491, 499, 563, 587, 659, 719, 787, 827, 859, 883, 911, 947, 971, 1019, 1039, 1051, 1087, 1123, 1163, 1171, 1187, 1231, 1259, 1279, 1291, 1327, 1423, 1451, 1459, 1471, 1483
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Oct 06 2013

Keywords

Comments

Primes such that both neighbors are evil (as defined in A001969).
From Antti Karttunen, Dec 29 2013: (Start)
Excluding 2, the intersection of A027697 (Odious primes: primes with odd number of 1's in binary expansion) and A095282 (Primes whose binary-expansion ends with an even number of 1's).
Equally, the intersection of A092246 (Odd "odious" numbers) and A095282.
Equally, odd odious primes p such that A007814(p+1) is even.
(End)

Crossrefs

Subsequence of A002145.
Seems to consist of all primes in A233388.

Programs

  • Maple
    read("transforms"):
    isA000069 := proc(n)
        if wt(n) mod 2 = 1 then
            true;
        else
            false;
        end if;
    end proc:
    for n from 1 do
        if isprime(n) and not isA000069(n-1) and not isA000069(n+1) then
            printf("%d,",n) ;
        end if;
    end do: # R. J. Mathar, Oct 08 2013
    (Scheme, with Antti Karttunen's IntSeq-library, two alternative implementations)
    (define A227930 (MATCHING-POS 1 1 (lambda (n) (and (even? (A000120 (- n 1))) (even? (A000120 (+ n 1))) (prime? n)))))
    (define A227930v2 (MATCHING-POS 1 1 (lambda (n) (and (odd? n) (odd? (A000120 n)) (even? (A007814 (+ n 1))) (prime? n))))) # Antti Karttunen, Dec 29 2013
  • Mathematica
    Select[Prime[Range[250]], And @@ EvenQ[DigitCount[# + {-1, 1}, 2, 1]] &] (* Amiram Eldar, Jul 24 2023 *)
  • PARI
    is(n)=hammingweight(n-1)%2==0 && hammingweight(n+1)%2==0 && isprime(n) \\ Charles R Greathouse IV, Oct 09 2013

Extensions

Entries checked by R. J. Mathar, Oct 08 2013
Showing 1-3 of 3 results.