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-10 of 20 results. Next

A084345 Numbers with a nonprime number of 1's in their binary expansion (complement of A052294).

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, 63, 64, 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, 128, 135, 139, 141, 142, 147, 149, 150, 153, 154, 156, 159, 163
Offset: 1

Views

Author

Zak Seidov Jun 22 2003

Keywords

Examples

			15 is in the sequence because 15_10=1111_2 and 1+1+1+1=4 is composite.
		

Crossrefs

Programs

  • Haskell
    a084345 n = a084345_list !! (n-1)
    a084345_list = filter ((== 0) . a010051' . a000120) [0..]
    -- Reinhard Zumkeller, Aug 28 2013, Nov 16 2012
  • Mathematica
    Select[Range[200],!PrimeQ[DigitCount[#,2,1]]&] (* Harvey P. Dale, Jan 21 2013 *)
  • PARI
    for(n=0,200,b=binary(n); if(!isprime(sum(m=1,matsize(b)[2],b[m])),print1(n,",")))
    

Extensions

More terms from Rick L. Shepherd, Jun 23 2003
Term 0 added by Michel Marcus, Aug 26 2013
b-file adjusted by Reinhard Zumkeller, Aug 28 2013

A363463 a(n) is the smallest number k with exactly n of its divisors in A052294.

Original entry on oeis.org

1, 3, 6, 12, 18, 48, 36, 192, 72, 84, 144, 3072, 168, 5985, 576, 336, 504, 26505, 672, 45045, 840, 1344, 6510, 129675, 2016, 1680, 11970, 4620, 4032, 389025, 3360, 888615, 6552, 13020, 53010, 6720, 8736, 855855, 90090, 23940, 13104, 2411955, 17472, 2417415, 26040
Offset: 0

Views

Author

Marius A. Burtea, Jul 08 2023

Keywords

Examples

			a(0) = 1 because 1 has no divisors in A052294.
2 has no divisors in A052294 and 3 has only one divisor 3 = 11_2 in A052294, so a(1) = 3.
4 has no divisors in A052294, 5 has only the divisor 5 = 101_2 in A052294, 6 has divisors 3 = 11_2 and 6 = 110_2, so a(2) = 6.
		

Crossrefs

Cf. A052294.

Programs

  • Magma
    fp:=func; a:=[]; for n in [0..44] do k:= 1; while #[d:d in Divisors(k)|fp(d)] ne n do k:=k+1; end while; Append(~a,k); end for; a;
    
  • Mathematica
    seq[len_, kmax_] := Module[{s = Table[0, {len}], c = 0, k = 1, ind}, While[k < kmax && c < len, ind = DivisorSum[k, 1 &, PrimeQ[DigitCount[#, 2, 1]] &] + 1; If[ind <= len && s[[ind]] == 0, c++; s[[ind]] = k]; k++]; s]; seq[40, 10^6] (* Amiram Eldar, Jul 10 2023 *)
  • PARI
    a(n) = my(k=1); while (sumdiv(k, d, isprime(hammingweight(d))) != n, k++); k; \\ Michel Marcus, Jul 10 2023

A363464 Numbers k in A052294 with arithmetic derivative k' (A003415) in A052294.

Original entry on oeis.org

6, 9, 10, 14, 18, 20, 21, 22, 24, 25, 33, 34, 35, 38, 40, 42, 44, 48, 49, 52, 62, 65, 66, 68, 69, 70, 76, 80, 84, 88, 91, 93, 94, 96, 100, 104, 110, 115, 117, 118, 121, 132, 133, 134, 138, 140, 143, 144, 145, 148, 152, 155, 158, 164, 174, 182, 185, 186, 188, 192
Offset: 1

Views

Author

Marius A. Burtea, Jul 08 2023

Keywords

Comments

If p > 2 is in A092506 then m = 2*p and u = 4*p are terms. Indeed, if p = 2^k + 1, k >= 1, m = 2*(2^k + 1) = 2^(k+1) + 2^1 has two 1's in its binary expansion, and m' = p+2 = 2^k + 3 = 2^k + 2^1 + 1 has three 1's in its binary expansion. Similarly u = 4*(2^k + 1) = 2^(k+2) + 2^2 and u' = 4*p + 4 = 2^(k+2) + 2^3.
If p is in A057733 then the number m = 2*p is a term. Indeed, if p = 2^k + 3, k >= 1, m = 2*(2^k + 3) = 2^(k+1) + 2^2 + 2 has three 1's in its binary expansion, and m' = p+2 = 2^k + 5 = 2^k + 2^2 + 1 has three 1's in its binary expansion.
If p > 7 is in A057733 then the number m = 4*p is a term. Indeed, if p = 2^k + 3, k >= 3, m = 4*(2^k + 3) = 2^(k+2) + 2^3 + 2 has three 1's in its binary expansion, and m' = 4*(p + 1) = 4*(2^k + 4) = 2^(k+2) + 2^4 has two 1's in its binary expansion.
If p is in A123250 then the number m = 4*p is a term. Indeed, if p = 2^k + 5, k >= 1, m = 4*(2^k + 5) = 2^(k+2) + 2^4 + 2^2 has three 1's its binary expansion, and m' = 4*(p+1) = 4*(2^k + 6) = 2^(k+2) + 2^4 + 2^2 has three 1's in its binary expansion.
If p is in A104070 then the number m = 4*p is a term. Indeed, if p = 2^k + 9, k >= 1, m = 4*(2^k + 9) = 2^(k+2) + 2^5 + 2^2 has three 1's its binary expansion, and m' = 4*(p+1) = 4*(2^k + 10) = 2^(k+2) + 2^5 + 2^3 has three 1's in its binary expansion.

Examples

			6 = 110_2 has two 1's, 6' = 5 = 101_2 has two 1's, so 6 is a term.
9 = 101_2 has two 1's, 9' = 6 = 110_2 has two 1's, so 9 is a term.
10 = 1010_2 has two 1's, 10' = 7 = 111_2 has three 1's, so 10 is a term.
18 = 10010_2 has two 1's, 18' = 21 = 10101_2 has three 1's, so 18 is a term.
		

Crossrefs

Programs

  • Magma
    fp:=func; f:=func; [n:n in [1..200]| fp(n) and fp(Floor(f(n)))];
  • Mathematica
    pernQ[n_] := PrimeQ[DigitCount[n, 2, 1]]; d[0] = d[1] = 0; d[n_] := n*Plus @@ ((Last[#]/First[#]) & /@ FactorInteger[n]); Select[Range[200], And @@ pernQ[{#, d[#]}] &] (* Amiram Eldar, Jul 10 2023 *)

A081092 Primes having a prime number of 1's in their binary representation.

Original entry on oeis.org

3, 5, 7, 11, 13, 17, 19, 31, 37, 41, 47, 59, 61, 67, 73, 79, 97, 103, 107, 109, 127, 131, 137, 151, 157, 167, 173, 179, 181, 191, 193, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 271, 283, 307, 313, 331, 367, 379, 397, 409, 419, 421, 431, 433, 439, 443
Offset: 1

Views

Author

Reinhard Zumkeller, Mar 05 2003

Keywords

Comments

Same as primes with prime binary digit sum.
Primes with prime decimal digit sum are A046704.
Sum_{a(n) < x} 1/a(n) is asymptotic to log(log(log(x))) as x -> infinity; see Harman (2012). Thus the sequence is infinite. - Jonathan Sondow, Jun 09 2012
A049084(A000120(a(n))) > 0; A081091, A000215 and A081093 are subsequences.

Examples

			15th prime = 47 = '101111' with five 1's, therefore 47 is in the sequence.
		

Crossrefs

Subsequence of A052294.

Programs

  • Haskell
    a081092 n = a081092_list !! (n-1)
    a081092_list = filter ((== 1) . a010051') a052294_list
    -- Reinhard Zumkeller, Nov 16 2012
    
  • Maple
    q:= n-> isprime(n) and isprime(add(i,i=Bits[Split](n))):
    select(q, [$1..500])[];  # Alois P. Heinz, Sep 28 2023
  • Mathematica
    Clear[BinSumOddQ];BinSumPrimeQ[a_]:=Module[{i,s=0},s=0;For[i=1,i<=Length[IntegerDigits[a,2]],s+=Extract[IntegerDigits[a,2],i];i++ ];PrimeQ[s]]; lst={};Do[p=Prime[n];If[BinSumPrimeQ[p],AppendTo[lst,p]],{n,4!}];lst (* Vladimir Joseph Stephan Orlovsky, Apr 06 2009 *)
    Select[Prime[Range[100]], PrimeQ[Apply[Plus, IntegerDigits[#, 2]]] &] (* Jonathan Sondow, Jun 09 2012 *)
  • PARI
    lista(nn) = {forprime(p=2, nn, if (isprime(hammingweight(p)), print1(p, ", ")););} \\ Michel Marcus, Jan 16 2015
    
  • Python
    from sympy import isprime
    def ok(n): return isprime(n.bit_count()) and isprime(n)
    print([k for k in range(444) if ok(k)]) # Michael S. Branicky, Dec 27 2023

A052467 Binomial transform of {b(n)}, where b(n)=1 for prime n and b(n)=0 otherwise.

Original entry on oeis.org

0, 1, 3, 6, 11, 20, 37, 70, 134, 255, 476, 869, 1564, 2821, 5201, 9948, 19793, 40562, 84271, 174952, 359576, 728805, 1457402, 2885051, 5681277, 11185110, 22103926, 43939533, 87864092, 176447165, 354929146, 713198803, 1428312446, 2846268351
Offset: 1

Views

Author

Keywords

Comments

Number of compositions of n into a prime number of parts. - Vladeta Jovovic, Jan 31 2005
The number of pernicious numbers (A052294) between 2^(n-1) and 2^n. Although the graph looks almost like 2^n, the graph of a(n)/2^n has quite a bit of variation. - T. D. Noe, Mar 14 2009

Crossrefs

Programs

  • Mathematica
    b[n_] := Boole[ PrimeQ[n]]; a[n_] := Sum[ Binomial[n, k]*b[k], {k, 0, n}]; Table[a[n], {n, 0, 34}] // Differences (* Jean-François Alcover, Oct 25 2012 *)

Formula

G.f.: Sum_{k>=1} (x/(1 - x))^prime(k). - Ilya Gutkovskiy, Dec 28 2016
a(n) = A121497(n+1) - A121497(n). - Wesley Ivan Hurt, Jan 14 2022

Extensions

More terms from David Wasserman, Feb 25 2002
Description corrected by T. D. Noe, May 17 2003

A144754 Integers that have a prime number of 0's in their binary expansion.

Original entry on oeis.org

4, 8, 9, 10, 12, 17, 18, 19, 20, 21, 22, 24, 25, 26, 28, 32, 35, 37, 38, 39, 41, 42, 43, 44, 45, 46, 49, 50, 51, 52, 53, 54, 56, 57, 58, 60, 65, 66, 68, 71, 72, 75, 77, 78, 79, 80, 83, 85, 86, 87, 89, 90, 91, 92, 93, 94, 96, 99, 101, 102, 103, 105, 106, 107, 108, 109, 110
Offset: 1

Views

Author

Leroy Quet, Sep 20 2008

Keywords

Examples

			66 written in binary is 1000010. This has five 0's and five is a prime. So 66 is included in the sequence.
		

Crossrefs

Cf. A052294.

Programs

  • Mathematica
    Select[Range@ 120, PrimeQ@ DigitCount[#, 2, 0] &] (* Michael De Vlieger, Oct 26 2017 *)
  • PARI
    isok(n) = isprime(#binary(n) - hammingweight(n)); \\ Michel Marcus, Feb 23 2016
    
  • Python
    from sympy import isprime
    i=j=1
    while j<=250:
        if isprime(bin(i)[2:].count("0")):
            print(str(j)+" "+str(i))
            j+=1
        i+=1 # Indranil Ghosh, Feb 03 2017

Extensions

Many more terms from Reikku Kulon, Sep 21 2008
Name edited by Michel Marcus, Apr 30 2021

A121497 Binomial transform of the characteristic function of the prime numbers (A010051).

Original entry on oeis.org

0, 0, 1, 4, 10, 21, 41, 78, 148, 282, 537, 1013, 1882, 3446, 6267, 11468, 21416, 41209, 81771, 166042, 340994, 700570, 1429375, 2886777, 5771828, 11453105, 22638215, 44742141, 88681674, 176545766, 352992931, 707922077, 1421120880, 2849433326
Offset: 0

Views

Author

T. D. Noe, Aug 03 2006

Keywords

Comments

This is the binomial transform of the sequence {0,0,1,1,0,1,0,1,...}. Sequence A052467, the binomial transform of the sequence {0,1,1,0,1,0,1,...} is very similar. In fact, the first differences of this sequence yields A052467.
The number of pernicious numbers (A052294) less than 2^n. Although the graph looks almost like 2^n, the graph of a(n)/2^n has quite a bit of variation. - T. D. Noe, Mar 14 2009
a(n)/2^n is the probability that a series of Bernoulli trials with probability of success equal to 1/2 will result in a prime number of successes. Cf. A178851. - Eric M. Schmidt, Jul 13 2012
a(n) equals the number of subsets of [n] whose cardinalities are prime. - Ivan N. Ianakiev, Jul 14 2019
Upper and lower bounds are provided by Kim and Sinha (see links). - Jeffrey Shallit, Nov 14 2024

Crossrefs

Programs

  • Maple
    Primes:= select(isprime, [2,seq(i,i=3..100,2)]):
    G:= add((z/(1-z))^p/(1-z),p=Primes):
    S:= series(G,z,101):
    seq(coeff(S,z,i),i=0..100); # Robert Israel, Sep 27 2018
  • Mathematica
    Table[Sum[Binomial[n,Prime[i]], {i,PrimePi[n]}], {n,40}]
  • PARI
    a(n)=my(s);forprime(p=2,n,s+=binomial(n,p));s \\ Charles R Greathouse IV, Mar 22 2013

Formula

a(n) = Sum_{i=1..pi(n)} binomial(n,prime(i)), where pi(n) is A000720(n), the number of primes <= n.
E.g.f.: exp(x) * (x^2/2! + x^3/3! + x^5/5! + ...) - Eric M. Schmidt, Jul 14 2012
G.f.: Sum_{p prime} x^p/(1-x)^(p+1). - Robert Israel, Sep 27 2018

Extensions

a(0) inserted by Franklin T. Adams-Watters, Jul 13 2012

A280998 Numbers with a prime number of 1's in their binary reflected Gray code representation.

Original entry on oeis.org

2, 4, 5, 6, 8, 9, 11, 12, 13, 14, 16, 17, 19, 21, 23, 24, 25, 27, 28, 29, 30, 32, 33, 35, 37, 39, 41, 43, 45, 47, 48, 49, 51, 53, 55, 56, 57, 59, 60, 61, 62, 64, 65, 67, 69, 71, 73, 75, 77, 79, 81, 83, 85, 87, 89, 91, 93, 95, 96, 97, 99, 101, 103
Offset: 1

Views

Author

Indranil Ghosh, Jan 12 2017

Keywords

Comments

From Emeric Deutsch, Jan 28 2018: (Start)
Also the indices of the compositions that have a prime number of parts. For the definition of the index of a composition see A298644.
For example, 27 is in the sequence since its binary form is 11011 and the composition [2,1,2] has 3 parts.
On the other hand, 58 is not in the sequence since its binary form is 111010 and the composition [3,1,1,1] has 4 parts.
The command c(n) from the Maple program yields the composition having index n. (End)

Examples

			27 is in the sequence because the binary reflected Gray code representation of 27 is 10110 which has 3 1's, and 3 is prime.
		

Crossrefs

Programs

  • Maple
    Runs := proc (L) local j, r, i, k: j := 1: r[j] := L[1]:
    for i from 2 to nops(L) do if L[i] = L[i-1] then r[j] := r[j], L[i] else j := j+1:
    r[j] := L[i] end if end do: [seq([r[k]], k = 1 .. j)] end proc:
    RunLengths := proc (L) map(nops, Runs(L)) end proc:
    c := proc (n) ListTools:-Reverse(convert(n, base, 2)): RunLengths(%) end proc:
    A := {}: for n to 175 do if isprime(nops(c(n))) = true then A := `union`(A, {n}) else end if end do: A;
    # most of the program is due to W. Edwin Clark. # Emeric Deutsch, Jan 28 2018
  • Mathematica
    Select[Range[100], PrimeQ[DigitCount[BitXor[#, Floor[#/2]], 2, 1]] &] (* Amiram Eldar, May 01 2021 *)
  • PARI
    is(n)=isprime(hammingweight(bitxor(n, n>>1))) \\ Charles R Greathouse IV, Jan 12 2017

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

A355034 a(n) is the least base b >= 2 where the sum of digits of n is a prime number.

Original entry on oeis.org

3, 2, 3, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 3, 8, 2, 2, 2, 2, 2, 2, 3, 2, 2, 2, 5, 2, 3, 3, 2, 4, 2, 2, 2, 2, 2, 2, 3, 2, 2, 2, 3, 2, 3, 4, 2, 2, 2, 2, 3, 2, 3, 3, 2, 2, 3, 4, 2, 6, 2, 2, 3, 18, 2, 2, 2, 2, 2, 2, 3, 2, 2, 2, 3, 2, 3, 6, 2, 2, 2, 2, 3, 2, 3, 4, 2, 2
Offset: 2

Views

Author

Rémy Sigrist, Jun 16 2022

Keywords

Comments

The sequence is well defined:
- a(2) = 3,
- for n >= 3, the expansion of n in base n-1 is "11", with sum of digits 2.

Examples

			For n = 16:
- we have the following expansions and sum of digits:
     b  16_b     Sum of digits in base b
     -  -------  -----------------------
     2  "10000"                        1
     3    "121"                        4
     4    "100"                        1
     5     "31"                        4
     6     "24"                        6
     7     "22"                        4
     8     "20"                        2
- so a(16) = 8.
		

Crossrefs

Cf. A052294, A216789, A355035 (corresponding prime numbers).

Programs

  • PARI
    a(n) = for (b=2, oo, if (isprime(sumdigits(n,b)), return (b)))
    
  • Python
    from sympy import isprime
    from sympy.ntheory.digits import digits
    def a(n):
        b = 2
        while not isprime(sum(digits(n, b)[1:])): b += 1
        return b
    print([a(n) for n in range(2, 89)]) # Michael S. Branicky, Jun 16 2022

Formula

a(n) = 2 iff n belongs to A052294.
a(n) <= n-1 for any n >= 3.
Showing 1-10 of 20 results. Next