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.
%I A049711 #26 Aug 04 2022 05:51:57 %S A049711 1,1,2,1,2,1,2,3,4,1,2,1,2,3,4,1,2,1,2,3,4,1,2,3,4,5,6,1,2,1,2,3,4,5, %T A049711 6,1,2,3,4,1,2,1,2,3,4,1,2,3,4,5,6,1,2,3,4,5,6,1,2,1,2,3,4,5,6,1,2,3, %U A049711 4,1,2,1,2,3,4,5,6,1,2,3,4,1,2,3,4,5,6,1,2,3,4,5,6 %N A049711 a(n) = n - prevprime(n). %C A049711 All runs end in even numbers at a(p), new highs are found at A000101 and the increasing gap size is A005250. - _Robert G. Wilson v_, Dec 07 2001 %C A049711 All terms are positive since here the variant 2 (A151799(n) < n) of the prevprime function is used, rather than the variant 1 (A007917(n) <= n). - _M. F. Hasler_, Sep 09 2015 %F A049711 a(n) = A064722(n-1) + 1. - _Pontus von Brömssen_, Jul 31 2022 %p A049711 A049711 := n-> n-prevprime(n); %t A049711 PrevPrim[n_] := Block[ {k = n - 1}, While[ !PrimeQ[k], k-- ]; Return[k]]; Table[ n - PrevPrim[n], {n, 3, 100} ] %t A049711 Array[#-NextPrime[#,-1]&,100,3] (* _Harvey P. Dale_, Dec 07 2011 *) %o A049711 (PARI) A049711(n)=n-precprime(n-1) \\ _M. F. Hasler_, Sep 09 2015 %Y A049711 Cf. A000101, A005250, A049613, A049653, A049716, A049847, A064722. %Y A049711 Cf. A151799, A007917. %Y A049711 Cf. A175851. %K A049711 nonn %O A049711 3,3 %A A049711 _N. J. A. Sloane_