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 41-50 of 55 results. Next

A338427 a(n) is the largest prime(n)-smooth primitive nondeficient number.

Original entry on oeis.org

6, 20, 2205, 12705, 117234117, 42840834309, 2792098376579421, 674431969285588989475, 21526530767769616227341527825, 292210459765634328314801626540200511773, 292210459765634328314801626540200511773
Offset: 2

Views

Author

David A. Corneth and Peter Munn, Oct 26 2020

Keywords

Comments

See A006039 for a definition and list of primitive nondeficient numbers.
The first prime being 2, the prime(1)-smooth numbers are the powers of 2, which are all deficient. So a(1) is undefined, and the sequence offset is 2.
Omitting the initial "6" gives us the largest prime(n)-smooth primitive abundant numbers (based on their A071395 definition). Using the variant definition of primitive abundant from A091191, the equivalent sequence starts 18, 30, 2205, 12705, 117234117, ... .
If m is a prime(n)-smooth primitive nondeficient number, the odd part of m divides a member of one of the first (n - 1) finite sets described in the Dickson reference and the even part of m is less than 2^A035100(n). This provides an upper bound for such numbers, meaning there is a largest prime(n)-smooth primitive nondeficient number for all n >= 2.

Examples

			Initial terms, showing factorization:
   n          a(n)
   2             6 = 2 * 3,
   3            20 = 2^2 * 5,
   4          2205 = 3^2 * 5 * 7^2,
   5         12705 = 3 * 5 * 7 * 11^2,
   6     117234117 = 3^2 * 7^2 * 11^2 * 13^3,
   7   42840834309 = 3^4 * 7^2 * 13^3 * 17^3,
   ...
The largest primitive nondeficient (and primitive abundant) number that has prime(12) = 37 as largest prime factor is 29504726357465429322218597476548828125, which is one digit shorter than the largest 31-smooth primitive nondeficient (and primitive abundant) number, 292210459765634328314801626540200511773. So a(12) = a(11).
		

Crossrefs

After removing duplicate terms we get a subsequence of A006039, A338133.
The largest prime(n)-smooth numbers meeting other divisor-related criteria: A211198, A273057.
Largest primitive nondeficient numbers meeting other criteria: A287581.

Formula

a(n) = Max_{m <= n, k >= 1} A338133(m, k).
a(n) = max( {m in A006039 : A006530(m) <= A000040(n)} ).

A372538 Numbers k such that the number of ones minus the number of zeros in the binary expansion of the k-th prime number is 1.

Original entry on oeis.org

3, 8, 20, 23, 24, 26, 30, 58, 61, 63, 65, 67, 78, 80, 81, 82, 84, 88, 185, 187, 194, 200, 201, 203, 213, 214, 215, 221, 225, 226, 227, 234, 237, 246, 249, 253, 255, 256, 257, 259, 266, 270, 280, 284, 287, 290, 573, 578, 586, 588, 591, 593, 611, 614, 615, 626
Offset: 1

Views

Author

Gus Wiseman, May 13 2024

Keywords

Examples

			The binary expansion of 83 is (1,0,1,0,0,1,1) with ones minus zeros 4 - 3 = 1, and 83 is the 23rd prime, so 23 is in the sequence.
The primes A000040(a(n)) together with their binary expansions and binary indices begin:
     5:           101 ~ {1,3}
    19:         10011 ~ {1,2,5}
    71:       1000111 ~ {1,2,3,7}
    83:       1010011 ~ {1,2,5,7}
    89:       1011001 ~ {1,4,5,7}
   101:       1100101 ~ {1,3,6,7}
   113:       1110001 ~ {1,5,6,7}
   271:     100001111 ~ {1,2,3,4,9}
   283:     100011011 ~ {1,2,4,5,9}
   307:     100110011 ~ {1,2,5,6,9}
   313:     100111001 ~ {1,4,5,6,9}
   331:     101001011 ~ {1,2,4,7,9}
   397:     110001101 ~ {1,3,4,8,9}
   409:     110011001 ~ {1,4,5,8,9}
   419:     110100011 ~ {1,2,6,8,9}
   421:     110100101 ~ {1,3,6,8,9}
   433:     110110001 ~ {1,5,6,8,9}
   457:     111001001 ~ {1,4,7,8,9}
  1103:   10001001111 ~ {1,2,3,4,7,11}
  1117:   10001011101 ~ {1,3,4,5,7,11}
  1181:   10010011101 ~ {1,3,4,5,8,11}
  1223:   10011000111 ~ {1,2,3,7,8,11}
		

Crossrefs

Restriction of A031448 to the primes, positions of ones in A145037.
Taking primes gives A095073, negative A095072.
Positions of ones in A372516, absolute value A177718.
A000120 counts ones in binary expansion (binary weight), zeros A080791.
A030190 gives binary expansion, reversed A030308.
A035103 counts zeros in binary expansion of primes, firsts A372474.
A048793 lists binary indices, reverse A272020, sum A029931.
A070939 gives the length of an integer's binary expansion.
A101211 lists run-lengths in binary expansion, row-lengths A069010.
A372471 lists binary indices of primes.

Programs

  • Mathematica
    Select[Range[1000],DigitCount[Prime[#],2,1]-DigitCount[Prime[#],2,0]==1&]

A372539 Numbers k such that the number of ones minus the number of zeros in the binary expansion of the k-th prime number is -1.

Original entry on oeis.org

7, 19, 21, 25, 56, 57, 59, 60, 62, 68, 71, 77, 79, 87, 175, 177, 179, 180, 186, 188, 189, 192, 193, 195, 196, 197, 204, 210, 212, 216, 218, 243, 244, 248, 254, 262, 263, 265, 279, 567, 572, 576, 577, 583, 592, 598, 599, 600, 602, 603, 605, 606, 610, 613, 616
Offset: 1

Views

Author

Gus Wiseman, May 14 2024

Keywords

Examples

			The binary expansion of 17 is (1,0,0,0,1) with ones minus zeros 2 - 3 = -1, and 17 is the 7th prime, 7 is in the sequence.
The primes A000040(a(n)) together with their binary expansions and binary indices begin:
    17:         10001 ~ {1,5}
    67:       1000011 ~ {1,2,7}
    73:       1001001 ~ {1,4,7}
    97:       1100001 ~ {1,6,7}
   263:     100000111 ~ {1,2,3,9}
   269:     100001101 ~ {1,3,4,9}
   277:     100010101 ~ {1,3,5,9}
   281:     100011001 ~ {1,4,5,9}
   293:     100100101 ~ {1,3,6,9}
   337:     101010001 ~ {1,5,7,9}
   353:     101100001 ~ {1,6,7,9}
   389:     110000101 ~ {1,3,8,9}
   401:     110010001 ~ {1,5,8,9}
   449:     111000001 ~ {1,7,8,9}
  1039:   10000001111 ~ {1,2,3,4,11}
  1051:   10000011011 ~ {1,2,4,5,11}
  1063:   10000100111 ~ {1,2,3,6,11}
  1069:   10000101101 ~ {1,3,4,6,11}
  1109:   10001010101 ~ {1,3,5,7,11}
  1123:   10001100011 ~ {1,2,6,7,11}
  1129:   10001101001 ~ {1,4,6,7,11}
  1163:   10010001011 ~ {1,2,4,8,11}
		

Crossrefs

Restriction of A031444 (positions of '-1's in A145037) to A000040.
Taking primes gives A095072.
Positions of negative ones in A372516, absolute value A177718.
The negative version is A372538, taking primes A095073.
A000120 counts ones in binary expansion (binary weight), zeros A080791.
A030190 gives binary expansion, reversed A030308.
A035103 counts zeros in binary expansion of primes, firsts A372474.
A048793 lists binary indices, reverse A272020, sum A029931.
A070939 gives the length of an integer's binary expansion.
A101211 lists run-lengths in binary expansion, row-lengths A069010.
A372471 lists binary indices of primes.

Programs

  • Mathematica
    Select[Range[1000],DigitCount[Prime[#],2,1]-DigitCount[Prime[#],2,0]==-1&]

A372685 Prime numbers such that no lesser prime has the same binary weight (number of ones in binary expansion).

Original entry on oeis.org

2, 3, 7, 23, 31, 127, 311, 383, 991, 2039, 3583, 6143, 8191, 63487, 73727, 129023, 131071, 522239, 524287, 1966079, 4128767, 14680063, 16250879, 33546239, 67108351, 201064447, 260046847, 536739839, 1073479679, 2147483647, 5335154687, 8581545983, 16911433727
Offset: 1

Views

Author

Gus Wiseman, May 10 2024

Keywords

Comments

The unsorted version is A061712.

Examples

			The terms together with their binary expansions and binary indices begin:
     2:            10 ~ {2}
     3:            11 ~ {1,2}
     7:           111 ~ {1,2,3}
    23:         10111 ~ {1,2,3,5}
    31:         11111 ~ {1,2,3,4,5}
   127:       1111111 ~ {1,2,3,4,5,6,7}
   311:     100110111 ~ {1,2,3,5,6,9}
   383:     101111111 ~ {1,2,3,4,5,6,7,9}
   991:    1111011111 ~ {1,2,3,4,5,7,8,9,10}
  2039:   11111110111 ~ {1,2,3,5,6,7,8,9,10,11}
  3583:  110111111111 ~ {1,2,3,4,5,6,7,8,9,11,12}
  6143: 1011111111111 ~ {1,2,3,4,5,6,7,8,9,10,11,13}
		

Crossrefs

This statistic (binary weight of primes) is A014499.
Sorted version of A061712.
For binary length instead of weight we have A104080, firsts of A035100.
These primes have indices A372686, sorted version of A372517.
A000120 counts ones in binary expansion (binary weight), zeros A080791.
A029837 gives greatest binary index, least A001511.
A030190 gives binary expansion, reversed A030308.
A035103 counts zeros in binary expansion of primes, firsts A372474.
A048793 lists binary indices, reverse A272020, sum A029931.
A372471 lists binary indices of primes.

Programs

  • Mathematica
    First/@GatherBy[Select[Range[1000],PrimeQ],DigitCount[#,2,1]&]
  • Python
    from itertools import islice
    from sympy import nextprime
    def A372685_gen(): # generator of terms
        p, a = 1, {}
        while (p:=nextprime(p)):
            if (c:=p.bit_count()) not in a:
                yield p
            a[c] = p
    A372685_list = list(islice(A372685_gen(),20)) # Chai Wah Wu, May 12 2024

Formula

a(n) = prime(A372686(n)).

Extensions

a(22)-a(33) from Chai Wah Wu, May 12 2024

A091931 Change the first bit to 0 in binary notation for the n-th prime.

Original entry on oeis.org

0, 1, 1, 3, 3, 5, 1, 3, 7, 13, 15, 5, 9, 11, 15, 21, 27, 29, 3, 7, 9, 15, 19, 25, 33, 37, 39, 43, 45, 49, 63, 3, 9, 11, 21, 23, 29, 35, 39, 45, 51, 53, 63, 65, 69, 71, 83, 95, 99, 101, 105, 111, 113, 123, 1, 7, 13, 15, 21, 25, 27, 37, 51, 55, 57, 61, 75, 81, 91, 93, 97, 103
Offset: 1

Views

Author

Reinhard Zumkeller, Feb 14 2004

Keywords

Comments

a(n) = A053645(A000040(n)).

Crossrefs

Cf. A091932.

Programs

  • Mathematica
    FromDigits[Rest[IntegerDigits[#,2]],2]&/@Prime[Range[80]] (* Harvey P. Dale, Apr 20 2012 *)
  • PARI
    for(n=1,72,p=prime(n);p-=2^(#binary(p)-1);print1(p,", ")) \\ Washington Bomfim, Jan 18 2011

Formula

a(n) = A000040(n) - 2^(A035100(n)-1).

A163291 Number of digits of n-th prime written in base 4.

Original entry on oeis.org

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

Views

Author

Juri-Stepan Gerasimov, Jul 24 2009

Keywords

Examples

			6th prime = 13 = 31_4, so a(6) = 2;
7th prime = 17 = 101_4, so a(7) = 3;
54th prime = 251 = 3323_4, so a(54) = 4;
55th prime = 257 = 10001_4, so a(55) = 5.
		

Crossrefs

Programs

  • Mathematica
    IntegerLength[#, 4] & /@ Prime[Range[100]] (* G. C. Greubel, Dec 17 2016 *)
  • PARI
    a(n) = #digits(prime(n), 4); \\ Michel Marcus, Dec 18 2016

Formula

a(n) = log_4 n + log_4 log n + O(1). - Charles R Greathouse IV, Mar 25 2010

A163293 a(n) = n-th prime minus (number of bits in binary expansion of n-th prime).

Original entry on oeis.org

0, 1, 2, 4, 7, 9, 12, 14, 18, 24, 26, 31, 35, 37, 41, 47, 53, 55, 60, 64, 66, 72, 76, 82, 90, 94, 96, 100, 102, 106, 120, 123, 129, 131, 141, 143, 149, 155, 159, 165, 171, 173, 183, 185, 189, 191, 203, 215, 219, 221, 225, 231, 233, 243, 248, 254, 260, 262, 268, 272
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Jul 24 2009

Keywords

Comments

Number of bits in binary expansion of n-th prime = A035100.

Examples

			a(6) = 13 - 4 = 9;
a(7) = 17 - 5 = 12.
		

Crossrefs

Programs

Formula

a(n) = A000040(n) - A035100(n).

A168157 Number of 0's in the matrix whose lines are the binary expansion of the first n primes.

Original entry on oeis.org

1, 1, 4, 4, 9, 10, 19, 21, 22, 23, 23, 37, 40, 42, 43, 45, 46, 47, 69, 72, 76, 78, 81, 84, 88, 91, 93, 95, 97, 100, 100, 136, 141, 145, 149, 152, 155, 159, 162, 165, 168, 171, 172, 177, 181, 184, 187, 188, 191, 194, 197, 198, 201, 202, 263, 268, 273, 277, 282, 287
Offset: 1

Views

Author

M. F. Hasler, Nov 21 2009

Keywords

Comments

The matrix is to be taken of minimal size, i.e., have n lines and the number of columns needed to write the n-th prime in the last line, A035100(n). Otherwise said, there is no zero column except for n=1 (prime(1) = 2 = 10[2] in binary).
The number of zeros in the last line of the matrix is given by A035103(n).
One has a(n)=a(n-1) iff n = A059305(k) for some k, i.e. prime(n) is a Mersenne prime A000668(k) = A000225(A000043(k)).
If prime(n)=2^2^k+1 is a Fermat prime (A019434), n>2, then one has a(n)=a(n-1)+n-1+2^k-1.
More generally, the "big jumps" a(n+1) > a(n)+n happen whenever a column is added, i.e. when prime(n) = A014234(k) <=> prime(n+1) = A104080(k) for some k,n>1.

Examples

			a(4)=4 is the number of zeros in the matrix [010] /* = 2 in binary */ [011] /* = 3 in binary */ [101] /* = 5 in binary */ [111] /* = 7 in binary */
		

Programs

  • PARI
    A168157(n)=n*#binary(prime(n))-sum(i=1,n,norml2(binary(prime(i))))

Formula

a(n)=n*A035100(n)-A095375(n).

A298817 a(n) is the binary XOR of all n-bit prime numbers.

Original entry on oeis.org

0, 1, 2, 6, 23, 59, 99, 203, 469, 807, 1615, 3349, 2266, 4576, 14042, 25002, 89193, 131215, 135904, 814531, 885682, 60842, 3969154, 3370892, 6742296, 14350136, 42766902, 97565102, 444197631, 515121776, 2085329975, 2091732354, 7999937231, 14794305847
Offset: 1

Views

Author

Alex Ratushnyak, Jan 26 2018

Keywords

Comments

XOR is the binary exclusive-or operator.
a(1)=0 for compatibility with similar sequences, and because 0 and 1 are not primes.
Note the sequence s(n)-a(n), where s(n)=A298816(n) is the binary XOR of all n-bit squares, begins: 1, -1, 2, 3, -14, -38, -87, -175, -20, -230, -1258, -2352, 3819, 9957, -1525, -9925, 31932, 21654, 264124, 226521, 405022, 2495526, 944510, 8579700, 15679080, 49342536, -35092149, -19209773, -131473914. The distribution of negative and positive terms does not look random: runs of negative terms are followed by runs of positive terms.

Examples

			There are two 4-bit primes, namely 11 and 13.  a(4) = (11 XOR 13) = 6.
		

Crossrefs

Programs

  • PARI
    a(n) = {my(x = 0); for (k=2^(n-1), 2^n-1, if (isprime(k), x = bitxor(x, k));); x;} \\ Michel Marcus, Jan 27 2018
  • Python
    from sympy import nextprime
    n = x = L = 2
    print('0', end=',')
    while L < 27:
        nextn = nextprime(n)
        if (nextn ^ n) > n:  # if lengths of binary representations are different
            print(str(x), end=',')
            x = 0
            prevL = L
            L = len(bin(nextn))-2
            for j in range(prevL, L-1):  print('0', end=',')
        n = nextn
        x ^= n
    

Extensions

a(30)-a(34) from Lars Blomberg, Nov 10 2018

A373124 Sum of indices of primes between powers of 2.

Original entry on oeis.org

1, 2, 7, 11, 45, 105, 325, 989, 3268, 10125, 33017, 111435, 369576, 1277044, 4362878, 15233325, 53647473, 189461874, 676856245, 2422723580, 8743378141, 31684991912, 115347765988, 421763257890, 1548503690949, 5702720842940, 21074884894536, 78123777847065
Offset: 0

Views

Author

Gus Wiseman, May 31 2024

Keywords

Comments

Sum of k such that 2^n+1 <= prime(k) <= 2^(n+1).

Examples

			Row-sums of the sequence of all positive integers as a triangle with row-lengths A036378:
   1
   2
   3  4
   5  6
   7  8  9 10 11
  12 13 14 15 16 17 18
  19 20 21 22 23 24 25 26 27 28 29 30 31
  32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54
		

Crossrefs

For indices of primes between powers of 2:
- sum A373124 (this sequence)
- length A036378
- min A372684 (except initial terms), delta A092131
- max A007053
For primes between powers of 2:
- sum A293697
- length A036378
- min A104080 or A014210
- max A014234, delta A013603
For squarefree numbers between powers of 2:
- sum A373123
- length A077643, run-lengths of A372475
- min A372683, delta A373125, indices A372540
- max A372889, delta A373126, indices A143658

Programs

  • Mathematica
    Table[Total[PrimePi/@Select[Range[2^(n-1)+1,2^n],PrimeQ]],{n,10}]
  • PARI
    ip(n) = primepi(1<A007053
    t(n) = n*(n+1)/2; \\ A000217
    a(n) = t(ip(n+1)) - t(ip(n)); \\ Michel Marcus, May 31 2024
Previous Showing 41-50 of 55 results. Next