login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A053597 Let prime(i) = i-th prime (A000040), let d(i) = prime(i+1)-prime(i) (A001223); a(n) = number of distinct numbers among d(n), d(n+1), d(n+2), ... before first duplicate is encountered. 3

%I #11 Jan 04 2021 13:53:29

%S 2,1,2,2,2,2,3,3,2,3,3,2,3,2,1,2,3,3,3,3,2,3,4,3,2,2,2,3,2,5,4,3,2,3,

%T 2,1,2,2,1,3,2,3,2,3,2,1,3,2,3,4,3,3,2,1,1,2,3,5,4,4,4,3,2,5,5,5,4,5,

%U 4,3,2,2,1,2,3,3,2,4,3,2,2,4,3,2,3,4,3,2,4,3,3,2,2,6,5,4,5,4,3,2,2,1,2,3,2

%N Let prime(i) = i-th prime (A000040), let d(i) = prime(i+1)-prime(i) (A001223); a(n) = number of distinct numbers among d(n), d(n+1), d(n+2), ... before first duplicate is encountered.

%H Robert Israel, <a href="/A053597/b053597.txt">Table of n, a(n) for n = 1..10000</a>

%e The d sequence starting at prime(7) = 17 is d(7) = 2, d(8) = 4, d(9) = 6, d(10) = 2, with three numbers before the first duplication, so a(7) = 3.

%p P:= [seq(ithprime(i),i=1..1000)]:

%p G:= P[2..-1]-P[1..-2]:

%p R:= Vector(990):

%p for i from 1 to 990 do

%p for k from 1 while nops(convert(G[i..i+k-1],set))=k do od:

%p R[i]:= k-1;

%p od:

%p convert(R,list);

%t f[n_] := Block[{k = 1}, While[p = Table[ Prime[i], {i, n, n + k}]; Length[ Union[ Drop[p, 1] - Drop[p, -1]]] == k, k++ ]; k - 1]; Table[ f[n], {n, 1, 105}]

%Y A078515 gives RECORDS transform of this sequence. See also A079007.

%K easy,nonn

%O 1,1

%A _N. J. A. Sloane_, Jan 07 2003

%E More terms from _Robert G. Wilson v_, Jan 07 2002

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

License Agreements, Terms of Use, Privacy Policy. .

Last modified March 28 07:33 EDT 2024. Contains 371235 sequences. (Running on oeis4.)