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.

Showing 1-10 of 12 results. Next

A023506 Exponent of 2 in prime factorization of prime(n) - 1.

Original entry on oeis.org

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

Views

Author

Keywords

Comments

Also the number of steps to reach an integer starting with prime(n)/2 and iterating the map x->x*ceiling(x). - Benoit Cloitre, Sep 06 2002
Also exponent of 2 in -1 + prime(n)^s for odd exponents s because (-1 + prime(n)^s)/(prime(n) - 1) is odd. - Labos Elemer, Jan 20 2004
First occurrence of 0,1,2,3,4,...: 1, 2, 3, 13, 7, 25, 44, 116, 55, 974, 1581, 2111, 1470, 4289, 10847, 15000, 6543, 91466, 62947, 397907, 498178, ..., for primes 2, 3, 5, 41, 17, 97, 193, 641, 257, 7681, 13313, 18433, 12289, 40961, 114689, 163841, 65537, 1179649, 786433, 5767169, 7340033, .... - Robert G. Wilson v, May 28 2009
By Dirichlet's theorem on arithmetic progressions, the asymptotic density of primes p such that p == 1 (mod 2^k) within all the primes is 1/2^(k-1), for k >= 1. This is also the asymptotic density of terms in this sequence that are >= k. Therefore, the asymptotic density of the occurrences of k in this sequence is d(k) = 1/2^(k-1) - 1/2^k = 1/2^k, and the asymptotic mean of this sequence is Sum_{k>=1} k*d(k) = 2. - Amiram Eldar, Mar 14 2025

Examples

			For n = 25, prime(25) = 97, A006093(25) = 96 = 2*2*2*2*2*3, so a(25) = 5.
		

Crossrefs

Subsequence of A001511 (except 1st term).

Programs

  • Magma
    [Valuation(NthPrime(n)-1, 2): n in [1..110]]; // Bruno Berselli, Aug 05 2013
    
  • Maple
    A023506:= x -> padic[ordp](ithprime(x)-1,2):
    seq(A023506(x),x=1..1000); # Robert Israel, May 06 2014
  • Mathematica
    f[n_] := Block[{fi = First@ FactorInteger[ Prime@n - 1]}, If[ fi[[1]] == 2, fi[[2]], 0]]; Array[f, 105] (* Robert G. Wilson v, May 28 2009 *)
    Table[IntegerExponent[Prime[n] - 1, 2], {n, 110}] (* Bruno Berselli, Aug 05 2013 *)
  • PARI
    A023506(n) = {local(m,r);r=0;m=prime(n)-1;while(m%2==0,m=m/2;r++);r} \\ Michael B. Porter, Jan 26 2010
    
  • PARI
    forprime(p=2, 700, print1(valuation(p-1,2),", ")); \\ Bruno Berselli, Aug 05 2013
    
  • Python
    from sympy import prime
    def A023506(n): return (~(m:=prime(n)-1)& m-1).bit_length() # Chai Wah Wu, Jul 07 2022

Formula

A339971 Odd part of A339821(n).

Original entry on oeis.org

1, 1, 1, 1, 3, 3, 3, 3, 5, 5, 5, 5, 15, 15, 15, 15, 3, 3, 3, 3, 9, 9, 9, 9, 15, 15, 15, 15, 45, 45, 45, 45, 1, 1, 1, 1, 3, 3, 3, 3, 5, 5, 5, 5, 15, 15, 15, 15, 3, 3, 3, 3, 9, 9, 9, 9, 15, 15, 15, 15, 45, 45, 45, 45, 9, 9, 9, 9, 27, 27, 27, 27, 45, 45, 45, 45, 135, 135, 135, 135, 27, 27, 27, 27, 81, 81, 81, 81, 135
Offset: 0

Views

Author

Antti Karttunen, Dec 26 2020

Keywords

Crossrefs

Programs

  • PARI
    A000265(n) = (n>>valuation(n,2));
    A339971(n) = { my(m=1, p=2); while(n>0, p = nextprime(1+p); if(n%2, m *= A000265(p-1)); n >>= 1); (m); };

Formula

If 4n = 2^e1 + 2^e2 + ... + 2^ek [e1 ... ek distinct], then a(n) = A057023(e1) * A057023(e2) * ... * A057023(ek).
a(n) = A339821(n) / A000079(A339822(n)).

A058500 Primes of the form p*2^k + 1, where p is an odd prime and k > 0.

Original entry on oeis.org

7, 11, 13, 23, 29, 41, 47, 53, 59, 83, 89, 97, 107, 113, 137, 149, 167, 173, 179, 193, 227, 233, 263, 269, 293, 317, 347, 353, 359, 383, 389, 449, 467, 479, 503, 509, 557, 563, 569, 587, 593, 641, 653, 719, 769, 773, 797, 809, 839, 857, 863, 887, 929, 977
Offset: 1

Views

Author

Labos Elemer, Dec 20 2000

Keywords

Examples

			719 is a term because 719 = 2*359 + 1 and 359 is prime.
		

Crossrefs

Cf. A074781 (this sequence and the Fermat primes), A147545.

Programs

  • Mathematica
    mx = 1000; Select[ Sort@ Flatten@ Table[Prime[p] 2^k + 1, {p, 2, PrimePi[ mx/2]}, {k, Log2[ mx/Prime[ p]]}], PrimeQ] (* or *)
    fQ[n_] := Block[{m = n -1}, PrimeQ[m/2^IntegerExponent[m, 2]]]; Select[
    Prime@ Range@ PrimePi@ mx, fQ] (* Robert G. Wilson v, Feb 09 2018 *)
  • PARI
    isoka(p) = isprime(p) && (pp=p-1) && isprime(pp/2^valuation(pp, 2)); \\ Michel Marcus, Feb 09 2018

Extensions

Revised definition from T. D. Noe, Nov 03 2008

A340084 a(n) = gcd(n-1, A336466(n)); Odd part of A340081(n).

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 3, 1, 1, 1, 5, 1, 3, 1, 1, 1, 1, 1, 9, 1, 1, 1, 11, 1, 1, 1, 1, 3, 7, 1, 15, 1, 1, 1, 1, 1, 9, 1, 1, 1, 5, 1, 21, 1, 1, 1, 23, 1, 3, 1, 1, 3, 13, 1, 1, 1, 1, 1, 29, 1, 15, 1, 1, 1, 1, 5, 33, 1, 1, 3, 35, 1, 9, 1, 1, 3, 1, 1, 39, 1, 1, 1, 41, 1, 1, 1, 1, 1, 11, 1, 9, 1, 1, 1, 1, 1, 3, 1, 1, 1, 25, 1, 51, 1, 1
Offset: 1

Views

Author

Antti Karttunen, Dec 29 2020

Keywords

Crossrefs

Programs

  • Mathematica
    Array[GCD[#1 - 1, #2] & @@ {#, Times @@ Map[If[# <= 2, 1, (# - 1)/2^IntegerExponent[# - 1, 2]] &, Flatten[ConstantArray[#1, #2] & @@@ FactorInteger[#]]]} &, 105] (* Michael De Vlieger, Dec 29 2020 *)
  • PARI
    A000265(n) = (n>>valuation(n,2));
    A336466(n) = { my(f=factor(n)); prod(k=1,#f~,if(2==f[k,1],1,(A000265(f[k,1]-1))^f[k,2])); };
    A340084(n) = { my(u=A336466(n)); gcd(n-1, u); };

Formula

a(n) = gcd(n-1, A336466(n)).
a(n) = A000265(A340081(n)) = A336466(n) / A340085(n).
For n >= 2, a(n) = A000265(n-1) / A340086(n).
For n >= 1, a(A000040(n)) = A057023(n).
For n >= 0, a(A019565(2*n)) = A339899(n).

A057024 Largest odd factor of (n-th prime+1); k when n-th prime is written as k*2^m-1 [with k odd].

Original entry on oeis.org

3, 1, 3, 1, 3, 7, 9, 5, 3, 15, 1, 19, 21, 11, 3, 27, 15, 31, 17, 9, 37, 5, 21, 45, 49, 51, 13, 27, 55, 57, 1, 33, 69, 35, 75, 19, 79, 41, 21, 87, 45, 91, 3, 97, 99, 25, 53, 7, 57, 115, 117, 15, 121, 63, 129, 33, 135, 17, 139, 141, 71, 147, 77, 39, 157, 159, 83, 169, 87
Offset: 1

Views

Author

Henry Bottomley, Jul 24 2000

Keywords

Comments

a(n) = 1 if and only if prime(n) is a Mersenne prime. - Ely Golden, Feb 06 2017

Examples

			a(5)=3 because 5th prime is 11 and 11=3*2^2-1.
		

Crossrefs

Programs

  • Magma
    A057024:= func< n | (NthPrime(n)+1)/2^Valuation(NthPrime(n)+1, 2) >;
    [A057024(n): n in [1..100]]; // G. C. Greubel, Aug 06 2024
  • Mathematica
    Table[Max[Select[Divisors[Prime[n]+1],OddQ]],{n,100}] (* Daniel Jolly, Nov 15 2014 *)
  • PARI
    a(n) = (prime(n)+1)/2^valuation(prime(n)+1, 2); \\ Michel Marcus, Feb 05 2017
    
  • Sage
    def a(n):
        x=nth_prime(n)+1
        return x/2**((int(x)&int(-x)).bit_length()-1)
    index=1
    while(index<=10000):
        print(str(index)+" "+str(a(index)))
        index+=1
    # Ely Golden, Feb 06 2017
    

Formula

a(n) = A000265(A000040(n) + 1) = A000265(A028815(n)).
a(n) = (A000040(n) + 1)/A007814(A000040(n) + 1).
a(n) = A028815(n)/A023512(n).

A057025 Smallest prime of form (2n+1)*2^m+1 for some m.

Original entry on oeis.org

2, 7, 11, 29, 19, 23, 53, 31, 137, 1217, 43, 47, 101, 109, 59, 7937, 67, 71, 149, 79, 83, 173, 181
Offset: 0

Views

Author

Henry Bottomley, Jul 24 2000

Keywords

Comments

next term a(23) = 47*2^583+1 > 10^177. Sequence then continues: 197, 103, 107, 881, 229, 1889, 977, 127, 131, 269, 139, 569, 293, 151, 617, 317, 163, 167, 1361, 349, 179, 23297, 373, 191, 389, 199, 809, ...
If no such prime exists for any m then 2n+1 is called a Sierpiński number. One could use a(n) = 0 for these cases. E.g., a(39278) = 0 because 78557 is a Sierpiński number. For the corresponding numbers m see A046067(n+1), n >= 0, where -1 entries corresponds to a(n) = 0. See also the Sierpiński links there. - Wolfdieter Lang, Feb 07 2013

Examples

			a(5)=23 because 2*5+1=11 and smallest prime of the form 11*2^m+1 is 23 (since 11+1=12 is not prime)
		

Crossrefs

A058501 Primes p such that largest odd factor of p-1 is not a prime (i.e., is composite or 1).

Original entry on oeis.org

2, 3, 5, 17, 19, 31, 37, 43, 61, 67, 71, 73, 79, 101, 103, 109, 127, 131, 139, 151, 157, 163, 181, 191, 197, 199, 211, 223, 229, 239, 241, 251, 257, 271, 277, 281, 283, 307, 311, 313, 331, 337, 349, 367, 373, 379, 397, 401, 409, 419, 421, 431, 433, 439, 443
Offset: 1

Views

Author

Labos Elemer, Dec 20 2000

Keywords

Examples

			127 is here because 127 - 1 = 126 = 2*63 and 63 is not a prime. 2 is here because 2 - 1 = 1 = 1*2^0 and 1 is not a prime.
		

Crossrefs

Programs

  • Mathematica
    lofQ[n_]:=Module[{c=Select[Divisors[n-1],OddQ][[-1]]},!PrimeQ[c]]; Select[ Prime[ Range[100]],lofQ] (* Harvey P. Dale, Jul 24 2021 *)

Formula

Nonprimes in A057023.

A339972 Odd part of phi(A019565(8*n)).

Original entry on oeis.org

1, 3, 5, 15, 3, 9, 15, 45, 1, 3, 5, 15, 3, 9, 15, 45, 9, 27, 45, 135, 27, 81, 135, 405, 9, 27, 45, 135, 27, 81, 135, 405, 11, 33, 55, 165, 33, 99, 165, 495, 11, 33, 55, 165, 33, 99, 165, 495, 99, 297, 495, 1485, 297, 891, 1485, 4455, 99, 297, 495, 1485, 297, 891, 1485, 4455, 7, 21, 35, 105, 21, 63, 105, 315, 7, 21
Offset: 0

Views

Author

Antti Karttunen, Dec 26 2020

Keywords

Comments

Compare also to the scatter plots of A339898 and A339901.

Crossrefs

Programs

  • PARI
    A000265(n) = (n>>valuation(n, 2));
    A339972(n) = { my(m=1, p=5); while(n>0, p = nextprime(1+p); if(n%2, m *= A000265(p-1)); n >>= 1); (m); };

Formula

If 16n = 2^e1 + 2^e2 + ... + 2^ek [e1 ... ek distinct], then a(n) = A057023(e1) * A057023(e2) * ... * A057023(ek).
a(n) = A339971(4*n) = A000265(A339821(4*n)) = A053575(A019565(8*n)).

A099585 Remove all 3s from prime(n) - 1.

Original entry on oeis.org

1, 2, 4, 2, 10, 4, 16, 2, 22, 28, 10, 4, 40, 14, 46, 52, 58, 20, 22, 70, 8, 26, 82, 88, 32, 100, 34, 106, 4, 112, 14, 130, 136, 46, 148, 50, 52, 2, 166, 172, 178, 20, 190, 64, 196, 22, 70, 74, 226, 76, 232, 238, 80, 250, 256, 262, 268, 10, 92, 280, 94, 292, 34, 310
Offset: 1

Views

Author

Ralf Stephan, Oct 24 2004

Keywords

Crossrefs

Equals A038502( A006093(n) ). prime(n)-1 = a(n) * 3^A099584(n).
Cf. A057023.

Programs

  • PARI
    a(n) = (prime(n)-1)/3^valuation(prime(n)-1,3)

A356489 a(n) = A000265(rad(prime(n)-1)), rad = A007947.

Original entry on oeis.org

1, 1, 1, 3, 5, 3, 1, 3, 11, 7, 15, 3, 5, 21, 23, 13, 29, 15, 33, 35, 3, 39, 41, 11, 3, 5, 51, 53, 3, 7, 21, 65, 17, 69, 37, 15, 39, 3, 83, 43, 89, 15, 95, 3, 7, 33, 105, 111, 113, 57, 29, 119, 15, 5, 1, 131, 67, 15, 69, 35, 141, 73, 51, 155, 39, 79, 165, 21, 173, 87, 11, 179
Offset: 1

Views

Author

Jianing Song, Aug 09 2022

Keywords

Examples

			prime(8) = 19, so a(8) = A000265(rad(18)) = A000265(6) = 3.
prime(11) = 31, so a(11) = A000265(rad(30)) = A000265(30) = 15.
		

Crossrefs

Programs

  • Mathematica
    Array[#/2^IntegerExponent[#, 2] &[Times @@ FactorInteger[Prime[#] - 1][[All, 1]]] &, 72] (* Michael De Vlieger, Aug 09 2022 *)
  • PARI
    a(n) = factorback(setminus(factorint(prime(n)-1)[, 1]~, [2]))

Formula

a(n) = A000265(rad(prime(n)-1)) = rad(A000265(prime(n)-1)).
a(n) = Product_{odd primes p dividing prime(n)-1} p.
a(n) = A000265(A077063(n)) = rad(A057023(n)) = A204455(prime(n)-1).
Showing 1-10 of 12 results. Next