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-3 of 3 results.

A181715 Length of the complete Cunningham chain of the second kind starting with prime(n).

Original entry on oeis.org

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

Views

Author

M. F. Hasler, Nov 17 2010

Keywords

Comments

Number of iterations x -> 2x-1 needed to get a composite number, when starting with prime(n).
Dickson's conjecture implies that, for every positive integer r, there exist infinitely many n such that a(n) = r. - Lorenzo Sauras Altuzarra, Feb 12 2021
a(n) is the least k such that 2^k * (prime(n)-1) + 1 is composite. Note that a(n) is well defined since 2^(p-1) * (p-1) + 1 is divisible by p for odd primes p. - Jianing Song, Nov 24 2021

Examples

			2 -> 3 -> 5 -> 9 = 3^2, so a(1) = 3 and a(2) = 2. - _Jonathan Sondow_, Oct 30 2015
		

Crossrefs

Programs

  • Maple
    a := proc(n)
       local c, l:
       c, l := 0, ithprime(n):
       while isprime(l) do c, l := c+1, 2*l-1: od:
       c:
    end: # Lorenzo Sauras Altuzarra, Feb 12 2021
  • Mathematica
    Table[p = Prime[n]; cnt = 1; While[p = 2*p - 1; PrimeQ[p], cnt++]; cnt, {n, 100}] (* T. D. Noe, Jul 12 2012 *)
    Table[-1 + Length@ NestWhileList[2 # - 1 &, Prime@ n, PrimeQ@ # &], {n, 98}] (* Michael De Vlieger, Apr 26 2017 *)
  • PARI
    a(n)= n=prime(n); for(c=1,1e9, is/*pseudo*/prime(n=2*n-1) || return(c))

Formula

a(n) < prime(n) for n > 1; see Löh (1989), p. 751. - Jonathan Sondow, Oct 28 2015
max(a(n), A181697(n)) = A263879(n) for n > 2. - Jonathan Sondow, Oct 30 2015
a(n) = A285700(A000040(n)). - Antti Karttunen, Apr 26 2017

Extensions

Escape clause added to definition by N. J. A. Sloane, Feb 19 2021
Escape clause deleted from definition by Jianing Song, Nov 24 2021

A285701 a(n) = number of iterations x -> A064216(x) needed to reach a nonprime number when starting from n, a(2) = a(3) = 1.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Apr 26 2017

Keywords

Examples

			For n=2, A064216(2) = 2, thus there is exactly one distinct prime that can be reached when iterating A064216 starting from 2, thus a(2) = 1.
For n=19, A064216(19) = 31 (a prime), A064216(31) = 59 (a prime) and A064216(59) = 44 (not a prime), thus there are exactly three distinct primes that are encountered when iterating A064216 starting from 19 before a nonprime is reached, thus a(19) = 3 (the count includes also the starting prime 19).
		

Crossrefs

Cf. A005382 (gives positions of terms > 1 from its third term 7 onward).

Programs

Formula

If A010051(n) = 0 [when n is a nonprime], a(n) = 0, otherwise a(n) = 1 + a(A064216(n)), with a(2) = a(3) = 1.

A348511 Numbers k for which 2k+1 can be obtained with successive prime shifts towards larger primes (by iterating A003961, starting from k).

Original entry on oeis.org

2, 3, 4, 5, 10, 11, 23, 29, 41, 53, 57, 83, 89, 113, 131, 173, 179, 191, 233, 239, 251, 281, 293, 359, 419, 431, 443, 491, 509, 593, 641, 653, 659, 683, 719, 743, 761, 809, 911, 953, 1013, 1019, 1031, 1049, 1054, 1103, 1223, 1229, 1289, 1409, 1439, 1451, 1481, 1499, 1511, 1559, 1583, 1601, 1733, 1811, 1889, 1901, 1931
Offset: 1

Views

Author

Antti Karttunen, Oct 30 2021

Keywords

Comments

Numbers k for which A246277(2k+1) = A246277(k). This in turn implies a looser condition A046523(2k+1) = A046523(k).
Conjecture: Apart from 4 all other terms in this sequence are squarefree. No counterexamples <= 2^22.

Examples

			4 is present, because by applying prime shift once to it, we get A003961(4) = 9 = 2*4 + 1.
5 is present, because by applying prime shift twice to it, we get 5 -> 7 -> 11 = 2*5 + 1.
		

Crossrefs

Subsequences: A005384 (primes present), A348514 (terms requiring only one iteration to reach 2k+1).
Cf. also A285706.

Programs

  • Maple
    filter:= proc(n) local F,F1,F2,G,G1,G2;
      F:= sort(ifactors(n)[2],(a,b) -> a[1] a[1] nops(G) then return false fi;
      F2:= map(t -> t[2],F);
      G2:= map(t -> t[2],G);
      if F2 <> G2 then return false fi;
      if nops(F) = 1 then return true fi;
      F1:= map(t -> numtheory:-pi(t[1]),F);
      G1:= map(t -> numtheory:-pi(t[1]),G);
      nops(convert(G1-F1,set))=1;
    end proc:
    select(filter, [$2..10000]);# Robert Israel, Feb 18 2022
  • Mathematica
    f[p_, e_] := NextPrime[p]^e; s[1] = 1; s[n_] := Times @@ f @@@ FactorInteger[n]; q[n_] := NestWhileList[s, n, # < 2*n + 1 &][[-1]] == 2*n + 1; Select[Range[2, 2000], q] (* Amiram Eldar, Oct 30 2021 *)
  • PARI
    A246277(n) = if(1==n, 0, my(f = factor(n), k = primepi(f[1,1])-1); for (i=1, #f~, f[i,1] = prime(primepi(f[i,1])-k)); factorback(f)/2);
    isA348511(n) = (A246277(n)==A246277(1+n+n));
Showing 1-3 of 3 results.