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

A145667 a(n) = number of components of the graph P(n,2) (defined in Comments).

Original entry on oeis.org

0, 1, 1, 2, 1, 2, 4, 11, 13, 19, 29, 43, 107, 169, 350, 603, 1134, 2070, 3803, 7502, 13989, 26495, 50826, 97369, 185827, 357307, 690577, 1332382, 2565110, 4958962, 9594425, 18569626, 36009794
Offset: 1

Views

Author

W. Edwin Clark, Mar 17 2009

Keywords

Comments

Let H(n,b) be the Hamming graph whose vertices are the sequences of length n over the alphabet {0,1,...,b-1} with adjacency being defined by having Hamming distance 1. Let P(n,b) be the subgraph of H(n,b) induced by the set of vertices which are base b representations of primes with n digits (not allowing leading 0 digits).

Crossrefs

Extensions

a(18)-a(31) from Max Alekseyev, May 12 2011
a(32)-a(33) from Max Alekseyev, Dec 23 2024

A145668 a(n) = size of the n-th term in S(2) (defined in Comments).

Original entry on oeis.org

2, 2, 1, 1, 5, 3, 4, 9, 2, 1, 1, 7, 4, 1, 1, 4, 1, 1, 1, 1, 1, 1, 1, 12, 1, 20, 1, 1, 1, 1, 1, 1, 1, 1, 1, 5, 29, 19, 1, 1, 1, 1, 1, 1, 1, 4, 1, 1, 2, 1, 1, 1, 3, 1, 75, 2, 19, 4, 1, 7, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 4, 1, 1, 1, 2, 1, 2, 1, 1, 1, 1, 23, 1, 82, 76, 1, 1, 3, 1, 1, 3, 3, 4, 2, 3, 3, 1, 2, 1, 1, 3, 1, 1, 1, 3, 1, 3, 1, 9, 1, 2, 1, 1, 1, 3, 2, 2, 1, 1, 1, 1, 1, 1, 1
Offset: 1

Views

Author

W. Edwin Clark, Mar 17 2009

Keywords

Comments

Let H(L,b) be the Hamming graph whose vertices are the sequences of length L over the alphabet {0,1,...,b-1} with adjacency being defined by having Hamming distance 1. Let P(L,b) be the subgraph of H(L,b) induced by the set of vertices which are base b representations of primes with L digits (not allowing leading 0 digits). Let S(b) be the sequence of all components of the graphs P(L,b), L>0, sorted by the smallest prime in a component.

Crossrefs

Extensions

More terms from Max Alekseyev, May 12 2011

A372517 Least k such that the k-th prime number has exactly n ones in its binary expansion.

Original entry on oeis.org

1, 2, 4, 9, 11, 64, 31, 76, 167, 309, 502, 801, 1028, 7281, 6363, 12079, 12251, 43237, 43390, 146605, 291640, 1046198, 951351, 2063216, 3957778, 11134645, 14198321, 28186247, 54387475, 249939829, 105097565, 393248783, 751545789, 1391572698, 2182112798, 8242984130
Offset: 1

Views

Author

Gus Wiseman, May 12 2024

Keywords

Comments

In other words, the a(n)-th prime is the least with binary weight n. The sorted version is A372686.

Examples

			The primes A000040(a(n)) 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}
      311:              100110111 ~ {1,2,3,5,6,9}
      127:                1111111 ~ {1,2,3,4,5,6,7}
      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}
     8191:          1111111111111 ~ {1,2,3,4,5,6,7,8,9,10,11,12,13}
    73727:      10001111111111111 ~ {1,2,3,4,5,6,7,8,9,10,11,12,13,17}
    63487:       1111011111111111 ~ {1,2,3,4,5,6,7,8,9,10,11,13,14,15,16}
		

Crossrefs

Positions firsts of first appearances in A014499.
Taking primes gives A061712.
Counting zeros (weight) gives A372474, firsts of A035103.
For binary length we have A372684 (take primes A104080), firsts of A035100.
The sorted version is A372686, taking primes A372685.
A000120 counts ones in binary expansion (binary weight), zeros A080791.
A029837 gives greatest binary index, least A001511.
A030190 gives binary expansion, reversed A030308.
A048793 lists binary indices, reverse A272020, sum A029931.
A372471 lists binary indices of primes.

Programs

  • Mathematica
    spsm[y_]:=Max@@NestWhile[Most,y,Union[#]!=Range[Max@@#]&];
    j=DigitCount[#,2,1]&/@Select[Range[1000],PrimeQ];
    Table[Position[j,k][[1,1]],{k,spsm[j]}]
  • PARI
    a(n) = my(k=1, p=2); while(hammingweight(p) !=n, p = nextprime(p+1); k++); k; \\ Michel Marcus, May 13 2024
    
  • Python
    from itertools import count
    from sympy import isprime, primepi
    from sympy.utilities.iterables import multiset_permutations
    def A372517(n):
        for l in count(n-1):
            m = 1<Chai Wah Wu, May 13 2024

Formula

A000040(a(n)) = A061712(n).

Extensions

a(32)-a(36) from Pontus von Brömssen, May 13 2024

A373126 Difference between 2^n and the greatest squarefree number <= 2^n.

Original entry on oeis.org

0, 0, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 2, 1, 2, 3, 1, 1, 2, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 2, 1, 1, 1, 2, 1, 2, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 2, 1, 2, 1, 1, 1, 2, 1, 1
Offset: 0

Views

Author

Gus Wiseman, May 29 2024

Keywords

Examples

			The greatest squarefree number <= 2^21 is 2097149, and 2^21 = 2097152, so a(21) = 3.
		

Crossrefs

For prime instead of squarefree we have A013603, opposite A092131.
For primes instead of powers of 2: A240474, A240473, A112926, A112925.
Difference between 2^n and A372889.
The opposite is A373125, delta of A372683.
A005117 lists squarefree numbers, first differences A076259.
A053797 gives lengths of gaps between squarefree numbers.
A061398 counts squarefree numbers between primes (exclusive).
A070939 or (preferably) A029837 gives length of binary expansion.
A077643 counts squarefree terms between powers of 2, run-lengths of A372475.
A143658 counts squarefree numbers up to 2^n.
Cf. A372473 (firsts of A372472), A372541 (firsts of A372433).
For primes between powers of 2:
- sum A293697 (except initial terms)
- length A036378
- min A104080 or A014210, indices A372684 (firsts of A035100)
- max A014234

Programs

  • Mathematica
    Table[2^n-NestWhile[#-1&,2^n,!SquareFreeQ[#]&],{n,0,100}]

Formula

a(n) = 2^n-A372889(n). - R. J. Mathar, May 31 2024

A145669 a(n) = smallest member of the n-th term in S(2) (defined in Comments).

Original entry on oeis.org

2, 5, 11, 13, 17, 37, 41, 67, 73, 107, 127, 131, 149, 173, 191, 193, 211, 223, 233, 239, 241, 251, 257, 263, 277, 281, 337, 349, 353, 373, 419, 431, 443, 491, 509, 521, 541, 547, 557, 613, 653, 661, 683, 701, 709, 719, 733, 761, 769, 787, 853, 877, 907, 1019, 1031, 1091, 1093, 1153, 1163, 1187, 1193, 1201, 1259, 1381, 1433, 1451, 1453, 1553, 1597, 1637, 1657, 1709, 1721, 1753, 1759, 1777, 1783, 1811, 1889, 1907, 1931, 1973, 2027
Offset: 1

Views

Author

W. Edwin Clark, Mar 17 2009

Keywords

Comments

Let H(L,b) be the Hamming graph whose vertices are the sequences of length L over the alphabet {0,1,...,b-1} with adjacency being defined by having Hamming distance 1. Let P(L,b) be the subgraph of H(L,b) induced by the set of vertices which are base b representations of primes with L digits (not allowing leading 0 digits). Let S(b) be the sequence of all components of the graphs P(L,b), L>0, sorted by the smallest prime in a component.

Crossrefs

Extensions

More terms from Max Alekseyev, May 12 2011

A145670 a(n) = largest member of the n-th term in S(2) (defined in Comments).

Original entry on oeis.org

3, 7, 11, 13, 31, 61, 59, 113, 89, 107, 127, 227, 181, 173, 191, 229, 211, 223, 233, 239, 241, 251, 257, 479, 277, 503, 337, 349, 353, 373, 419, 431, 443, 491, 509, 619, 1021, 953, 557, 613, 653, 661, 683, 701, 709, 751, 733, 761, 773, 787, 853, 877, 971, 1019, 2029, 1123, 1879, 1409, 1163, 1699, 1193, 1201, 1259, 1381, 1433, 1451, 1453, 1553, 1597, 1637, 1913, 1709, 1979, 1753, 1759, 1777, 2039, 1811, 2017, 1907, 1931, 1973, 2027
Offset: 1

Views

Author

W. Edwin Clark, Mar 17 2009

Keywords

Comments

Let H(L,b) be the Hamming graph whose vertices are the sequences of length L over the alphabet {0,1,...,b-1} with adjacency being defined by having Hamming distance 1. Let P(L,b) be the subgraph of H(L,b) induced by the set of vertices which are base b representations of primes with L digits (not allowing leading 0 digits). Let S(b) be the sequence of all components of the graphs P(L,b), L>0, sorted by the smallest prime in a component.

Crossrefs

Extensions

More terms from Max Alekseyev, May 12 2011

A373123 Sum of all squarefree numbers from 2^(n-1) to 2^n - 1.

Original entry on oeis.org

1, 5, 18, 63, 218, 891, 3676, 15137, 60580, 238672, 953501, 3826167, 15308186, 61204878, 244709252, 979285522, 3917052950, 15664274802, 62663847447, 250662444349, 1002632090376, 4010544455838, 16042042419476, 64168305037147, 256675237863576
Offset: 1

Views

Author

Gus Wiseman, May 27 2024

Keywords

Examples

			This is the sequence of row sums of A005117 treated as a triangle with row-lengths A077643:
   1
   2   3
   5   6   7
  10  11  13  14  15
  17  19  21  22  23  26  29  30  31
  33  34  35  37  38  39  41  42  43  46  47  51  53  55  57  58  59  61  62
		

Crossrefs

Counting all numbers (not just squarefree) gives A010036.
For the sectioning of A005117:
Row-lengths are A077643, partial sums A143658.
First column is A372683, delta A373125, indices A372540, firsts of A372475.
Last column is A372889, delta A373126, indices A143658, diffs A077643.
For primes instead of powers of two:
- sum A373197
- length A373198 = A061398 - 1
- maxima A112925, opposite A112926
For prime instead of squarefree:
- sum A293697 (except initial terms)
- length A036378
- min A104080 or A014210, indices A372684 (firsts of A035100)
- max A014234, delta A013603
A000120 counts ones in binary expansion (binary weight), zeros A080791.
A005117 lists squarefree numbers, first differences A076259.
A030190 gives binary expansion, reversed A030308.
A070939 or (preferably) A029837 gives length of binary expansion.
Cf. A372473 (firsts of A372472), A372541 (firsts of A372433).

Programs

  • Mathematica
    Table[Total[Select[Range[2^(n-1),2^n-1],SquareFreeQ]],{n,10}]
  • PARI
    a(n) = my(s=0); forsquarefree(i=2^(n-1), 2^n-1, s+=i[1]); s; \\ Michel Marcus, May 29 2024

A372516 Number of ones minus number of zeros in the binary expansion of the n-th prime number.

Original entry on oeis.org

0, 2, 1, 3, 2, 2, -1, 1, 3, 3, 5, 0, 0, 2, 4, 2, 4, 4, -1, 1, -1, 3, 1, 1, -1, 1, 3, 3, 3, 1, 7, -2, -2, 0, 0, 2, 2, 0, 2, 2, 2, 2, 6, -2, 0, 2, 2, 6, 2, 2, 2, 6, 2, 6, -5, -1, -1, 1, -1, -1, 1, -1, 1, 3, 1, 3, 1, -1, 3, 3, -1, 3, 5, 3, 5, 7, -1, 1, -1, 1, 1
Offset: 1

Views

Author

Gus Wiseman, May 13 2024

Keywords

Comments

Absolute value is A177718.

Examples

			The binary expansion of 83 is (1,0,1,0,0,1,1), and 83 is the 23rd prime, so a(23) = 4 - 3 = 1.
		

Crossrefs

The sum instead of difference is A035100, firsts A372684 (primes A104080).
The negative version is A037861(A000040(n)).
Restriction of A145037 to the primes.
The unsigned version is A177718.
- Positions of zeros are A177796, indices of the primes A066196.
- Positions of positive terms are indices of the primes A095070.
- Positions of negative terms are indices of the primes A095071.
- Positions of negative ones are A372539, indices of the primes A095072.
- Positions of ones are A372538, indices of the primes A095073.
- Positions of nonnegative terms are indices of the primes A095074.
- Positions of nonpositive terms are indices of the primes A095075.
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 length of binary expansion.
A101211 lists run-lengths in binary expansion, row-lengths A069010.
A372471 lists the binary indices of each prime.

Programs

  • Mathematica
    Table[DigitCount[Prime[n],2,1]-DigitCount[Prime[n],2,0],{n,100}]
    DigitCount[#,2,1]-DigitCount[#,2,0]&/@Prime[Range[100]] (* Harvey P. Dale, May 09 2025 *)

Formula

a(n) = A000120(A000040(n)) - A080791(A000040(n)).
a(n) = A014499(n) - A035103(n).
a(n) = A145037(A000040(n))

A203074 a(0)=1; for n > 0, a(n) = next prime after 2^(n-1).

Original entry on oeis.org

1, 2, 3, 5, 11, 17, 37, 67, 131, 257, 521, 1031, 2053, 4099, 8209, 16411, 32771, 65537, 131101, 262147, 524309, 1048583, 2097169, 4194319, 8388617, 16777259, 33554467, 67108879, 134217757, 268435459, 536870923, 1073741827, 2147483659
Offset: 0

Views

Author

Frank M Jackson and N. J. A. Sloane, Dec 28 2011

Keywords

Comments

Equals {1} union A014210. Unlike A014210, every positive integer can be written in one or more ways as a sum of terms of this sequence. See A203075, A203076.
a(n)*2^(n-1) = A133814(n-1) for n > 1 and a(n)*2^(n-1) for n > O is a subsequence of primitive practical numbers (A267124). - Frank M Jackson, Dec 29 2024

Examples

			a(5) = 17, since this is the next prime after 2^(5-1) = 2^4 = 16.
		

Crossrefs

Programs

  • Magma
    [1] cat [NextPrime(2^(n-1)): n in [1..40]]; // Vincenzo Librandi, Feb 23 2018
  • Mathematica
    nextprime[n_Integer] := (k=n+1;While[!PrimeQ[k], k++];k); aprime[m_Integer] := (If[m==0, 1, nextprime[2^(m-1)]]); Table[aprime[l], {l,0,100}]
    nxt[{n_,a_}]:={n+1,NextPrime[2^n]}; NestList[nxt,{0,1},40][[All,2]] (* Harvey P. Dale, Oct 10 2017 *)
  • PARI
    a(n)=if(n,nextprime(2^n/2+1),1) \\ Charles R Greathouse IV
    
  • PARI
    A203074(n)=nextprime(2^(n-1)+1)-!n  \\ M. F. Hasler, Mar 15 2012
    

Formula

A203074(n) = 2^(n-1) + A013597(n-1), for n > 0. - M. F. Hasler, Mar 15 2012
a(n) = A104080(n-1) for n > 2. - Georg Fischer, Oct 23 2018

A104082 Smallest prime >= 4^n.

Original entry on oeis.org

2, 5, 17, 67, 257, 1031, 4099, 16411, 65537, 262147, 1048583, 4194319, 16777259, 67108879, 268435459, 1073741827, 4294967311, 17179869209, 68719476767, 274877906951, 1099511627791, 4398046511119, 17592186044423, 70368744177679, 281474976710677, 1125899906842679
Offset: 0

Views

Author

Cino Hilliard, Mar 03 2005

Keywords

Crossrefs

Cf. A104080 (for 2^n), A104081 (for 3^n).
Cf. A014210.

Programs

Formula

a(n) = A104080(2n). - Jinyuan Wang, Nov 09 2018
Previous Showing 11-20 of 34 results. Next