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

A073168 a(n) = A007821(n) - A022449(n).

Original entry on oeis.org

1, 5, 9, 9, 9, 15, 16, 17, 18, 17, 25, 19, 21, 27, 31, 26, 21, 22, 21, 35, 38, 31, 35, 31, 34, 33, 37, 39, 49, 49, 33, 52, 49, 47, 39, 43, 47, 47, 48, 48, 41, 49, 48, 60, 59, 59, 49, 52, 58, 58, 63, 71, 75, 65, 65, 67, 71, 79, 75, 81, 84, 77, 65, 69, 72, 72, 67, 69, 61, 65, 65
Offset: 1

Views

Author

Labos Elemer, Jul 19 2002

Keywords

Comments

Values of commutator of A000040 and A002808 functions i.e., of prime() and composite().

Crossrefs

Programs

  • Mathematica
    c[n_Integer] := FixedPoint[n+PrimePi[ # ]+1&, n] Table[Prime[c[w]]-c[Prime[w]], {w, 1, 10000}];

A050435 a(n) = composite(composite(n)), where composite = A002808, composite numbers.

Original entry on oeis.org

9, 12, 15, 16, 18, 21, 24, 25, 26, 28, 32, 33, 34, 36, 38, 39, 40, 42, 45, 48, 49, 50, 51, 52, 55, 56, 57, 60, 63, 64, 65, 68, 69, 70, 72, 74, 76, 77, 78, 80, 81, 84, 86, 87, 88, 90, 91, 93, 94, 95, 98, 100, 102, 104, 105, 106, 110, 111, 112, 115, 116, 117, 118, 119
Offset: 1

Views

Author

Michael Lugo (mlugo(AT)thelabelguy.com), Dec 22 1999

Keywords

Comments

Second-order composite numbers.
Composites (A002808) with composite (A002808) subscripts. a(n) U A022449(n) = A002808(n). Subsequence of A175251 (composites (A002808) with nonprime (A018252) subscripts), a(n) = A175251(n+1) for n >= 1. - Jaroslav Krizek, Mar 14 2010

Examples

			The 2nd composite number is 6 and the 6th composite number is 12, so a(2) = 12. a(100) = A002808(A002808(100)) = A002808(133) = 174.
		

Crossrefs

Programs

  • Haskell
    a050435 = a002808 . a002808
    a050435_list = map a002808 a002808_list
    -- Reinhard Zumkeller, Jan 12 2013
    
  • Mathematica
    Select[ Range[ 6, 150 ], ! PrimeQ[ # ] && ! PrimeQ[ # - PrimePi[ # ] - 1 ] & ]
    With[{cmps=Select[Range[200],CompositeQ]},Table[cmps[[cmps[[n]]]],{n,70}]] (* Harvey P. Dale, Feb 18 2018 *)
  • PARI
    composite(n)=my(k=-1); while(-n + n += -k + k=primepi(n), ); n \\ M. F. Hasler
    a(n)=composite(composite(n)) \\ Charles R Greathouse IV, Jun 25 2017
    
  • Python
    from sympy import composite
    def a(n): return composite(composite(n))
    print([a(n) for n in range(1, 65)]) # Michael S. Branicky, Sep 12 2021

Formula

Let C(n) be the n-th composite number, with C(1)=4. Then these are numbers C(C(n)).
a(n) = n + 2n/log n + O(n/log^2 n). - Charles R Greathouse IV, Jun 25 2017

Extensions

More terms from Robert G. Wilson v, Dec 20 2000

A065858 m-th composite number c(m) = A002808(m), where m is the n-th prime number: a(n) = A002808(A000040(n)).

Original entry on oeis.org

6, 8, 10, 14, 20, 22, 27, 30, 35, 44, 46, 54, 58, 62, 66, 75, 82, 85, 92, 96, 99, 108, 114, 120, 129, 134, 136, 142, 144, 148, 166, 171, 178, 182, 194, 196, 204, 210, 215, 221, 230, 232, 245, 247, 252, 254, 268, 285, 289, 291, 296, 302, 304, 318, 324, 330, 338
Offset: 1

Views

Author

Labos Elemer, Nov 26 2001

Keywords

Comments

Composites (A002808) with prime (A000040) subscripts. a(n) U A175251(n) = A002808(n). Subsequence of A022449 (composites (A002808) with noncomposite (A008578) subscripts), a(n) = A022449(n+1). - Jaroslav Krizek, Mar 14 2010

Crossrefs

Programs

  • Maple
    P,C:= selectremove(isprime,[seq(i,i=2..10^3)]):
    seq(C[P[i]],i=1..100); # Robert Israel, Mar 09 2025
  • Mathematica
    Composite[n_] := FixedPoint[n + PrimePi[#] + 1 & , n + PrimePi[n] + 1];
    a[n_] := Composite[Prime[n]];
    Array[a, 100] (* Jean-François Alcover, Jan 26 2018, after Robert G. Wilson v *)

A059981 Order of compositeness for the n-th composite number.

Original entry on oeis.org

1, 1, 1, 2, 1, 2, 1, 2, 3, 2, 1, 3, 1, 2, 3, 4, 1, 3, 1, 2, 4, 2, 1, 3, 4, 5, 2, 4, 1, 2, 1, 3, 5, 3, 2, 4, 1, 5, 6, 3, 1, 5, 1, 2, 3, 2, 1, 4, 6, 4, 3, 5, 1, 2, 6, 7, 4, 2, 1, 6, 1, 2, 3, 4, 3, 2, 1, 5, 7, 5, 1, 4, 1, 6, 2, 3, 7, 8, 1, 5, 3, 2, 1, 7, 2, 3, 4
Offset: 1

Views

Author

Robert G. Wilson v, Mar 06 2001

Keywords

Comments

Let c(k) = k-th composite number, let S(c) = S(c(k)) = k, the subscript of c; a(n) = order of compositeness of c(n) = 1+m where m is largest number such that S(S(..S(c(n))...)) with m S's is a composite.
Number of steps in the composite index chain for the n-th composite. - Daniel Forgues, Sep 28 2012

Examples

			16 is 9th composite number, so S(16)=9, 9 is 4th composite, so S(S(16))=4, 4 is first composite number, so S(S(S(16)))=1, not a composite number. Thus a(9)=3.
4 is the first composite number, so S(4)=1, not a composite number. Thus a(1)=1.
		

Crossrefs

Cf. A049076, A022449 (composites with compositeness 1).

Programs

  • Mathematica
    Composite[ n_Integer ] := (k = n + PrimePi[ n ] + 1; While[ k != n + PrimePi[ k ] + 1, k++ ]; k); CompositePi[ n_Integer ] := (n - 1 - PrimePi[ n ]); Attributes[ Composite ] = Attributes[ CompositePi ] = Listable; Table[ c = 1; k = CompositePi[ Composite[ n ] ]; While[ ! (PrimeQ[ k ] || k == 1), k = CompositePi[ k ]; c++ ]; c, {n, 100} ]

A073169 a(n)=A002808(n)-n, difference between n-th composite and n.

Original entry on oeis.org

3, 4, 5, 5, 5, 6, 7, 7, 7, 8, 9, 9, 9, 10, 10, 10, 10, 10, 11, 12, 12, 12, 12, 12, 13, 13, 13, 14, 15, 15, 15, 16, 16, 16, 16, 16, 17, 17, 17, 17, 17, 18, 19, 19, 19, 19, 19, 20, 20, 20, 21, 22, 22, 22, 22, 22, 23, 23, 23, 24, 24, 24, 24, 24, 25, 25, 25, 25, 25, 25, 25, 26, 26
Offset: 1

Views

Author

Labos Elemer, Jul 19 2002

Keywords

Comments

a(n) = the number of numbers of set {1, prime} (A008578(n)) less than n-th composite numbers (A002808(n)). a(n) = inverse (frequency distribution) sequence of A162177(n), i.e. number of terms of sequence A162177(n) less than n for n >= 1. a(n) = A002808(n) + A162177(n) - A158611(n+1) for n >= 1. a(n) = A002808(n) + A162177(n) - A008578(n) for n >= 1. [From Jaroslav Krizek, Jul 23 2009]

Crossrefs

Programs

  • Mathematica
    c[n_Integer] := FixedPoint[n+PrimePi[ # ]+1&, n] Table[c[w]-w, {w, 1, 128}]
    With[{c=Select[Range[100],CompositeQ]},#[[1]]-#[[2]]&/@Thread[ {c,Range[ Length[ c]]}]] (* Harvey P. Dale, Feb 03 2015 *)

Formula

a(n)=1+A073425(n). [From R. J. Mathar, Jul 31 2009]

Extensions

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

A236536 Array T(n,k) read along antidiagonals: the composites of order of compositeness n in row n.

Original entry on oeis.org

4, 6, 9, 8, 12, 16, 10, 15, 21, 26, 14, 18, 25, 33, 39, 20, 24, 28, 38, 49, 56, 22, 32, 36, 42, 55, 69, 78, 27, 34, 48, 52, 60, 77, 94, 106, 30, 40, 50, 68, 74, 84, 105, 125, 141, 35, 45, 57, 70, 93, 100, 115, 140, 164, 184, 44, 51, 64, 80, 95, 124, 133, 152, 183, 212, 236, 46, 63, 72, 88, 110, 126, 162, 174, 198, 235, 270, 299
Offset: 1

Views

Author

R. J. Mathar, Jan 28 2014

Keywords

Comments

Row n contains the composites A002808(j) for which A059981(j) = n.
The 1st row contains the composites with a nonprime index, A002808(1)=4, A002808(2)=6, A002808(3)=8, A002808(5)=10, A002808(7)=14,...
The 2nd row contains the composites with an index in the 1st row.
Recursively the followup rows contain the composites that need a higher number of applications of A002808 to reach a nonprime.

Examples

			The array starts:
  4,  6,  8, 10, 14, 20, 22, 27, 30, 35,...
  9, 12, 15, 18, 24, 32, 34, 40, 45, 51,...
 16, 21, 25, 28, 36, 48, 50, 57, 64, 72,...
 26, 33, 38, 42, 52, 68, 70, 80, 88, 98,...
 39, 49, 55, 60, 74, 93, 95,110,119,130,...
 56, 69, 77, 84,100,124,126,145,156,170,...
 78, 94,105,115,133,162,165,188,203,218,...
106,125,140,152,174,209,213,242,259,278,...
141,164,183,198,222,266,272,305,326,348,...
		

Crossrefs

Cf. A006508 (column 1), A022449 (row 1), A135044, A236542, A002808.

Programs

  • Maple
    A236536 := proc(n,k)
        option remember ;
        if n = 1 then
            A022449(k) ;
        else
            A002808(procname(n-1,k)) ;
        end if:
    end proc:
    for d from 2 to 10 do
         for k from d-1 to  by -1 do
            printf("%3d,",A236536(d-k,k)) ;
         end do:
    end do:
  • Mathematica
    Composite[n_] := FixedPoint[n + PrimePi[#] + 1&, n + PrimePi[n] + 1];
    T[n_, k_] := T[n, k] = If[n == 1, Composite[If[k == 1, 1, Prime[k - 1]]], Composite[T[n - 1, k]]];
    Table[T[n - k + 1, k], {n, 1, 12}, {k, n, 1, -1}] // Flatten (* Jean-François Alcover, Sep 16 2023 *)

Formula

T(1,k) = A022449(k).
T(n,k) = A002808( T(n-1,k) ), n>1 .

A175251 Composites (A002808) with nonprime (A018252) subscripts.

Original entry on oeis.org

4, 9, 12, 15, 16, 18, 21, 24, 25, 26, 28, 32, 33, 34, 36, 38, 39, 40, 42, 45, 48, 49, 50, 51, 52, 55, 56, 57, 60, 63, 64, 65, 68, 69, 70, 72, 74, 76, 77, 78, 80, 81, 84, 86, 87, 88, 90, 91, 93, 94, 95, 98, 100
Offset: 1

Views

Author

Jaroslav Krizek, Mar 13 2010

Keywords

Comments

a(n) = composite(nonprime(n)) = A002808(A018252(n)). a(n) U A065858(n) = A002808(n), a(n+1) U A022449(n) = A002808(n) for n >= 1. a(1) = 4, a(n) = A050435(n-1) = composites (A002808) with composite (A002808) subscripts for n >=2.

Examples

			a(5) = 16 because a(5) = c(b(5)) = c(9) = 16, c = composite, b = nonprime.
		

A260621 Let b(k, n) = number obtained when the map x->A002808(x) is applied k times to n; a(n) is the smallest k such that b(k, n) + 1 is prime.

Original entry on oeis.org

1, 1, 12, 2, 1, 1, 3, 11, 1, 1, 7, 9, 1, 2, 10, 4, 2, 1, 1, 6, 8, 3, 3, 1, 9, 3, 1, 1, 18, 3, 1, 5, 7, 2, 2, 1, 4, 8, 2, 14, 1, 1, 6, 17, 2, 6, 1, 4, 6, 1, 1, 2, 2, 3, 7, 1, 13, 6, 1, 4, 16, 5, 16, 1, 5, 31, 35, 3, 5, 2, 1, 2, 3, 1, 1, 2, 6, 1, 1, 12, 5, 1, 2
Offset: 1

Views

Author

Matthew Campbell, Sep 25 2015

Keywords

Comments

a(n) is also the smallest value of k at which b(k, n+1) - b(k, n) > 1.

Examples

			When n = 3, writing Composite(x) for A002808(x):
1. Composite(3) = 8. 8 + 1 = 9 = 3^2. 9 is not prime.
2. Composite(8) = 15. 15 + 1 = 16 = 2^4. 16 is not prime.
3. Composite(15) = 25. 25 + 1 = 26 = 2*13. 26 is not prime.
4. Composite(25) = 38. 38 + 1 = 39 = 3*13. 39 is not prime.
5. Composite(38) = 55. 55 + 1 = 56 = 2^3*7. 56 is not prime.
6. Composite(55) = 77. 77 + 1 = 78 = 2*3*13. 78 is not prime.
7. Composite(77) = 105. 105 + 1 = 106 = 2*53. 106 is not prime.
8. Composite(105) = 140. 140 + 1 = 141 = 3*47. 141 is not prime.
9. Composite(140) = 183. 183 + 1 = 184 = 2^3*23. 184 is not prime.
10. Composite(183) = 235. 235 + 1 = 236 = 2^2*59. 236 is not prime.
11. Composite(235) = 298. 298 + 1 = 299 = 13*23. 299 is not prime.
12. Composite(298) = 372. 372 + 1 = 373. 373 is prime.
--------------------------------------------------------------
Since the composite function was applied 12 times, a(3)=12.
		

Crossrefs

Primes and nonprimes: A000040, A002808, A008578, A018252.
a(1) = p, a(n+1) = a(n)-th composite number: A006508, A022450, A022451, A025010, A025011, A059407, A059408.
Composites with order n > 1: A050435, A050436, A050438, A050439, A050440.
Composites with order n = b, n >= 1: A022449.
Composites with prime subscripts: A065858.
Composites without prime subscripts: A175251.
Order of compositeness: A059981, A236536.
Prime(n)-1: A006093.

Programs

  • Mathematica
    c = Select[Range[10^5], CompositeQ]; Table[k = 1; While[! PrimeQ[Nest[c[[#]] &, n, k] + 1], k++]; k, {n, 120}] (* Michael De Vlieger, Jul 15 2016 *)

Extensions

Terms from a(12) onward from Jon E. Schoenfield, Sep 27 2015
Showing 1-8 of 8 results.