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.

A295746 Distinct second differences in the sequence of primes in order of appearance.

This page as a plain text file.
%I A295746 #65 Mar 02 2019 04:22:18
%S A295746 1,0,2,-2,-4,4,10,-10,8,-8,6,16,-12,-16,12,-14,-20,28,-28,-6,22,14,20,
%T A295746 26,-26,-22,-24,24,-18,18,32,-32,-30,40,-40,30,-38,-34,46,38,50,-46,
%U A295746 34,68,-64,-44,58,-58,-48,-50,48,52,-54,44,-52,36,-42,56
%N A295746 Distinct second differences in the sequence of primes in order of appearance.
%C A295746 A036263 excluding repeated terms. - _Iain Fox_, Nov 30 2017
%H A295746 Robert G. Wilson v, <a href="/A295746/b295746.txt">Table of n, a(n) for n = 1..358</a> (first 97 terms from Edward Bernstein)
%e A295746 From _Jon E. Schoenfield_, Jan 15 2018: (Start)
%e A295746 The first several primes and their 1st and 2nd differences are as follows:
%e A295746 .
%e A295746    k prime(k)  1st difference    2nd difference
%e A295746   -- --------  --------------  -------------------
%e A295746    1     2
%e A295746                  3 -  2 = 1
%e A295746    2     3                     2 - 1 =  1 (new)
%e A295746                  5 -  3 = 2
%e A295746    3     5                     2 - 2 =  0 (new)
%e A295746                  7 -  5 = 2
%e A295746    4     7                     4 - 2 =  2 (new)
%e A295746                 11 -  7 = 4
%e A295746    5    11                     2 - 4 = -2 (new)
%e A295746                 13 - 11 = 2
%e A295746    6    13                     4 - 2 =  2 (repeat)
%e A295746                 17 - 13 = 4
%e A295746    7    17                     2 - 4 = -2 (repeat)
%e A295746                 19 - 17 = 2
%e A295746    8    19                     4 - 2 =  2 (repeat)
%e A295746                 23 - 19 = 4
%e A295746    9    23                     6 - 4 =  2 (repeat)
%e A295746                 29 - 23 = 6
%e A295746   10    29                     2 - 6 = -4 (new)
%e A295746                 31 - 29 = 2
%e A295746   11    31
%e A295746 .
%e A295746 and the 2nd differences that are not repeats of 2nd differences encountered earlier are, in order of appearance, 1, 0, 2, -2, -4, ..., i.e., the terms of this sequence. (End)
%p A295746 P:= select(isprime, [2,seq(i,i=3..10^6,2)]):
%p A295746 DP:= P[2..-1]-P[1..-2]:
%p A295746 DDP:= DP[2..-1]-DP[1..-2]:
%p A295746 ListTools:-MakeUnique(DDP); # _Robert Israel_, Jan 15 2018
%t A295746 DeleteDuplicates@ Differences[Prime@ Range[10^4], 2] (* _Michael De Vlieger_, Dec 09 2017 *)
%o A295746 (PARI) first(n) = { my(res = vector(n), i=3, j=3); res[1]=1; res[2]=0; while(i<=n, my(d=prime(j+2)+prime(j)-2*prime(j+1)); if(!setsearch(Set(res), d), res[i]=d; i++); j++); res; } \\ _Iain Fox_, Nov 30 2017
%Y A295746 Cf. A036263. A295973 are the primes associated with the new second differences.
%K A295746 sign
%O A295746 1,3
%A A295746 _Edward Bernstein_, Nov 29 2017