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.

Showing 1-5 of 5 results.

A344580 Numbers k such that A101203(k) is prime.

Original entry on oeis.org

4, 5, 6, 7, 8, 15, 18, 19, 26, 33, 44, 50, 64, 69, 74, 115, 138, 139, 150, 151, 161, 170, 208, 213, 218, 232, 233, 237, 246, 258, 275, 289, 290, 303, 309, 310, 311, 333, 334, 340, 352, 353, 360, 369, 376, 405, 412, 441, 483, 489, 495, 502, 503, 507, 514, 529, 610, 615, 633, 638, 645, 648, 658
Offset: 1

Views

Author

J. M. Bergot and Robert Israel, May 23 2021

Keywords

Comments

Numbers k such that the sum of nonprimes <= k is prime.
If p is prime then p is a member if and only if p-1 is a member.

Examples

			a(3) = 6 is a member because A101203(6) = 1+4+6 = 11 is prime.
		

Crossrefs

Programs

  • Maple
    s:= proc(n) option remember; if isprime(n) then procname(n-1) else procname(n-1)+ n fi end proc:
    s(1):= 1:
    select(n -> isprime(s(n)), [$1..1000]);

A344581 Numbers k such that A034387(k) and A101203(k) are both prime.

Original entry on oeis.org

4, 7, 8, 15, 44, 311, 503, 507, 744, 843, 851, 955, 1164, 1256, 1287, 1307, 1312, 2163, 2171, 2244, 2247, 2368, 2412, 3143, 3160, 3872, 3875, 3952, 4584, 5088, 5236, 5355, 5364, 5380, 6211, 6303, 6307, 6587, 7243, 7244, 7436, 7439, 7860, 8220, 8268, 9167, 9283, 9515, 9519, 9632, 9692, 9915, 9919
Offset: 1

Views

Author

J. M. Bergot and Robert Israel, May 24 2021

Keywords

Comments

Numbers k such that the sums of primes <= k and of nonprimes <= k are both prime (not necessarily distinct).
All terms == 0 or 3 (mod 4).

Examples

			a(3) = 8 is a term because A034387(8) = 2+3+5+7 = 17 and A101203(8) = 1+4+6+8 = 19 are prime.
		

Crossrefs

Cf. A034387, A101203. Intersection of A228102 and A344580.

Programs

  • Maple
    sp:= proc(n) option remember; if isprime(n) then procname(n-1)+[0,n] else procname(n-1)+[n,0] fi end proc:
    sp(1):= [1,0]:
    filter:= proc(n) andmap(isprime, sp(n)) end proc:
    select(filter, [$1..10000]);

A062298 Number of nonprimes <= n.

Original entry on oeis.org

1, 1, 1, 2, 2, 3, 3, 4, 5, 6, 6, 7, 7, 8, 9, 10, 10, 11, 11, 12, 13, 14, 14, 15, 16, 17, 18, 19, 19, 20, 20, 21, 22, 23, 24, 25, 25, 26, 27, 28, 28, 29, 29, 30, 31, 32, 32, 33, 34, 35, 36, 37, 37, 38, 39, 40, 41, 42, 42, 43, 43, 44, 45, 46, 47, 48, 48, 49, 50, 51, 51, 52, 52, 53
Offset: 1

Views

Author

Amarnath Murthy, Jun 19 2001

Keywords

Comments

a(n) = n - A000720(n). This is asymptotic to n - Li(n). Note that a(n) + A095117(n) = 2*n. - Jonathan Vos Post, Nov 22 2004
Same as number of primes between n and prime(n+1) and between n and prime(n)+1 (end points excluded); n prime -> a(n)=a(n-1), n composite-> a(n)=1+a(n-1). - David James Sycamore, Jul 23 2018
There exists at least one prime number between a(n) and n for n >= 3 (see the paper by Ya-Ping Lu attached in the links). - Ya-Ping Lu, Nov 27 2020

Examples

			a(19) = 11 as there are 8 primes up to 19 (inclusive).
		

Crossrefs

Programs

  • Haskell
    a062298 n = a062298_list !! (n-1)
    a062298_list = scanl1 (+) $ map (1 -) a010051_list
    -- Reinhard Zumkeller, Oct 10 2013
    
  • Magma
    [n - #PrimesUpTo(n): n in [1..100]]; // Vincenzo Librandi, Aug 05 2015
    
  • Maple
    NumComposites := proc(N::posint) local count, i:count := 0:for i from 1 to N do if not isprime(i) then count := count + 1 fi:od: count;end:seq(NumComposites(binomial(k+1,k)), k=0..73); # Zerinvary Lajos, May 26 2008
    A062298 := proc(n) n-numtheory[pi](n) ; end: seq(A062298(n),n=1..120) ; # R. J. Mathar, Sep 27 2009
  • Mathematica
    Table[n-PrimePi[n],{n,80}] (* Harvey P. Dale, May 10 2012 *)
    Accumulate[Table[If[PrimeQ[n],0,1],{n,100}]] (* Harvey P. Dale, Feb 15 2017 *)
  • PARI
    a(n) = n-primepi(n); \\ Harry J. Smith, Aug 04 2009
    
  • Python
    from sympy import primepi
    print([n - primepi(n) for n in range(1, 101)]) # Indranil Ghosh, Mar 29 2017

Formula

a(n) = n - A000720(n).
a(n) = 1 + A065855(n). - David James Sycamore, Jul 23 2018

Extensions

Corrected and extended by Vladeta Jovovic, Jun 22 2001

A101256 Sum of composites <= n.

Original entry on oeis.org

0, 0, 0, 4, 4, 10, 10, 18, 27, 37, 37, 49, 49, 63, 78, 94, 94, 112, 112, 132, 153, 175, 175, 199, 224, 250, 277, 305, 305, 335, 335, 367, 400, 434, 469, 505, 505, 543, 582, 622, 622, 664, 664, 708, 753, 799, 799, 847, 896, 946, 997, 1049, 1049, 1103, 1158, 1214
Offset: 1

Views

Author

Reinhard Zumkeller, Jan 23 2005

Keywords

Crossrefs

Programs

  • Mathematica
    Accumulate[Table[If[n<2,0,If[PrimeQ[n], 0, n]], {n, 1, 100}]] (* James C. McMahon, Jan 07 2024 *)

Formula

a(n) = A000217(n) - A034387(n) - 1 = A101203(n) - 1.

A045717 For each prime p take the sum of nonprimes < p.

Original entry on oeis.org

1, 1, 5, 11, 38, 50, 95, 113, 176, 306, 336, 506, 623, 665, 800, 1050, 1330, 1390, 1710, 1917, 1989, 2369, 2612, 3042, 3693, 3990, 4092, 4407, 4515, 4848, 6408, 6795, 7465, 7603, 8899, 9049, 9819, 10619, 11114, 11964, 12844, 13024, 14698, 14890, 15475
Offset: 1

Views

Author

Keywords

Comments

Subsequence of A101203. - Michel Marcus, Sep 28 2013

Examples

			For p=7 we get 1+4+6=11.
		

Crossrefs

Cf. A000040.

Programs

  • Mathematica
    nn=200;With[{np=Complement[Range[nn],Prime[Range[PrimePi[nn]]]]}, Table[ Total[Select[np,#Harvey P. Dale, Jun 25 2013 *)
  • PARI
    a(n) = {my(p = prime(n)); sum (i=1, p-1, i*(! isprime(i)));} \\ Michel Marcus, Sep 28 2013
    
  • PARI
    a(n)=my(p=prime(n),s=1); forcomposite(k=4,p,s+=k);k \\ Charles R Greathouse IV, Sep 28 2013

Extensions

Corrected and extended by Erich Friedman.
Showing 1-5 of 5 results.