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-9 of 9 results.

A175966 Complement of A175965(n), where A175965(n) = the lexicographically earliest sequence with first differences as increasing sequence of noncomposites A008578.

Original entry on oeis.org

3, 5, 6, 8, 9, 10, 11, 13, 14, 15, 16, 17, 18, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 80
Offset: 1

Views

Author

Jaroslav Krizek, Oct 31 2010

Keywords

Crossrefs

A018252 The nonprime numbers: 1 together with the composite numbers, A002808.

Original entry on oeis.org

1, 4, 6, 8, 9, 10, 12, 14, 15, 16, 18, 20, 21, 22, 24, 25, 26, 27, 28, 30, 32, 33, 34, 35, 36, 38, 39, 40, 42, 44, 45, 46, 48, 49, 50, 51, 52, 54, 55, 56, 57, 58, 60, 62, 63, 64, 65, 66, 68, 69, 70, 72, 74, 75, 76, 77, 78, 80, 81, 82, 84, 85, 86, 87, 88
Offset: 1

Views

Author

Keywords

Comments

d(a(n)) != 2 (cf. A000005). - Juri-Stepan Gerasimov, Oct 17 2009
Number of prime divisors of a(n) (counted with multiplicity) != 1. - Juri-Stepan Gerasimov, Oct 30 2009
Largest nonprime < n-th composite. - Juri-Stepan Gerasimov, Oct 29 2009
The nonnegative nonprimes A141468 without zero; the natural nonprimes; the whole nonprimes; the counting nonprimes. If the nonprime numbers A141468 which are also the nonnegative integers A001477, then the nonprimes A141468 also called the nonnegative nonprimes. If the nonprime numbers A018252 which are also the natural (or whole or counting) numbers A000027, then the nonprimes A018252 also called the natural nonprimes, the whole nonprimes and the counting nonprimes. - Juri-Stepan Gerasimov, Nov 22 2009
Smallest nonprime > n-th nonnegative nonprime. - Juri-Stepan Gerasimov, Dec 04 2009
a(n) = A175944(A014284(n)) = A175944(A175965(n)). - Reinhard Zumkeller, Mar 18 2011

References

  • G. H. Hardy and E. M. Wright, An Introduction to the Theory of Numbers. 3rd ed., Oxford Univ. Press, 1954, p. 2.

Crossrefs

Cf. A000040 (complement), A002808.
Boustrophedon transforms: A230955, A230954.

Programs

  • GAP
    A018252 := Difference([1..10^5], Filtered([1..10^5], IsPrime)); # Muniru A Asiru, Oct 21 2017
    
  • Haskell
    a018252 n = a018252_list !! (n-1)
    a018252_list = filter ((== 0) . a010051) [1..]
    -- Reinhard Zumkeller, Mar 31 2014
    
  • Magma
    [n : n in [1..100] | not IsPrime(n) ];
    
  • Maple
    with(numtheory); sort(convert(convert([ seq(i,i=1..541) ],set) minus convert([ seq(ithprime(i),i=1..100) ],set),list));
    seq(`if`(not isprime(n),n,NULL),n=1..88); # Peter Luschny, Jul 29 2009
    A018252 := proc(n) option remember; if n = 1 then 1; else for a from procname(n-1)+1 do if not isprime(a) then return a; end if; end do; end if; end proc: # R. J. Mathar, Oct 22 2010
  • Mathematica
    nonPrime[n_Integer] := FixedPoint[n + PrimePi@# &, n + PrimePi@ n]; Array[ nonPrime, 75] (* Robert G. Wilson v, Jan 29 2015, based on the algorithm by Labos Elemer in A006508 *)
    max = 90; Complement[Range[max], Prime[Range[PrimePi[max]]]] (* Harvey P. Dale, Aug 12 2011 *)
    Join[{1}, Select[Range[100], CompositeQ]] (* Jean-François Alcover, Nov 07 2021 *)
  • PARI
    isA018252(n) = !isprime(n)
    A018252(n) = {local(a,b);b=n;a=1;while(a!=b,a=b;b=n+primepi(a));b} \\ Michael B. Porter, Nov 06 2009
    
  • PARI
    a(n) = my(k=0); while(-n+n-=k-k=primepi(n), ); n; \\ Ruud H.G. van Tol, Jul 15 2024 (after code in A002808)
    
  • Python
    from sympy import isprime
    def ok(n): return not isprime(n)
    print([k for k in range(1, 89) if ok(k)]) # Michael S. Branicky, Nov 10 2022
    
  • Python
    from sympy import composite
    def A018252(n): return 1 if n == 1 else composite(n-1) # Chai Wah Wu, Nov 15 2022
  • Sage
    def A018252_list(n) :
        return [k for k in (1..n) if not k.is_prime()]
    A018252_list(88)  # Peter Luschny, Feb 03 2012
    

Formula

Let b(0) = n + pi(n) and b(n+1) = n + pi(b(n)), with pi(n) = A000720(n); then a(n) is the limit value of b(n). - Floor van Lamoen, Oct 08 2001
a(n) = A137621(A137624(n)). - Reinhard Zumkeller, Jan 30 2008
A010051(a(n)) = 0. - Reinhard Zumkeller, Mar 31 2014
A239968(a(n)) = n. - Reinhard Zumkeller, Dec 02 2014

A014284 Partial sums of primes, if 1 is regarded as a prime (as it was until quite recently, see A008578).

Original entry on oeis.org

1, 3, 6, 11, 18, 29, 42, 59, 78, 101, 130, 161, 198, 239, 282, 329, 382, 441, 502, 569, 640, 713, 792, 875, 964, 1061, 1162, 1265, 1372, 1481, 1594, 1721, 1852, 1989, 2128, 2277, 2428, 2585, 2748, 2915, 3088, 3267, 3448, 3639, 3832, 4029
Offset: 1

Views

Author

Deepan Majmudar (dmajmuda(AT)esq.com)

Keywords

Comments

Lexicographically earliest sequence whose first differences are an increasing sequence of primes. Complement of A175969. - Jaroslav Krizek, Oct 31 2010
A175944(a(n)) = A018252(n). - Reinhard Zumkeller, Mar 18 2011
Partial sums of noncomposite numbers (A008578). - Omar E. Pol, Aug 09 2012

Examples

			a(7) = 42 because the first six primes (2, 3, 5, 7, 11, 13) add up to 41, and 1 + 41 = 42.
		

Crossrefs

Cf. A007504.
Equals A036439(n) - 1.
Cf. A008578.

Programs

Formula

a(n) = Sum_{k <= n} [(A158611(k + 1)) * (A000012(n - k + 1))] = Sum_{k <= n} [(A158611(k + 1)) * (A000012(k))] = Sum_{k <= n} [(A008578(k)) * (A000012(n - k + 1))] = Sum_{k <= n} [(A008578(k)) * (A000012(k))] for n, k >= 1. - Jaroslav Krizek, Aug 05 2009
a(n + 1) = A007504(n) + 1. a(n + 1) - a(n) = A000040(n) = n-th primes. - Jaroslav Krizek, Aug 19 2009
a(n) = a(n-1) + prime(n-1), with a(1)=1. - Vincenzo Librandi, Jul 27 2013
G.f: (x*(1+b(x)))/(1-x) = c(x)/(1-x), where b(x) and c(x) are respectively the g.f. of A000040 and A008578. - Mario C. Enriquez, Dec 10 2016

Extensions

Correction for Aug 2009 change of offset in A158611 and A008578 by Jaroslav Krizek, Jan 27 2010

A051349 Sum of first n nonprimes.

Original entry on oeis.org

0, 1, 5, 11, 19, 28, 38, 50, 64, 79, 95, 113, 133, 154, 176, 200, 225, 251, 278, 306, 336, 368, 401, 435, 470, 506, 544, 583, 623, 665, 709, 754, 800, 848, 897, 947, 998, 1050, 1104, 1159, 1215, 1272, 1330, 1390, 1452, 1515, 1579, 1644, 1710, 1778, 1847, 1917
Offset: 0

Views

Author

Armand Turpel (armandt(AT)unforgettable.com)

Keywords

Comments

Partial sums of A141468 or A018252. - R. J. Mathar, Mar 01 2009
The lexicographically earliest sequence with first differences as increasing sequence of composites A002808. Complement of A175970. See A175965, A175966, A175967, A014284, A175969, A175970. - Jaroslav Krizek, Oct 31 2010

Crossrefs

Programs

  • Maple
    ithnonprime := proc(n)local k: option remember: if(n=1)then return 1: fi: for k from procname(n-1)+1 do if(not isprime(k))then return k fi: od: end: A051349 := proc(n) option remember: local k: if(n<=1)then return n: fi: return ithnonprime(n)+procname(n-1): end: seq(A051349(n),n=0..51); # Nathaniel Johnston, May 25 2011
  • Mathematica
    lst={};s=0;Do[If[ !PrimeQ[n], s=s+n;AppendTo[lst, s]], {n, 0, 10^2}];lst (* Vladimir Joseph Stephan Orlovsky, Aug 14 2008 *)

Formula

Sum_{n>=1} 1/a(n) = A122998. - Amiram Eldar, Nov 17 2020

A175967 Lexicographically earliest sequence with first differences as increasing sequence of nonprimes A018252.

Original entry on oeis.org

1, 2, 6, 12, 20, 29, 39, 51, 65, 80, 96, 114, 134, 155, 177, 201, 226, 252, 279, 307, 337, 369, 402, 436, 471, 507, 545, 584, 624, 666, 710, 755, 801, 849, 898, 948, 999, 1051, 1105, 1160, 1216, 1273, 1331, 1391, 1453, 1516, 1580, 1645, 1711, 1779
Offset: 1

Views

Author

Jaroslav Krizek, Oct 31 2010

Keywords

Comments

Complement of A175968.

Crossrefs

Programs

  • Haskell
    a175967 n = a175967_list !! n
    a175967_list = scanl (+) 1 a018252_list
    -- Reinhard Zumkeller, Mar 26 2015

Formula

a(n) - a(n-1) = A018252(n-1) for n >= 2.

A175944 1 appears once, n-th prime p appears p times.

Original entry on oeis.org

1, 2, 2, 3, 3, 3, 5, 5, 5, 5, 5, 7, 7, 7, 7, 7, 7, 7, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Oct 27 2010

Keywords

Comments

a(A014284(n)) = a(A175965(n)) = A018252(n). [Reinhard Zumkeller, Mar 18 2011]
This is how A063905 would have been reckoned at the beginning of the 20th century, taking the primes as given in A008578 instead of the way they are given in A000040. [Alonso del Arte, Sep 09 2011]

Crossrefs

Cf. A063905.
Cf. A005145.

Programs

  • Haskell
    a175944 n = a175944_list !! (n-1)
    a175944_list =
       concat $ zipWith ($) (map replicate a018252_list) a018252_list
    -- Reinhard Zumkeller, Mar 18 2011
  • Mathematica
    Join[{1}, Flatten[Table[Prime[n], {n, 8}, {Prime[n]}]]] (* Alonso del Arte, Sep 08 2011 based on Robert G. Wilson v's program for A002024 *)
    Join[{1},Flatten[Table[PadRight[{},n,n],{n,Prime[Range[10]]}]]] (* Harvey P. Dale, May 16 2019 *)

Formula

a(1)=1, a(n)=A063905(n-1) for n>1.

A175969 Complement of A014284(n), where A014284(n) = the lexicographically earliest sequence with first differences as increasing sequence of primes A000040.

Original entry on oeis.org

2, 4, 5, 7, 8, 9, 10, 12, 13, 14, 15, 16, 17, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70
Offset: 1

Views

Author

Jaroslav Krizek, Oct 31 2010

Keywords

Crossrefs

A175970 Complement of A051349(n), where A051349(n) = the lexicographically earliest sequence with first differences as increasing sequence of composites A002808(n).

Original entry on oeis.org

2, 3, 4, 6, 7, 8, 9, 10, 12, 13, 14, 15, 16, 17, 18, 20, 21, 22, 23, 24, 25, 26, 27, 29, 30, 31, 32, 33, 34, 35, 36, 37, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 65, 66, 67, 68, 69, 70
Offset: 1

Views

Author

Jaroslav Krizek, Oct 31 2010

Keywords

Crossrefs

A175968 Complement of A175967(n), where A175967(n) = the lexicographically earliest sequence with first differences as increasing sequence of nonprimes A018252(n).

Original entry on oeis.org

3, 4, 5, 7, 8, 9, 10, 11, 13, 14, 15, 16, 17, 18, 19, 21, 22, 23, 24, 25, 26, 27, 28, 30, 31, 32, 33, 34, 35, 36, 37, 38, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79
Offset: 1

Views

Author

Jaroslav Krizek, Oct 31 2010

Keywords

Crossrefs

Showing 1-9 of 9 results.