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 21-30 of 30 results.

A345867 Total number of 0's in the binary expansions of the first n primes.

Original entry on oeis.org

1, 1, 2, 2, 3, 4, 7, 9, 10, 11, 11, 14, 17, 19, 20, 22, 23, 24, 28, 31, 35, 37, 40, 43, 47, 50, 52, 54, 56, 59, 59, 64, 69, 73, 77, 80, 83, 87, 90, 93, 96, 99, 100, 105, 109, 112, 115, 116, 119, 122, 125, 126, 129, 130, 137, 142, 147, 151, 156, 161, 165, 170
Offset: 1

Views

Author

Alois P. Heinz, Jun 26 2021

Keywords

Examples

			a(3) = 2: 2 = 10_2, 3 = 11_2, 5 = 101_2, so there are two 0's in the binary expansions of the first three primes.
		

Crossrefs

Partial sums of A035103.

Programs

  • Maple
    a:= proc(n) option remember; `if`(n=0, 0, a(n-1)
          +add(1-i, i=Bits[Split](ithprime(n))))
        end:
    seq(a(n), n=1..100);
  • Mathematica
    Accumulate[DigitCount[Prime[Range[100]], 2, 0]] (* Paolo Xausa, Feb 26 2024 *)
  • Python
    from sympy import prime, primerange
    from itertools import accumulate
    def f(n): return (bin(n)[2:]).count('0')
    def aupton(nn): return list(accumulate(map(f, primerange(2, prime(nn)+1))))
    print(aupton(62)) # Michael S. Branicky, Jun 26 2021

Formula

a(n) = Sum_{i=1..n} A035103(i).
a(n) = a(n-1) for n in { A059305 }.
a(n) = A328659(n) - A095375(n).

A360357 Numbers k such that k and k+1 are both products of primes of nonprime index (A320628).

Original entry on oeis.org

1, 7, 13, 28, 37, 46, 52, 73, 91, 97, 103, 106, 112, 148, 151, 172, 181, 193, 196, 202, 223, 226, 232, 256, 262, 292, 298, 301, 316, 337, 343, 346, 361, 376, 388, 397, 427, 448, 457, 463, 466, 478, 487, 502, 511, 523, 541, 556, 568, 592, 601, 607, 613, 622, 631
Offset: 1

Views

Author

Amiram Eldar, Feb 04 2023

Keywords

Comments

There are no 3 consecutive integers that are products of primes of nonprime index since 1 out of 3 consecutive integers is divisible by 3 which is a prime-indexed prime (A006450).
If a Mersenne prime (A000668) is a prime of nonprime index, then it is in this sequence. Of the first 10 Mersenne primes 6 are in this in sequence: A000668(k) for k = 2, 5, 7, 8, 9, 10 (see A059305).

Examples

			7 = prime(4) is a term since 4 is nonprime, 7 + 1 = 8 = prime(1)^3, and 1 is also nonprime.
		

Crossrefs

Programs

  • Mathematica
    q[n_] := AllTrue[FactorInteger[n][[;; , 1]], ! PrimeQ[PrimePi[#]] &]; seq = {}; q1 = q[1]; n = 2; c = 0; While[c < 55, q2 = q[n]; If[q1 && q2, c++; AppendTo[seq, n - 1]]; q1 = q2; n++]; seq
  • PARI
    is(n) = {my(p = factor(n)[,1]); for(i = 1, #p, if(isprime(primepi(p[i])), return(0))); 1;}
    lista(nmax) = {my(q1 = is(1), q2); for(n = 2, nmax, q2 = is(n); if(q1 && q2, print1(n-1, ", ")); q1 = q2); }

A365160 Least k such that A000668(n) + k is prime, where A000668(n) is the n-th Mersenne prime.

Original entry on oeis.org

2, 4, 6, 4, 18, 30, 22, 12, 16, 30, 40, 30, 888, 486, 2056, 696, 310, 718, 4692, 1600, 2788, 4290, 4326, 4150, 18088, 22096, 16342, 72816, 181720, 4200, 58416
Offset: 1

Views

Author

Robert P. P. McKone, Aug 24 2023

Keywords

Comments

The distance between the n-th Mersenne prime and the next prime.

Examples

			A000668(6) = 131071, the next prime is 131101, so a(6) = 131101 - 131071 = 30.
		

Crossrefs

Cf. A000040, A000668 (Mersenne primes), A001223, A059305, A074626, A365161.

Programs

  • Mathematica
    m[n_] := m[n] = (2^MersennePrimeExponent[n] - 1); a[k_, n_] := a[k, n] = m[n] + k; l[k_, n_] := l[k, n] = PrimeQ[a[k, n]]; Table[k = 1; Monitor[Parallelize[While[True, If[l[k, n], Break[]]; k++]; k], {n, k}], {n, 1, 20}]

Formula

a(n) = A001223(A059305(n)). - Michel Marcus, Aug 25 2023
a(n) = A074626(n) - A000668(n). - Amiram Eldar, Aug 10 2024

Extensions

a(28) from Michael S. Branicky, Aug 11 2024
a(29) from Minfeng Wang, Oct 29 2024
a(30)-a(31) from Minfeng Wang, Oct 29 2024

A365161 Least k such that A000668(n) - k is prime, where A000668(n) is the n-th Mersenne prime.

Original entry on oeis.org

1, 2, 2, 14, 12, 8, 18, 18, 30, 20, 170, 24, 114, 56, 156, 2510, 1824, 12, 3980, 3630, 16902, 284, 7712, 20022, 12930, 9698, 16232, 1058, 256016, 23712, 26298
Offset: 1

Views

Author

Robert P. P. McKone, Aug 24 2023

Keywords

Comments

The distance between the n-th Mersenne prime and the previous prime.

Examples

			A000668(6) = 131071, the previous prime is 131063, so a(6) = 131071 - 131063 = 8.
		

Crossrefs

Cf. A000040, A000668 (Mersenne primes), A001223, A059305, A073715, A365160.

Programs

  • Mathematica
    m[n_] := m[n] = (2^MersennePrimeExponent[n] - 1); a[k_, n_] := a[k, n] = m[n] - k; l[k_, n_] := l[k, n] = PrimeQ[a[k, n]]; Table[k = 1; Monitor[Parallelize[While[True, If[l[k, n], Break[]]; k++]; k], {n, k}], {n, 1, 20}]

Formula

a(n) = A001223(A059305(n)-1). - Michel Marcus, Aug 25 2023
a(n) = A000668(n) - A073715(n). - Amiram Eldar, Aug 10 2024

Extensions

a(29)-a(31) from Michael S. Branicky, Sep 01 2024

A378252 Least prime power > 2^n.

Original entry on oeis.org

2, 3, 5, 9, 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, 4294967311, 8589934609
Offset: 0

Views

Author

Gus Wiseman, Nov 30 2024

Keywords

Comments

Prime powers are listed by A246655.
Conjecture: All terms except 9 are prime. Hence this is the same as A014210 after 9. Confirmed up to n = 1000.

Crossrefs

Subtracting 2^n appears to give A013597 except at term 3.
For prime we have A014210.
For previous we have A014234.
For perfect power we have A357751.
For squarefree we have A372683.
A000015 gives the least prime power >= n.
A000040 lists the primes, differences A001223.
A000961 and A246655 list the prime powers, differences A057820.
A024619 and A361102 list the non prime powers, diffs A375708 and A375735.
A031218 gives the greatest prime power <= n.
A244508 counts prime powers between powers of 2.
Prime powers between primes are counted by A080101 and A366833.

Programs

  • Mathematica
    Table[NestWhile[#+1&,2^n+1,!PrimePowerQ[#]&],{n,0,20}]
  • PARI
    a(n) = my(x=2^n+1); while (!isprimepower(x), x++); x; \\ Michel Marcus, Dec 03 2024
  • Python
    from itertools import count
    from sympy import primefactors
    def A378252(n): return next(i for i in count(1+(1<Chai Wah Wu, Dec 02 2024
    

A240981 Smallest perfect power b^e such that b^e+prime(n) is also a perfect power.

Original entry on oeis.org

25, 1, 4, 1, 16, 36, 8, 8, 4, 196, 1, 27, 8, 441, 81, 676, 841, 64, 1089, 125, 8, 49, 1681, 32, 128, 27, 25, 2197, 16, 8, 1, 125, 32, 2048, 2048, 361, 243, 6561, 49, 7396, 64, 8100, 25, 32, 6859, 125, 32, 289, 16, 27, 128, 4, 243, 1936, 32, 17161, 243, 729
Offset: 1

Views

Author

Zak Seidov, Aug 06 2014

Keywords

Comments

a(n) = 1 if and only if prime(n) is a Mersenne prime (A000668). Thus A059305 gives the values of n for which a(n) = 1.
For all n, a(n) exists.
Subsequence of A103953.
For n > 1, a(n) <= ((prime(n)-1)/2)^2, since ((p-1)/2)^2 + p = ((p+1)/2)^2. - Jens Kruse Andersen, Aug 10 2014

Examples

			n=1: prime(n)=2, 25 = 5^2 and  25+5=27=3^3;
n=2: prime(n)=3, 1 = 1^2 and  1+3=4=2^2;
n=3: prime(n)=5, 4 = 2^2 and  4+5=9=3^2.
		

Crossrefs

Programs

  • PARI
    {forprime(p=2,200,if(ispower(1+p),print1(1","),n=4;while(!(ispower(n)&&ispower(n+p)),n++);print1(n",")))}

A352232 a(n) is the smallest positive integer k such that 1 + k * prime(n) is a power of two.

Original entry on oeis.org

1, 3, 1, 93, 315, 15, 13797, 89, 9256395, 1, 1857283155, 25575, 381, 178481, 84973577874915, 4885260612740877, 18900352534538475, 1101298153654301589, 483939977, 7, 6958934353, 58261485282632731311141, 23, 2901803883615, 12550996041863657440561417875
Offset: 2

Views

Author

Alois P. Heinz, Mar 08 2022

Keywords

Comments

All terms are odd.

Crossrefs

Programs

  • Maple
    a:= n-> (p-> (2^numtheory[order](2, p)-1)/p)(ithprime(n)):
    seq(a(n), n=2..28);
  • Python
    from sympy.ntheory import n_order, prime
    def A352232(n): return (2**n_order(2,p:=prime(n))-1)//p # Chai Wah Wu, Mar 09 2022

Formula

a(n) = (2^A014664(n)-1)/prime(n).
A007814(a(n)*prime(n)+1) = A014664(n).
a(n) = 1 <=> n in { A059305 } <=> prime(n) in { A000668 }.
a(n)*prime(n) + 1 in { A000079 }.
a(n)*prime(n) in { A000225 }.

A023511 Least odd prime divisor of prime(n) + 1, or 1 if prime(n) + 1 is a power of 2.

Original entry on oeis.org

3, 1, 3, 1, 3, 7, 3, 5, 3, 3, 1, 19, 3, 11, 3, 3, 3, 31, 17, 3, 37, 5, 3, 3, 7, 3, 13, 3, 5, 3, 1, 3, 3, 5, 3, 19, 79, 41, 3, 3, 3, 7, 3, 97, 3, 5, 53, 7, 3, 5, 3, 3, 11, 3, 3, 3, 3, 17, 139, 3, 71, 3, 7, 3, 157, 3, 83, 13, 3, 5, 3, 3, 23, 11, 5, 3, 3, 199, 3, 5, 3, 211, 3, 7, 5, 3, 3
Offset: 1

Views

Author

Keywords

Comments

Note that a(n) = 1 for n= 2, 4, 11, 31, 1028, ... (A059305). - Michel Marcus, Oct 01 2013

Crossrefs

Programs

  • PARI
    a(n) = my(p = prime(n) + 1, v = p/(2^valuation(p, 2))) ; if (v == 1, 1, factor(v)[1, 1]); \\ Michel Marcus, Oct 01 2013

Formula

a(n) = A078701(A008864(n)). - Michel Marcus, Jun 06 2019

A131483 Meissel_Lehmer recursion: a(n,m) = a(n,m-1)-a(Floor[n/Prime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 1, 1},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
		

Crossrefs

Formula

a(1,1) = 1; a(n,m) = a(n,m-1)-a(Floor[n/Prime[m]],m-1);

A243979 Indices of Wagstaff primes.

Original entry on oeis.org

2, 5, 14, 124, 399, 4552, 15898, 203095, 37029521, 105973558438, 19140185454656173, 3827634977577891833517
Offset: 1

Views

Author

Omar E. Pol, Jun 18 2014

Keywords

Examples

			For n = 3 the third Wagstaff prime is A000979(3) = 43 and 43 is also the 14th prime number, so a(3) = 14.
		

Crossrefs

Programs

  • PARI
    default(primelimit, 10^9); forprime(p=3, 31, q=(2^p+1)/3; if(isprime(q), print1(primepi(q)", "))) \\ Jens Kruse Andersen, Jun 22 2014

Formula

a(n) = A000720(A000979(n)).
A000040(a(n)) = A000979(n).

Extensions

a(11) from Jens Kruse Andersen, Jun 22 2014
a(12) calculated using Kim Walisch's primecount and added by Amiram Eldar, Sep 05 2024
Previous Showing 21-30 of 30 results.