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 51-55 of 55 results.

A061716 Binary order of n-th prime.

Original entry on oeis.org

1, 2, 3, 3, 4, 4, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10
Offset: 1

Views

Author

Labos Elemer, Jun 20 2001

Keywords

Comments

Apart from the first terms, the same as A035100. - R. J. Mathar, Oct 02 2008

Crossrefs

Programs

  • Mathematica
    Ceiling[Log2[Prime[Range[110]]]] (* Harvey P. Dale, Apr 12 2023 *)
  • PARI
    a(n) = { logint(prime(n)-1, 2) + 1 } \\ Harry J. Smith, Jul 26 2009

Formula

a(n) = ceiling(log_2(prime(n))) = A029837(A000040(n)).

Extensions

Offset changed from 0 to 1 by Harry J. Smith, Jul 26 2009

A084421 a(n) = A005187(A000040(n)).

Original entry on oeis.org

3, 4, 8, 11, 19, 23, 32, 35, 42, 54, 57, 71, 79, 82, 89, 102, 113, 117, 131, 138, 143, 153, 162, 174, 191, 198, 201, 209, 213, 222, 247, 259, 271, 274, 294, 297, 309, 322, 329, 341, 353, 357, 375, 383, 390, 393, 417, 439, 449, 453, 461, 471, 477, 495, 512
Offset: 1

Views

Author

Reinhard Zumkeller, Jun 26 2003

Keywords

Examples

			A000040(6)=13 -> [13/2]=6 -> [6/2]=3 -> [3/2]=1
.......... 13 -> 13+6=19 -> 19+3=22 -> 22+1=23=a(6).
		

Crossrefs

Programs

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

A227471 Position of first 0 in the binary representation of prime(n), starting the count of positions at 1 for the least significant bit.

Original entry on oeis.org

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

Views

Author

Juri-Stepan Gerasimov, Jul 12 2013

Keywords

Comments

If no zero appears in the base-2 representation, the search "falls through" and addresses the (virtual) leading zero of that prime, see A035100. - R. J. Mathar, Jul 20 2013

Crossrefs

Formula

a(n) = 1+A023512(n). - Antti Karttunen, Jul 13 2013
Previous Showing 51-55 of 55 results.