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.

Previous Showing 71-79 of 79 results.

A214179 Primes p such that least positive primitive root of p is equal to number of 1's in binary representation of p.

Original entry on oeis.org

2, 3, 5, 7, 47, 103, 137, 157, 167, 239, 307, 397, 431, 433, 499, 521, 641, 647, 919, 997, 1163, 1303, 1429, 1543, 1753, 1811, 2063, 2081, 2087, 2111, 2377, 2591, 2711, 2833, 3119, 3181, 3217, 3719, 4079, 4153, 4211, 4271, 4273, 4297, 4549, 4643, 4721, 4931, 4993, 5399, 5857
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Jul 07 2012

Keywords

Crossrefs

Programs

  • Mathematica
    Select[Prime[Range[750]], PrimitiveRoot[#] == Plus@@IntegerDigits[#, 2] &] (* Alonso del Arte, Jul 09 2012 *)

A239695 Base 9 sum of digits of prime(n).

Original entry on oeis.org

2, 3, 5, 7, 3, 5, 9, 3, 7, 5, 7, 5, 9, 11, 7, 13, 11, 13, 11, 15, 9, 15, 3, 9, 9, 5, 7, 11, 5, 9, 7, 11, 9, 11, 13, 15, 13, 3, 7, 5, 11, 5, 7, 9, 13, 7, 11, 15, 11, 13, 17, 15, 17, 11, 9, 7, 13, 7, 13, 9, 11, 13, 11, 15, 17, 13, 11, 9, 11, 13, 9, 15, 15, 13, 11
Offset: 1

Views

Author

Tom Edgar, Mar 24 2014

Keywords

Comments

a(n) is the rank of prime(n) in the base-9 dominance order on the natural numbers.

Examples

			The fifth prime is 11, 11 in base 9 is (1,2) so a(5)=1+2=3.
		

Crossrefs

Programs

  • Magma
    [&+Intseq(NthPrime(n),9): n in [1..100]]; // Vincenzo Librandi, Mar 25 2014
    
  • Mathematica
    Table[Plus @@ IntegerDigits[Prime[n], 9], {n, 1, 100}] (* Vincenzo Librandi, Mar 25 2014 *)
  • PARI
    a(n) = sumdigits(prime(n), 9); \\ Michel Marcus, Mar 04 2023
  • Sage
    [sum(i.digits(base=9)) for i in primes_first_n(200)]
    

Formula

a(n) = A053830(A000040(n)).

A308430 Number of 0's minus number of 1's among the edge truncated binary representations of the first n prime numbers.

Original entry on oeis.org

0, 0, 1, 0, 0, 0, 3, 4, 3, 2, -1, 1, 3, 3, 1, 1, -1, -3, 0, 1, 4, 3, 4, 5, 8, 9, 8, 7, 6, 7, 2, 6, 10, 12, 14, 14, 14, 16, 16, 16, 16, 16, 12, 16, 18, 18, 18, 14, 14, 14, 14, 10, 10, 6, 13, 16, 19, 20, 23, 26, 27, 30, 31, 30, 31, 30, 31, 34, 33, 32, 35, 34, 31, 30, 27, 22, 25, 26, 29, 30, 31, 32, 29, 30, 27, 24, 27, 28, 27, 24, 23, 18, 15, 12, 9, 4, -1, 5, 9, 11
Offset: 1

Views

Author

Andrea Fornaciari, May 26 2019

Keywords

Comments

By "edge truncated" we mean removing the first and last digit. For prime(3)=5 which has binary representation 101 edge truncating yields the string '0'. If there are 2 digits, then edge truncation yields the empty string ''. We count zero 1's and zero 0's in the empty string. The only cases of this are prime(1)=2 and prime(2)=3 which have binary representations 10 and 11.

Crossrefs

Programs

  • PARI
    s=0; forprime (p=2, 541, print1 (s += #binary(p\2)+1-2*hammingweight(p\2) ", ")) \\ Rémy Sigrist, Jul 13 2019
    
  • Python
    import gmpy2
    def dec2bin(x):
        return str(bin(x))[2:]
    def digitBalance(string):
        s = 0
        for char in string:
            if int(char) > 0:
                s -= 1
            else:
                s += 1
        return s
    N = 100 # number of terms
    seq = [0]
    prime = 2
    for i in range(N-1):
        prime = gmpy2.next_prime(prime)
        binary = dec2bin(prime)
        truncated = binary[1:-1]
        term = seq[-1] + digitBalance(truncated)
        seq.append(term)
    print(seq) # Jonas K. Sønsteby, May 27 2019
    
  • Sage
    def A308430list(b):
        L = []; s = 0
        for p in prime_range(2, b):
            q = (p//2).digits(2)
            s += 1 + len(q) - 2*sum(q)
            L.append(s)
        return L
    print(A308430list(542)) # Peter Luschny, Jul 13 2019

Formula

a(n) = a(n-1) + bitlength(prime(n)2) - 2 * popcount(prime(n)_2) + 2, n > 1. - _Sean A. Irvine, May 27 2019
a(n) = Sum_{k=2..n} (A035100(k) - 2*A014499(k) + 2) = Sum_{k=2..n} (A070939(A000040(k)) - 2*A000120(A000040(k)) + 2). - Daniel Suteu, Jul 13 2019

A327777 Prime numbers whose binary indices have integer mean and integer geometric mean.

Original entry on oeis.org

2, 257, 8519971, 36574494881, 140739702949921, 140773995710729, 140774004099109
Offset: 1

Views

Author

Gus Wiseman, Sep 27 2019

Keywords

Comments

A binary index of n is any position of a 1 in its reversed binary expansion. The binary indices of n are row n of A048793.
Conjecture: This sequence is infinite.

Examples

			The initial terms together with their binary indices:
                2: {2}
              257: {1,9}
          8519971: {1,2,6,9,18,24}
      36574494881: {1,6,8,16,18,27,32,36}
  140739702949921: {1,6,12,27,32,48}
  140773995710729: {1,4,9,12,18,32,36,48}
  140774004099109: {1,3,6,12,18,24,32,36,48}
		

Crossrefs

A subset of A327368.
The binary weight of prime(n) is A014499(n), with binary length A035100(n).
Heinz numbers of partitions with integer mean: A316413.
Heinz numbers of partitions with integer geometric mean: A326623.
Heinz numbers with both: A326645.
Subsets with integer mean: A051293
Subsets with integer geometric mean: A326027
Subsets with both: A326643
Partitions with integer mean: A067538
Partitions with integer geometric mean: A067539
Partitions with both: A326641
Strict partitions with integer mean: A102627
Strict partitions with integer geometric mean: A326625
Strict partitions with both: A326029
Factorizations with integer mean: A326622
Factorizations with integer geometric mean: A326028
Factorizations with both: A326647
Numbers whose binary indices have integer mean: A326669
Numbers whose binary indices have integer geometric mean: A326673
Numbers whose binary indices have both: A327368

Programs

  • Mathematica
    bpe[n_]:=Join@@Position[Reverse[IntegerDigits[n,2]],1];
    Select[Prime[Range[1000]],IntegerQ[Mean[bpe[#]]]&&IntegerQ[GeometricMean[bpe[#]]]&]

Extensions

a(4)-a(7) from Giovanni Resta, Dec 01 2019

A356876 Binary weight of the composite numbers (A002808).

Original entry on oeis.org

1, 2, 1, 2, 2, 2, 3, 4, 1, 2, 2, 3, 3, 2, 3, 3, 4, 3, 4, 1, 2, 2, 3, 2, 3, 4, 2, 3, 3, 4, 4, 2, 3, 3, 4, 3, 4, 5, 3, 4, 4, 4, 5, 6, 1, 2, 2, 2, 3, 3, 2, 3, 4, 3, 4, 4, 2, 3, 3, 3, 4, 4, 5, 3, 4, 5, 4, 5, 5, 6, 2, 3, 4, 3, 4, 3, 4, 4, 4, 5, 6, 3, 4, 5, 4, 5, 5, 6, 4, 5, 5
Offset: 1

Views

Author

Karl-Heinz Hofmann, Oct 02 2022

Keywords

Crossrefs

Programs

  • Mathematica
    DigitCount[#, 2, 1] & /@ Select[Range[125], CompositeQ] (* Amiram Eldar, Oct 03 2022 *)
  • PARI
    forcomposite (k=0, 120, print1 (hammingweight(k),", ")) \\ Hugo Pfoertner, Oct 03 2022
  • Python
    from sympy import isprime
    print([bin(k)[2:].count("1") for k in range(4, 123) if not isprime(k)])
    

Formula

a(n) = A000120(A002808(n)).

A360448 Indices of primes of the form p = 2^i + 2^j + 1, i > j > 0 (A081091).

Original entry on oeis.org

4, 5, 6, 8, 12, 13, 19, 21, 25, 32, 33, 44, 98, 106, 116, 136, 174, 191, 310, 313, 319, 565, 568, 1029, 1470, 1902, 2111, 3513, 3518, 3521, 4289, 6544, 12426, 13632, 15000, 23001, 23003, 23043, 23673, 43395, 43420, 43465, 45859, 62947, 82029, 82063, 91466, 155612, 155900, 295957, 564164
Offset: 1

Views

Author

M. F. Hasler, Mar 03 2023

Keywords

Crossrefs

Cf. A000720 (prime counting function), A081091 (primes of the form 2^i + 2^j + 1, i > j > 0), A014499 (Hamming weight of the n-th prime), A000040 (the primes), A000120 (Hamming weight).

Programs

Formula

a(n) = A000720(A081091(n)).
This sequence = { n | A000120(A000040(n)) = 3 }.

A095377 Values of k such that the total number of 1's in the binary expansions of the first k primes is a multiple of k.

Original entry on oeis.org

1, 4, 14, 43, 46, 141, 4900, 10264541, 10281244, 10281247, 10281248, 10281249, 10281266, 10281271, 10368575, 531439030, 1997778943, 412276655628
Offset: 1

Views

Author

Labos Elemer, Jun 07 2004

Keywords

Comments

Integer solutions to {A095375(x)/x is an integer}.
a(18) > pi(10^12). - Donovan Johnson, May 03 2010
a(20) > 6.2*10^11. The first 19 ratios between the total number of 1's and k are 1, 2, 3, 4, 4, 5, 8, 14, 14, 14, 14, 14, 14, 14, 14, 17, 18, 22. - Giovanni Resta, May 08 2017

Examples

			n=14: the relevant list = {2,3,5...,41,43} = {10,11,101,...,11001,11011} contains 42 digits "1", and 42/14 = 3, so 14 is in the sequence.
		

Crossrefs

Programs

  • Mathematica
    s=0; Reap[Do[s += DigitCount[Prime@n, 2][[1]]; If[Mod[s, n] == 0, Sow@ n], {n, 10^4}]][[2, 1]] (* Giovanni Resta, May 08 2017 *)

Formula

Integer solutions to {A095375(x)/x is an integer}.

Extensions

a(16)-a(17) from Donovan Johnson, May 03 2010
a(18) from Giovanni Resta, May 08 2017

A169817 n-th prime with both a prime number of 0's and a prime number of 1's in binary representation minus n-th semiprime with both a prime number of 0's and a prime number of 1's in their binary representation.

Original entry on oeis.org

8, 9, 16, 19, 54, 77, 72, 71, 82, 72, 64, 66, 74, 79, 64, 63, 72, 77, 78, 93, 86, 88, 95, 102, 209, 218, 246, 245, 240, 258, 281, 278, 285, 304, 323, 238, 182, 187, 162, 142, 155, 136, 135, 124, 130, 139, 142, 138, 142, 134, 148, 166, 167, 174, 176, 168, 177, 174
Offset: 1

Views

Author

Juri-Stepan Gerasimov, May 25 2010

Keywords

Examples

			a(1)=A144214(1)-A178350(1)=17-9=8.
		

Crossrefs

Programs

  • Mathematica
    pn0Q[n_]:=PrimeQ[DigitCount[n,2,1]]&&PrimeQ[DigitCount[n,2,0]]; nn=600;Module[{ps=Select[Prime[Range[nn]],pn0Q],sps=Select[Range[nn], PrimeOmega[#]==2&&pn0Q[#]&],minlen},minlen=Min[Length[ps], Length[ sps]];First[#]-Last[#]&/@Thread[{Take[ps,minlen],Take[sps,minlen]}]] (* Harvey P. Dale, May 07 2012 *)

Formula

a(n)=A144214(n)-A178350(n).

Extensions

Corrected (96 replaced by 86, all numbers from a(27) on replaced) by R. J. Mathar, Jun 04 2010

A362979 Square array, read by descending antidiagonals: row n lists the primes whose base-2 representation has exactly n ones, starting from n=3.

Original entry on oeis.org

7, 11, 23, 13, 29, 31, 19, 43, 47, 311
Offset: 3

Views

Author

Clark Kimberling, May 11 2023

Keywords

Examples

			Corner:
  n=3:    7    11    13    19    37   41     67    73    97
  n=4:   23    29    43    53    71   83     89   101   113
  n=5:   31    47    59    61    79   103   107   109   151
  n=6:  311   317   347   349   359   373   461   467   571
The first four primes in row n=3 have these base-2 representations, respectively: 111, 1011, 1101, 10011.
		

Crossrefs

Cf. A019434 (row 2), A061712 (column 1), A081091 (row 3), A095077 (row 4).

Programs

  • Mathematica
    t[n_] := Count[IntegerDigits[Prime[n], 2], 1]  (* A014499 *)
    u = Table[t[n], {n, 1, 200}];
    p[n_] := Flatten[Position[u, n]]
    w = TableForm[Table[Prime[p[n]], {n, 3, 16}]]

Extensions

New offset and edited by Michel Marcus, Jan 19 2024
Previous Showing 71-79 of 79 results.