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.

A123196 a(1) = 2; a(n+1) = a(n) + p, where p is the largest prime <= a(n).

This page as a plain text file.
%I A123196 #14 Apr 09 2017 13:44:14
%S A123196 2,4,7,14,27,50,97,194,387,770,1539,3070,6137,12270,24539,49072,98141,
%T A123196 196270,392517,785020,1570037,3140044,6280085,12560152,25120299,
%U A123196 50240588,100481175,200962342,401924669,803849308,1607698611,3215397194
%N A123196 a(1) = 2; a(n+1) = a(n) + p, where p is the largest prime <= a(n).
%C A123196 Old Name was: Jumping along the natural numbers, starting at the first prime and letting the greatest prime reached so far determine the length of the next jump, when "reached" is defined as "jumped over" as well as "landed on".
%C A123196 Note that the infinitude of this sequence follows from Bertrand's postulate.
%C A123196 From _David James Sycamore_, Apr 07 2017: (Start)
%C A123196 Among the first 500 terms, the primes are a(1)=2, a(3)=7, a(7)=97, a(107)=121474271192355984857330583869867, a(131), a(213), a(263), and a(363).
%C A123196 The underlying sequence of added primes is A075058 and A068524, without their first terms (1 & 2 respectively). (End)
%H A123196 Giovanni Resta, <a href="/A123196/b123196.txt">Table of n, a(n) for n = 1..3322</a>
%e A123196 a(1)=2 since 2 is the first prime. a(3)=7 since having landed at 4, the greatest prime reached so far is 3. a(8)=194=97+97 since with the preceding term we had landed on a prime. a(17)=98141 since having passed the prime 49069 with the term a(16) but not having reached the prime 49081, we have to add the former and indeed 98141=49069+49072.
%p A123196 a[1]:=2; for k from 1 to 29 do x:=a[k]: if isprime(x) then a[k+1]:=x+x: else y:=x: while not(isprime(y)) do y:=y-1:od; a[k+1]:= x+y: fi;od;
%t A123196 a[1]=2; a[n_]:= a[n] = If[PrimeQ[a[n-1]], 2 a[n-1], a[n-1] + NextPrime[ a[n-1], -1]]; Array[a, 100] (* _Giovanni Resta_, Apr 08 2017 *)
%o A123196 (PARI) lista(nn) = { print1(a=2, ", "); for (n=2, nn, na = a + precprime(a); print1(na, ", "); a = na;);} \\ _Michel Marcus_, Apr 08 2017
%Y A123196 Cf. A075058, A068524.
%K A123196 easy,nonn
%O A123196 1,1
%A A123196 Peter C. Heinig (algorithms(AT)gmx.de), Oct 04 2006
%E A123196 New name from _David James Sycamore_, Apr 07 2017