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 31-40 of 55 results. Next

A098388 a(n) = floor(log_2(prime(n))).

Original entry on oeis.org

1, 1, 2, 2, 3, 3, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 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, 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
Offset: 1

Views

Author

Reinhard Zumkeller, Sep 06 2004

Keywords

Comments

a(n) is the greatest k such that 2^k does not exceed prime(n). - David James Sycamore, Sep 14 2021
a(n) is the number of representations of prime(n) as a sum 2^m+r, where 1 <= r < prime(n): a(5) = 3 because prime(5) = 11 = 2^3 + 3 = 2^2 + 7 = 2^1 + 9. - Clark Kimberling, Feb 06 2025

Crossrefs

Programs

  • Maple
    map(ilog2, select(isprime,[2,seq(2*i+1,i=1..1000)])); # Robert Israel, Jun 08 2015
  • Mathematica
    Floor[Log[2, Prime[Range[105]]]] (* data *) (* parameter changed by Hartmut F. W. Hoft, Jun 02 2015 *)
  • PARI
    a(n) = logint(prime(n), 2); \\ Michel Marcus, Sep 17 2017
    
  • Python
    from sympy import prime
    def A098388(n): return prime(n).bit_length()-1 # Chai Wah Wu, Nov 19 2024

Formula

a(n) = A000523(A000040(n)); A098391(n) = A000523(a(n)).
a(n) = A035100(n) - 1. - Michel Marcus, Sep 17 2017

A372687 Number of prime numbers whose binary indices sum to n. Number of strict integer partitions y of n such that Sum_i 2^(y_i-1) is prime.

Original entry on oeis.org

0, 0, 1, 1, 1, 0, 2, 1, 2, 0, 3, 3, 1, 4, 1, 6, 5, 8, 4, 12, 8, 12, 7, 20, 8, 16, 17, 27, 19, 38, 19, 46, 33, 38, 49, 65, 47, 67, 83, 92, 94, 113, 103, 130, 146, 127, 215, 224, 176, 234, 306, 270, 357, 383, 339, 393, 537, 540, 597, 683, 576, 798, 1026, 830, 1157
Offset: 0

Views

Author

Gus Wiseman, May 15 2024

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.
Note the inverse of A048793 (binary indices) takes a set s to Sum_i 2^(s_i-1).

Examples

			The a(2) = 1 through a(17) = 8 prime numbers:
  2  3  5  .  17  11  19  .  257  131  73  137  97  521  4099  1031
              7       13     67   41       71       263  2053  523
                             37   23       43       139  1033  269
                                           29       83   193   163
                                                    53   47    149
                                                    31         101
                                                               89
                                                               79
The a(2) = 1 through a(11) = 3 strict partitions:
  (2)  (2,1)  (3,1)  .  (5,1)    (4,2,1)  (4,3,1)  .  (9,1)    (6,4,1)
                        (3,2,1)           (5,2,1)     (6,3,1)  (8,2,1)
                                                      (7,2,1)  (5,3,2,1)
		

Crossrefs

For all positive integers (not just prime) we get A000009.
Number of prime numbers p with A029931(p) = n.
For odd instead of prime we have A096765, even A025147, non-strict A087787
Number of times n appears in A372429.
Number of rows of A372471 with sum n.
The non-strict version is A372688 (or A372887), ranks A277319 (or A372850).
These (strict) partitions have Heinz numbers A372851.
A014499 lists binary indices of prime numbers.
A019565 gives Heinz number of binary indices, adjoint A048675.
A038499 counts partitions of prime length, strict A085756.
A048793 lists binary indices:
- length A000120
- min A001511
- sum A029931
- max A070939
- reverse A272020
A058698 counts partitions of prime numbers, strict A064688.
A096111 gives product of binary indices.
A372689 lists numbers whose binary indices sum to a prime.
A372885 lists primes whose binary indices sum to a prime, indices A372886.

Programs

  • Mathematica
    Table[Length[Select[IntegerPartitions[n], UnsameQ@@#&&PrimeQ[Total[2^#]/2]&]],{n,0,30}]

A372850 Numbers whose distinct prime indices are the binary indices of some prime number.

Original entry on oeis.org

3, 6, 9, 10, 12, 18, 20, 22, 24, 27, 30, 36, 40, 42, 44, 46, 48, 50, 54, 60, 66, 70, 72, 80, 81, 84, 88, 90, 92, 96, 100, 102, 108, 114, 118, 120, 126, 130, 132, 140, 144, 150, 160, 162, 168, 176, 180, 182, 184, 192, 198, 200, 204, 216, 228, 236, 238, 240, 242
Offset: 1

Views

Author

Gus Wiseman, May 16 2024

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.
A prime index of n is a number m such that prime(m) divides n. The multiset of prime indices of n is row n of A112798.
Note the function taking a set s to its rank Sum_i 2^(s_i-1) is the inverse of A048793 (binary indices).

Examples

			The distinct prime indices of 45 are {2,3}, which are the binary indices of 6, which is not prime, so 45 is not in the sequence.
The distinct prime indices of 60 are {1,2,3}, which are the binary indices of 7, which is prime, so 60 is in the sequence.
The terms together with their prime indices begin:
    3: {2}
    6: {1,2}
    9: {2,2}
   10: {1,3}
   12: {1,1,2}
   18: {1,2,2}
   20: {1,1,3}
   22: {1,5}
   24: {1,1,1,2}
   27: {2,2,2}
   30: {1,2,3}
   36: {1,1,2,2}
   40: {1,1,1,3}
   42: {1,2,4}
   44: {1,1,5}
   46: {1,9}
   48: {1,1,1,1,2}
   50: {1,3,3}
   54: {1,2,2,2}
   60: {1,1,2,3}
   66: {1,2,5}
   70: {1,3,4}
		

Crossrefs

For even instead of prime we have A005408, with multiplicity A003159.
For odd instead of prime we have A005843, with multiplicity A036554.
For prime indices with multiplicity we have A277319, counted by A372688.
The squarefree case is A372851, counted by A372687.
Partitions of this type are counted by A372887.
A014499 lists binary indices of prime numbers.
A019565 gives Heinz number of binary indices, adjoint A048675.
A038499 counts partitions of prime length, strict A085756.
A048793 and A272020 (reverse) list binary indices:
- length A000120
- min A001511
- sum A029931
- max A070939
A058698 counts partitions of prime numbers, strict A064688.
A372885 lists primes whose binary indices sum to a prime, indices A372886.

Programs

  • Mathematica
    prix[n_]:=If[n==1,{},Flatten[Cases[FactorInteger[n],{p_,k_}:>Table[PrimePi[p],{k}]]]];
    Select[Range[100],PrimeQ[Total[2^(Union[prix[#]]-1)]]&]

Formula

Numbers k such that Sum_{i:prime(i)|k} 2^(i-1) is prime, where the sum is over the distinct prime indices of k.

A372851 Squarefree numbers whose prime indices are the binary indices of some prime number.

Original entry on oeis.org

3, 6, 10, 22, 30, 42, 46, 66, 70, 102, 114, 118, 130, 182, 238, 246, 266, 318, 330, 354, 370, 402, 406, 434, 442, 510, 546, 646, 654, 690, 762, 770, 798, 930, 938, 946, 962, 986, 1066, 1102, 1122, 1178, 1218, 1222, 1246, 1258, 1334, 1378, 1430, 1482, 1578
Offset: 1

Views

Author

Gus Wiseman, May 16 2024

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.
A prime index of n is a number m such that prime(m) divides n. The multiset of prime indices of n is row n of A112798.
Note the function taking a set s to its rank Sum_i 2^(s_i-1) is the inverse of A048793 (binary indices).

Examples

			The prime indices of 70 are {1,3,4}, which are the binary indices of 13, which is prime, so 70 is in the sequence.
The prime indices of 15 are {2,3}, which are the binary indices of 6, which is not prime, so 15 is not in the sequence.
The terms together with their prime indices begin:
    3: {2}
    6: {1,2}
   10: {1,3}
   22: {1,5}
   30: {1,2,3}
   42: {1,2,4}
   46: {1,9}
   66: {1,2,5}
   70: {1,3,4}
  102: {1,2,7}
  114: {1,2,8}
  118: {1,17}
  130: {1,3,6}
  182: {1,4,6}
  238: {1,4,7}
  246: {1,2,13}
  266: {1,4,8}
  318: {1,2,16}
  330: {1,2,3,5}
  354: {1,2,17}
  370: {1,3,12}
  402: {1,2,19}
		

Crossrefs

[Warning: do not confuse A372887 with the strict case A372687.]
For odd instead of prime we have A039956.
For even instead of prime we have A056911.
Strict partitions of this type are counted by A372687.
Non-strict partitions of this type are counted by A372688, ranks A277319.
The nonsquarefree version is A372850, counted by A372887.
A014499 lists binary indices of prime numbers.
A019565 gives Heinz number of binary indices, adjoint A048675.
A038499 counts partitions of prime length, strict A085756.
A048793 and A272020 (reverse) list binary indices:
- length A000120
- min A001511
- sum A029931
- max A070939
A058698 counts partitions of prime numbers, strict A064688.
A372885 lists primes whose binary indices sum to a prime, indices A372886.

Programs

  • Mathematica
    Select[Range[100],SquareFreeQ[#] && PrimeQ[Total[2^(PrimePi/@First/@FactorInteger[#]-1)]]&]

Formula

Squarefree numbers k such that Sum_{i:prime(i)|k} 2^(i-1) is prime, where the sum is over the (distinct) prime indices of k.

A372887 Number of integer partitions of n whose distinct parts are the binary indices of some prime number.

Original entry on oeis.org

0, 0, 1, 1, 3, 3, 6, 8, 12, 14, 21, 29, 36, 48, 56, 74, 94, 123, 144, 195, 235, 301, 356, 456, 538, 679, 803, 997, 1189, 1467, 1716, 2103, 2488, 2968, 3517, 4185, 4907, 5834, 6850, 8032, 9459, 11073, 12933, 15130, 17652, 20480, 24011, 27851, 32344, 37520
Offset: 0

Views

Author

Gus Wiseman, May 19 2024

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.
Note the inverse of A048793 (binary indices) takes a set s to Sum_i 2^(s_i-1).

Examples

			The partition y = (4,3,1,1) has distinct parts {1,3,4}, which are the binary indices of 13, which is prime, so y is counted under a(9).
The a(2) = 1 through a(9) = 14 partitions:
  (2)  (21)  (22)   (221)   (51)     (331)     (431)      (3321)
             (31)   (311)   (222)    (421)     (521)      (4221)
             (211)  (2111)  (321)    (511)     (2222)     (4311)
                            (2211)   (2221)    (3221)     (5211)
                            (3111)   (3211)    (3311)     (22221)
                            (21111)  (22111)   (4211)     (32211)
                                     (31111)   (5111)     (33111)
                                     (211111)  (22211)    (42111)
                                               (32111)    (51111)
                                               (221111)   (222111)
                                               (311111)   (321111)
                                               (2111111)  (2211111)
                                                          (3111111)
                                                          (21111111)
		

Crossrefs

For odd instead of prime we have A000041, even A002865.
The strict case is A372687, ranks A372851.
Counting not just distinct parts gives A372688, ranks A277319.
These partitions have Heinz numbers A372850.
A014499 lists binary indices of prime numbers.
A019565 gives Heinz number of binary indices, adjoint A048675.
A058698 counts partitions of prime numbers, strict A064688.
A372689 lists numbers whose binary indices sum to a prime.
A372885 lists primes whose binary indices sum to a prime, indices A372886.
Binary indices:
- listed A048793, sum A029931
- reversed A272020
- opposite A371572, sum A230877
- length A000120, complement A023416
- min A001511, opposite A000012
- max A070939, opposite A070940
- complement A368494, sum A359400
- opposite complement A371571, sum A359359

Programs

  • Mathematica
    Table[Length[Select[IntegerPartitions[n], PrimeQ[Total[2^(Union[#]-1)]]&]],{n,0,30}]

A154703 Concatenation of the first n primes written in base 2.

Original entry on oeis.org

10, 1011, 1011101, 1011101111, 10111011111011, 101110111110111101, 10111011111011110110001, 1011101111101111011000110011, 101110111110111101100011001110111, 10111011111011110110001100111011111101, 1011101111101111011000110011101111110111111
Offset: 1

Views

Author

Jonathan Vos Post, Jan 14 2009

Keywords

Comments

Number of bits in a(n) = Sum_{i=1..n} A035100(i). See A328659(n).

Examples

			a(2) = 1011 = 10 Concat 11 = (2 base 2) Concat (3 base 2).
		

Crossrefs

Programs

  • Maple
    A154703 := proc(n) option remember: local d: if(n=1)then return 10: fi: d:=convert(ithprime(n),base,2): return parse(cat(convert(procname(n-1),string), convert(op(convert(d,base,10,10^nops(d))),string))): end: seq(A154703(n),n=1..10); # Nathaniel Johnston, May 27 2011
    # second Maple program:
    a:= proc(n) option remember; `if`(n=0, 0,
          parse(cat(a(n-1), convert(ithprime(n), binary))))
        end:
    seq(a(n), n=1..12);  # Alois P. Heinz, Dec 16 2024
  • Mathematica
    With[{p = IntegerDigits[Prime[Range[15]], 2]}, Array[FromDigits[Flatten[p[[;;#]]]] &, Length[p]]] (* Paolo Xausa, Feb 26 2024 *)
  • PARI
    a(n) = fromdigits(concat(apply(binary, primes(n)))); \\ Michel Marcus, Jul 17 2023

Formula

a(n) = CONCATENATE[i=1..n] A004676(i) = CONCATENATE[i=1..n] A007088(A000040(i)).

Extensions

Corrected terms a(6) and beyond from Seiichi Manyama, Jul 17 2023

A372686 Sorted list of positions of first appearances in A014499 (number of ones in binary expansion of each prime).

Original entry on oeis.org

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

Views

Author

Gus Wiseman, May 14 2024

Keywords

Comments

The unsorted version is A372517.

Examples

			The sequence contains 9 because the first 9 terms of A014499 are 1, 2, 2, 3, 3, 3, 2, 3, 4, and the last of these is the first position of 4.
		

Crossrefs

Positions of first appearances in A014499.
The unsorted version is A372517.
For binary length we have A372684, primes A104080, firsts of A035100.
Taking primes gives A372685, unsorted version A061712.
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 each prime, firsts A372474.
A048793 lists binary indices, reverse A272020, sum A029931.
A070939 gives length of binary expansion (number of bits).
A372471 lists binary indices of primes.

Programs

  • Mathematica
    First/@GatherBy[Range[1000],DigitCount[Prime[#],2,1]&]

Formula

prime(a(n)) = A372685(n).

Extensions

a(26)-a(36) from Pontus von Brömssen, May 15 2024

A338133 Primitive nondeficient numbers sorted by largest prime factor then by increasing size. Irregular triangle T(n, k), n >= 2, k >= 1, read by rows, row n listing those with largest prime factor = prime(n).

Original entry on oeis.org

6, 20, 28, 70, 945, 1575, 2205, 88, 550, 3465, 5775, 7425, 8085, 12705, 104, 572, 650, 1430, 2002, 4095, 6435, 6825, 9555, 15015, 78975, 81081, 131625, 189189, 297297, 342225, 351351, 570375, 63126063, 99198099, 117234117, 272, 748, 1870, 2210, 5355, 8415, 8925, 11492
Offset: 2

Views

Author

David A. Corneth and Peter Munn, Oct 11 2020

Keywords

Comments

For definitions and further references/links, see A006039, the main entry for primitive nondeficient numbers.
Rows are finite: row n is a subset of the divisors of any of the products formed by multiplying 2^(A035100(n)-1) by a member of the first n finite sets described in the Dickson reference.
Column 1 includes the even perfect numbers.
The largest number in rows 2..n (therefore the largest that is prime(n)-smooth) is A338427(n). - Peter Munn, Sep 07 2021

Examples

			Row 1 is empty as there exists no primitive nondeficient number of the form prime(1)^k = 2^k.
Row 2 is (6) as 6 is the only primitive nondeficient number of the form prime(1)^k * prime(2)^m = 2^k * 3^m that is a multiple of prime(2) = 3.
Irregular triangle T(n, k) begins:
  n   prime(n)  row n
  2      3      6;
  3      5      20;
  4      7      28, 70, 945, 1575, 2205;
  5     11      88, 550, 3465, 5775, 7425, 8085, 12705;
  ...
See also the factorization of initial terms below:
      6 = 2 * 3,
     20 = 2^2 * 5,
     28 = 2^2 * 7,
     70 = 2 * 5 * 7,
    945 = 3^3 * 5 * 7,
   1575 = 3^2 * 5^2 * 7,
   2205 = 3^2 * 5 * 7^2,
     88 = 2^3 * 11,
    550 = 2 * 5^2 * 11,
   3465 = 3^2 * 5 * 7 * 11,
   5775 = 3 * 5^2 * 7 * 11,
   7425 = 3^3 * 5^2 * 11,
   8085 = 3 * 5 * 7^2 * 11,
  12705 = 3 * 5 * 7 * 11^2,
    104 = 2^3 * 13,
    572 = 2^2 * 11 * 13,
    650 = 2 * 5^2 * 13,
   1430 = 2 * 5 * 11 * 13,
   2002 = 2 * 7 * 11 * 13,
   4095 = 3^2 * 5 * 7 * 13,
  ...
		

Crossrefs

A000040, A006530 are used to define this sequence.
Permutation of A006039.
A047802\{12}, A308710 are subsequences.

Programs

  • PARI
    rownupto(n, u) = { my(res = List(), pr = primes(n), e = vector(n, i, logint(u, pr[i]))); vu = vector(n, i, [0, e[i]]); vu[n][1] = 1; forvec(x = vu, c = prod(i = 1, n, pr[i]^x[i]); if(c <= u && isprimitive(c), listput(res, c) ) ); Set(res) }
    isprimitive(n) = { my(f = factor(n), c); if(sigma(f) < 2*n, return(0)); for(i = 1, #f~, c = n / f[i,1]; if(sigma(c) >= c * 2, return(0) ) ); 1 }
    for(i = 2, 7, print(rownupto(i, 10^9)))

Formula

A006530(T(n, k)) = A000040(n).
T(n, 1) = A308710(n-1) [provided there is no least deficient number that is not a power of 2, as described in A000079].
For m >= 1, T(A059305(m), 1) = A000668(m) * 2^(A000043(m)-1) = A000668(m) * A061652(m).

A163400 Number of bits in binary expansion of n-th nonprime.

Original entry on oeis.org

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

Views

Author

Juri-Stepan Gerasimov, Jul 26 2009

Keywords

Comments

Here n-th nonprime=A141468(n).
For n > 2, a(n) = A029837(n) or A029837(n)+1.

Examples

			a(1)=1(0=nonprime(1) written in base 2 and 10); a(2)=1(1=nonprime(2) written in base 2 and 10); a(3)=3(100=nonprime(3) written in base 2 where 4=nonprime(3) written in base 10).
		

Crossrefs

Programs

  • Maple
    A141468 := proc(n) option remember; if n = 1 then 0; else for a from procname(n-1)+1 do if not isprime(a) then return a; fi; od: fi; end: A070939 := proc(n) max(1,ilog2(n)+1) ; end: A163400 := proc(n) A070939(A141468(n)) ; end: seq(A163400(n),n=1..120) ; # R. J. Mathar, Oct 10 2009
  • Mathematica
    Prepend[Flatten@ Array[If[PrimeQ[ # ], {}, IntegerLength[ #, 2]] &, 100000], 1] (* Jasper Mulder (jasper.mulder(AT)planet.nl), Jun 03 2010 *)

Extensions

Edited by Charles R Greathouse IV, Mar 22 2010

A303594 Number of bits in binary expansion of A294994(n).

Original entry on oeis.org

2, 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, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 7, 7, 7, 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, 10, 10, 10, 10, 10, 10
Offset: 1

Views

Author

N. J. A. Sloane, May 27 2018

Keywords

Crossrefs

Programs

  • PARI
    s = 0; v = 2; for (n=1, 101, print1 (#binary(v) ", "); s += 2^v; forprime (p=2, oo, if (!bittest(s, p) && hammingweight(bitxor(p, v))<=2, v = p; break))) \\ Rémy Sigrist, May 27 2018
Previous Showing 31-40 of 55 results. Next