login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A300820 Length of the longest sequence of consecutive primes in the prime factorization of n. a(1) = 0. 4
0, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 2, 2, 1, 1, 1, 1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 2, 1, 1, 1, 2, 1, 2, 1, 1, 2, 1, 2, 2, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 2, 1, 1, 3 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,6

LINKS

Antti Karttunen, Table of n, a(n) for n = 1..65537

Index entries for sequences computed from indices in prime factorization

FORMULA

For n > 1, a(n) = A038374(A087207(n)).

For n >= 0, a(A002110(n)) = n. [Primorials give the positions of the records = the first occurrence of each n.]

EXAMPLE

For n = 350 = 2 * 5^2 * 7 = prime(1) * prime(3)^2 * prime(4), the longest stretch of consecutive primes is from prime(3) to prime(4), with length 2, thus a(350) = 2.

PROG

(PARI) A300820(n) = if(omega(n)<=1, omega(n), my(pis=apply(p->primepi(p), factor(n)[, 1]), el=1, m=1); for(i=2, #pis, if(pis[i] == (1+pis[i-1]), el++; m = max(m, el), el=1)); (m));

(PARI) a(n) = {if(n == 1, return(0)); my(res = 1, f = factor(n)[, 1]~, t = 1);

for(i = 1, #f - 1, if(f[i+1]==nextprime(f[i]+1), t++, res = max(res, t);  t = 1)); max(res, t)} \\ David A. Corneth, Mar 21 2018

CROSSREFS

Cf. A038374, A087207, A104210 (positions of terms > 1), A296210.

Cf. also A167447.

Sequence in context: A107910 A280801 A085006 * A257990 A257743 A033272

Adjacent sequences:  A300817 A300818 A300819 * A300821 A300822 A300823

KEYWORD

nonn

AUTHOR

Antti Karttunen, Mar 21 2018

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified February 24 10:27 EST 2020. Contains 332209 sequences. (Running on oeis4.)