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

A057690 Length of cycle in trajectory of P under the 'Px+1' map, where P = n-th prime, or -1 if trajectory does not cycle.

Original entry on oeis.org

3, 3, 4, 4, 3, 4, 4, 5, 4, 6, 3, 4, 4, 6, 5, 5, 3, 4, 6, 3, 6, 5, 5, 4, 4, 5, 6, 4, 4, 8, 5, 4, 5, 5, 5, 3, 4, 6, 4, 6, 4, 8, 3, 5, 6, 4, 7, 5, 4, 5, 7, 4, 6, 4, 6, 6, 6, 3, 12, 4, 5, 5, 6, 3, 4, 4, 4, 5, 5, 4, 7, 6, 4, 5, 9, 5, 3, 4, 4, 6, 3, 8, 4, 6, 5, 6, 3, 5, 6, 6, 8, 5, 5, 6, 7, 5, 5, 4, 3, 4, 5, 5, 5, 5, 4
Offset: 2

Views

Author

N. J. A. Sloane, Oct 20 2000

Keywords

Comments

See A057684 for definition.
Note that not all cycles for the iteration starting with p contain the number 1; a(60), for the prime 281, is the first example of this. Its iterates are: 281, 78962, 39481, 3037, 853398, 426699, 142233, 47411, 6773, 521, 146402, 73201, 1031, 289712, 144856, 72428, 36214, 18107, 953, 267794, 133897, with the last 12 terms cycling. Another example is provided by 2543, the 372nd prime. - T. D. Noe, Apr 02 2008

Examples

			For n=4, P=7: trajectory of 7 is 7, 50, 25, 5, 1, 8, 4, 2, 1, 8, 4, 2, 1, 8, 4, 2, 1, ..., which has maximal term 50, cycle length 4 and there are 4 terms before it enters the cycle.
		

Crossrefs

Programs

  • Mathematica
    Px1[p_,n_]:=Catch[For[i=1,iPaolo Xausa, Dec 11 2023 *)
  • PARI
    f(m, p) = {forprime(q=2, precprime(p-1), if (! (m % q), return (m/q));); m*p+1;}
    a(n) = {my(p=prime(n), x=p, list = List()); listput(list, x); while (1, x = f(x, p); for (i=1, #list, if (x == list[i], return (#list - i + 1));); listput(list, x););} \\ Michel Marcus, Jan 12 2021
    
  • Python
    from sympy import prime, primerange
    def a(n):
        P = prime(n)
        x, plst, traj, seen = P, list(primerange(2, P)), [], set()
        while x not in seen:
            traj.append(x)
            seen.add(x)
            x = next((x//p for p in plst if x%p == 0), P*x+1)
        return len(traj) - traj.index(x)
    print([a(n) for n in range(2, 107)]) # Michael S. Branicky, Dec 11 2023

Formula

a(n) = A023514(n)+1 if the cycle contains the number 1. - Jon Maiga, Jan 12 2021

Extensions

More terms from Larry Reeves (larryr(AT)acm.org), Nov 08 2000
Corrected by T. D. Noe, Apr 02 2008

A008335 Number of distinct primes dividing p+1 as p runs through the primes.

Original entry on oeis.org

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

Views

Author

Keywords

Crossrefs

Programs

  • Maple
    for i from 1 to 500 do if isprime(i) then print(nops(factorset(i+1))); fi; od;
  • Mathematica
    a[n_] := PrimeNu[Prime[n]+1]; Array[a, 100] (* Amiram Eldar, Sep 10 2024 *)
  • PARI
    a(n) = omega(prime(n)+1); \\ Michel Marcus, Mar 29 2016

Formula

a(n) = A001221(A008864(n)). - Michel Marcus, Mar 29 2016

A210934 Sum of prime factors of prime(n)+1 (counted with multiplicity).

Original entry on oeis.org

3, 4, 5, 6, 7, 9, 8, 9, 9, 10, 10, 21, 12, 15, 11, 11, 12, 33, 21, 12, 39, 13, 14, 13, 16, 22, 19, 13, 18, 24, 14, 18, 28, 16, 15, 25, 81, 45, 16, 34, 15, 22, 15, 99, 19, 16, 57, 17, 26, 30, 21, 16, 24, 17, 48, 20, 16, 25, 141, 52, 75, 19, 22, 22, 159, 58, 87
Offset: 1

Views

Author

Paolo P. Lava, Mar 30 2012

Keywords

Comments

From an idea of Michael B. Porter.

Examples

			prime(8) = 19, and 19+1 = 20 = 2*2*5, so a(8) = 2+2+5 = 9.
		

Crossrefs

Programs

  • Maple
    with(numtheory);
    P:=proc(i)
    local a,k,n;
    for n from 1 to i do
      a:=ifactors(ithprime(n)+1)[2]; print(add(a[k][1]*a[k][2],k=1..nops(a)));
    od; end:
    # alternative
    A210934 := proc(n)
        local p,pplus,f ;
        p := ithprime(n) ;
        pplus := ifactors(p+1)[2] ;
        add(op(1,f)*op(2,f),f=pplus) ;
    end proc:
    seq(A210934(n),n=1..300) ; # R. J. Mathar, May 25 2022

Formula

a(n) = A001414(A008864(n)). - Michel Marcus, Oct 05 2013

A210936 Sum of prime factors of prime(n)-1 (counted with multiplicity).

Original entry on oeis.org

0, 2, 4, 5, 7, 7, 8, 8, 13, 11, 10, 10, 11, 12, 25, 17, 31, 12, 16, 14, 12, 18, 43, 17, 13, 14, 22, 55, 13, 15, 15, 20, 23, 28, 41, 15, 20, 14, 85, 47, 91, 15, 26, 15, 18, 19, 17, 42, 115, 26, 35, 26, 16, 17, 16, 133, 71, 16, 30, 18, 52, 77, 25, 38, 22, 83
Offset: 1

Views

Author

Paolo P. Lava, Mar 30 2012

Keywords

Comments

From an idea of Michael B. Porter.

Examples

			prime(10) = 29, and 29-1 = 28 = 2*2*7, so a(10) = 2+2+7 = 11.
		

Crossrefs

Programs

  • Maple
    with(numtheory);
    P:=proc(i)
    local a,k,n;
    for n from 1 to i do
      a:=ifactors(ithprime(n)-1)[2]; print(add(a[k][1]*a[k][2],k=1..nops(a)));
    od; end:
    # alternative
    A210936 := proc(n)
            local p,pplus,f ;
            p := ithprime(n) ;
            pplus := ifactors(p-1)[2] ;
            add(op(1,f)*op(2,f),f=pplus) ;
    end proc:
    seq(A210936(n),n=1..300) ; # R. J. Mathar, May 25 2022

Formula

a(n) = A001414(A006093(n)). - Michel Marcus, Oct 05 2013

A254787 a(n)= least initial term of n consecutive primes {p(m),..,p(m+n-1)} such that all numbers {1+p(m),..,1+p(m+n-1)} are a product of the same number k primes, where p(m) is m-th prime A000040(m).

Original entry on oeis.org

2, 3, 139, 557, 3821, 53609, 179659, 7190917, 3599100, 16687573, 20394197, 101439558
Offset: 1

Views

Author

Zak Seidov, Feb 15 2015

Keywords

Comments

Corresponding values of m are: 1,2,34,102,530,5462,16309,488739,3599100,308495917,20394197,101439558
Corresponding values of k are: 1,2,4,4,5,4,5,4,5,4,5,5
A023514(i=m,..,m+n-1) are of the same value.

Examples

			a(2)=3, because {p(2),p(3)}={3,5}, and {4,6}={2^2,2*3}, k=2;
a(3)=139, because {p(34),p(35),p(36)}={139,149,151}, and {140,150,152}={2^2*5*7,2*3*5^2,2^3*19}, k=4.
		

Crossrefs

A283652 Primes p such that bigomega(p+1) = 20.

Original entry on oeis.org

5505023, 8847359, 13271039, 17915903, 22118399, 24379391, 27131903, 29859839, 31981567, 32440319, 34406399, 36863999, 37486591, 38273023, 42205183, 46448639, 48496639, 54001663, 57016319, 60948479, 61439999, 62128127, 62705663, 67184639
Offset: 1

Views

Author

Zak Seidov, Mar 12 2017

Keywords

Crossrefs

Programs

  • Mathematica
    p = 4128767; While[p<=57016319, If[PrimeOmega[1 + p] == 20, Print[p,", "]]; p = NextPrime[p + 2]] (* Indranil Ghosh, Mar 13 2017, after the PARI program from the author *)
    Select[Prime[Range[4*10^6]],PrimeOmega[#+1]==20&] (* Harvey P. Dale, Jul 05 2020 *)
  • PARI
    {p=4128767; while(p<=57016319, if(bigomega(1+p)==20, print1(p ",")); p=nextprime(p+2))}

A255164 Numbers m such that, starting with prime(m), 10 consecutive primes plus 1 are a product of the same number k of primes (i.e., are k-almost primes).

Original entry on oeis.org

16687573, 18163180, 19945279, 21433861, 32241571, 41642534, 61124701, 84985671, 99125673, 120180818, 132409582, 136276974, 139516858, 149714850, 152735870, 160041096, 161934847, 172578057, 177536370, 177733590, 185207739
Offset: 1

Views

Author

Zak Seidov, Feb 15 2015

Keywords

Comments

{A023514(m),..,A023514(m+9)} are of the same value k.

Examples

			a(1)=16687573 because A023514(16687573),..,A023514(16687573+9) are all equal to 4, or
prime(16687573,..,16687573+9)=
{308495917, 308495947, 308495953, 308496017, 308496043, 308496049, 308496091, 308496157, 308496169, 308496173}, and
308495918=2*23*103*65111, 308495948=2^2*79*976253,
308495954=2*13*127*93427, 308496018=2*3*43*1195721,
308496044=2^2*139*554849, 308496050=2*5^2*6169921,
308496092=2^2*131*588733, 308496158=2*37*317*13151,
308496170=2*5*421*73277, 308496174=2*3*7*7345147.
		

Crossrefs

Showing 1-7 of 7 results.